}
};
-/// RegisterOpt - Register something that is to show up in Opt, this is just a
-/// shortcut for specifying RegisterPass...
-///
-template<typename PassName>
-struct RegisterOpt : public RegisterPassBase {
- RegisterOpt(const char *PassArg, const char *Name, bool CFGOnly = false)
- : RegisterPassBase(Name, PassArg, typeid(PassName),
- callDefaultCtor<PassName>) {
- if (CFGOnly) setOnlyUsesCFG();
- }
-
- /// Register Pass using default constructor explicitly...
- ///
- RegisterOpt(const char *PassArg, const char *Name, Pass *(*ctor)(),
- bool CFGOnly = false)
- : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) {
- if (CFGOnly) setOnlyUsesCFG();
- }
-
- /// Register FunctionPass using default constructor explicitly...
- ///
- RegisterOpt(const char *PassArg, const char *Name, FunctionPass *(*ctor)(),
- bool CFGOnly = false)
- : RegisterPassBase(Name, PassArg, typeid(PassName),
- static_cast<Pass*(*)()>(ctor)) {
- if (CFGOnly) setOnlyUsesCFG();
- }
-
- /// Register Pass using TargetMachine constructor...
- ///
- RegisterOpt(const char *PassArg, const char *Name,
- Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false)
- : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) {
- if (CFGOnly) setOnlyUsesCFG();
- }
-
- /// Register FunctionPass using TargetMachine constructor...
- ///
- RegisterOpt(const char *PassArg, const char *Name,
- FunctionPass *(*targetctor)(TargetMachine &),
- bool CFGOnly = false)
- : RegisterPassBase(Name, PassArg, typeid(PassName), 0,
- static_cast<Pass*(*)(TargetMachine&)>(targetctor)) {
- if (CFGOnly) setOnlyUsesCFG();
- }
-};
-
/// RegisterAnalysisGroup - Register a Pass as a member of an analysis _group_.
/// Analysis groups are used to define an interface (which need not derive from
}
};
- RegisterOpt<AliasAnalysisCounter>
+ RegisterPass<AliasAnalysisCounter>
X("count-aa", "Count Alias Analysis Query Responses");
RegisterAnalysisGroup<AliasAnalysis, AliasAnalysisCounter> Y;
}
bool doFinalization(Module &M);
};
- RegisterOpt<AAEval>
+ RegisterPass<AAEval>
X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator");
}
return false;
}
};
- RegisterOpt<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
+ RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
}
};
// Register this pass...
- RegisterOpt<NoAA>
+ RegisterPass<NoAA>
U("no-aa", "No Alias Analysis (always returns 'may' alias)");
// Declare that we implement the AliasAnalysis interface
};
// Register this pass...
- RegisterOpt<BasicAliasAnalysis>
+ RegisterPass<BasicAliasAnalysis>
X("basicaa", "Basic Alias Analysis (default AA impl)");
// Declare that we implement the AliasAnalysis interface
};
// Register the pass...
- RegisterOpt<DSAA> X("ds-aa", "Data Structure Graph Based Alias Analysis");
+ RegisterPass<DSAA> X("ds-aa", "Data Structure Graph Based Alias Analysis");
// Register as an implementation of AliasAnalysis
RegisterAnalysisGroup<AliasAnalysis, DSAA> Y;
bool OptimizeGlobals(Module &M);
};
- RegisterOpt<DSOpt> X("ds-opt", "DSA-based simple optimizations");
+ RegisterPass<DSOpt> X("ds-opt", "DSA-based simple optimizations");
}
ModulePass *llvm::createDSOptPass() { return new DSOpt(); }
};
// Register the pass...
- RegisterOpt<Steens> X("steens-aa",
- "Steensgaard's alias analysis (DSGraph based)");
+ RegisterPass<Steens> X("steens-aa",
+ "Steensgaard's alias analysis (DSGraph based)");
// Register as an implementation of AliasAnalysis
RegisterAnalysisGroup<AliasAnalysis, Steens> Y;
void visitInstruction(Instruction &I);
};
- RegisterOpt<Andersens> X("anders-aa",
- "Andersen's Interprocedural Alias Analysis");
+ RegisterPass<Andersens> X("anders-aa",
+ "Andersen's Interprocedural Alias Analysis");
RegisterAnalysisGroup<AliasAnalysis, Andersens> Y;
}
};
RegisterAnalysisGroup<CallGraph> X("Call Graph");
-RegisterOpt<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction");
+RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction");
RegisterAnalysisGroup<CallGraph, BasicCallGraph, true> Z;
} //End anonymous namespace
std::vector<Function*> &Writers);
};
- RegisterOpt<GlobalsModRef> X("globalsmodref-aa",
- "Simple mod/ref analysis for globals");
+ RegisterPass<GlobalsModRef> X("globalsmodref-aa",
+ "Simple mod/ref analysis for globals");
RegisterAnalysisGroup<AliasAnalysis, GlobalsModRef> Y;
}
};
// Register this pass...
- RegisterOpt<LoadVN> X("load-vn", "Load Value Numbering");
+ RegisterPass<LoadVN> X("load-vn", "Load Value Numbering");
// Declare that we implement the ValueNumbering interface
RegisterAnalysisGroup<ValueNumbering, LoadVN> Y;
struct NoProfileInfo : public ImmutablePass, public ProfileInfo {};
// Register this pass...
- RegisterOpt<NoProfileInfo>
+ RegisterPass<NoProfileInfo>
X("no-profile", "No Profile Information");
// Declare that we implement the ProfileInfo interface
virtual bool runOnModule(Module &M);
};
- RegisterOpt<LoaderPass>
+ RegisterPass<LoaderPass>
X("profile-loader", "Load profile information from llvmprof.out");
RegisterAnalysisGroup<ProfileInfo, LoaderPass> Y;
};
// Register this pass...
- RegisterOpt<BasicVN>
+ RegisterPass<BasicVN>
X("basicvn", "Basic Value Numbering (default GVN impl)");
// Declare that we implement the ValueNumbering interface
class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
virtual bool runOnFunction(Function &F);
};
- RegisterOpt<UnreachableBlockElim>
+ RegisterPass<UnreachableBlockElim>
X("unreachableblockelim", "Remove unreachable blocks from the CFG");
}
return false;
}
};
- RegisterOpt<Hello> X("hello", "Hello World Pass");
+ RegisterPass<Hello> X("hello", "Hello World Pass");
// Hello2 - The second implementation with getAnalysisUsage implemented.
struct Hello2 : public FunctionPass {
AU.setPreservesAll();
};
};
- RegisterOpt<Hello2> Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)");
+ RegisterPass<Hello2> Y("hello2",
+ "Hello World Pass (with getAnalysisUsage implemented)");
}
Function *DoPromotion(Function *F, std::vector<Argument*> &ArgsToPromote);
};
- RegisterOpt<ArgPromotion> X("argpromotion",
- "Promote 'by reference' arguments to scalars");
+ RegisterPass<ArgPromotion> X("argpromotion",
+ "Promote 'by reference' arguments to scalars");
}
ModulePass *llvm::createArgumentPromotionPass() {
bool runOnModule(Module &M);
};
- RegisterOpt<ConstantMerge> X("constmerge","Merge Duplicate Global Constants");
+ RegisterPass<ConstantMerge>X("constmerge","Merge Duplicate Global Constants");
}
ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); }
void RemoveDeadArgumentsFromFunction(Function *F);
};
- RegisterOpt<DAE> X("deadargelim", "Dead Argument Elimination");
+ RegisterPass<DAE> X("deadargelim", "Dead Argument Elimination");
/// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but
/// deletes arguments to functions which are external. This is only for use
AU.addRequired<FindUsedTypes>();
}
};
- RegisterOpt<DTE> X("deadtypeelim", "Dead Type Elimination");
+ RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
Statistic<>
NumKilled("deadtypeelim", "Number of unused typenames removed from symtab");
}
bool runOnModule(Module &M);
};
- RegisterOpt<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
+ RegisterPass<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
}
ModulePass *llvm::createFunctionResolvingPass() {
Globals[F->getName()].push_back(F);
}
- for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) {
+ for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+ I != E; ) {
GlobalVariable *GV = I++;
if (GV->use_empty() && GV->isExternal()) {
M.getGlobalList().erase(GV);
++I;
}
- for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; )
+ for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+ I != E; )
if (I->isExternal() && I->use_empty()) {
GlobalVariable *GV = I;
++I;
bool SafeToDestroyConstant(Constant* C);
bool RemoveUnusedGlobalValue(GlobalValue &GV);
};
- RegisterOpt<GlobalDCE> X("globaldce", "Dead Global Elimination");
+ RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
}
ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); }
bool OptimizeFunctions(Module &M);
bool OptimizeGlobalVars(Module &M);
bool OptimizeGlobalCtorsList(GlobalVariable *&GCL);
- bool ProcessInternalGlobal(GlobalVariable *GV, Module::global_iterator &GVI);
+ bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI);
};
- RegisterOpt<GlobalOpt> X("globalopt", "Global Variable Optimizer");
+ RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer");
}
ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); }
// OptimizeOnceStoredGlobal - Try to optimize globals based on the knowledge
// that only one value (besides its initializer) is ever stored to the global.
static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
- Module::global_iterator &GVI, TargetData &TD) {
+ Module::global_iterator &GVI,
+ TargetData &TD) {
if (CastInst *CI = dyn_cast<CastInst>(StoredOnceVal))
StoredOnceVal = CI->getOperand(0);
else if (GetElementPtrInst *GEPI =dyn_cast<GetElementPtrInst>(StoredOnceVal)){
Statistic<> NumArgumentsProped("ipconstprop",
"Number of args turned into constants");
Statistic<> NumReturnValProped("ipconstprop",
- "Number of return values turned into constants");
+ "Number of return values turned into constants");
/// IPCP - The interprocedural constant propagation pass
///
bool PropagateConstantsIntoArguments(Function &F);
bool PropagateConstantReturn(Function &F);
};
- RegisterOpt<IPCP> X("ipconstprop", "Interprocedural constant propagation");
+ RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation");
}
ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); }
/// constant in for an argument, propagate that constant in as the argument.
///
bool IPCP::PropagateConstantsIntoArguments(Function &F) {
- if (F.arg_empty() || F.use_empty()) return false; // No arguments? Early exit.
+ if (F.arg_empty() || F.use_empty()) return false; // No arguments? Early exit.
std::vector<std::pair<Constant*, bool> > ArgumentConstants;
ArgumentConstants.resize(F.arg_size());
IndMemRemPass();
virtual bool runOnModule(Module &M);
};
- RegisterOpt<IndMemRemPass> X("indmemrem", "Indirect Malloc and Free Removal");
+ RegisterPass<IndMemRemPass> X("indmemrem","Indirect Malloc and Free Removal");
} // end anonymous namespace
public:
int getInlineCost(CallSite CS);
};
- RegisterOpt<SimpleInliner> X("inline", "Function Integration/Inlining");
+ RegisterPass<SimpleInliner> X("inline", "Function Integration/Inlining");
}
ModulePass *llvm::createFunctionInliningPass() { return new SimpleInliner(); }
void LoadFile(const char *Filename);
virtual bool runOnModule(Module &M);
};
- RegisterOpt<InternalizePass> X("internalize", "Internalize Global Symbols");
+ RegisterPass<InternalizePass> X("internalize", "Internalize Global Symbols");
} // end anonymous namespace
InternalizePass::InternalizePass(bool InternalizeEverything)
}
};
- RegisterOpt<LoopExtractor>
+ RegisterPass<LoopExtractor>
X("loop-extract", "Extract loops into new functions");
/// SingleLoopExtractor - For bugpoint.
SingleLoopExtractor() : LoopExtractor(1) {}
};
- RegisterOpt<SingleLoopExtractor>
+ RegisterPass<SingleLoopExtractor>
Y("loop-extract-single", "Extract at most one loop into a new function");
} // End anonymous namespace
bool runOnModule(Module &M);
};
- RegisterOpt<BlockExtractorPass>
+ RegisterPass<BlockExtractorPass>
XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
}
bool doInitialization(Module& M);
};
- RegisterOpt<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
+ RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
} // end anonymous namespace
// run - Run the transformation on the program. We grab the function
bool SimplifyFunction(Function *F);
void DeleteBasicBlock(BasicBlock *BB);
};
- RegisterOpt<PruneEH> X("prune-eh", "Remove unused exception handling info");
+ RegisterPass<PruneEH> X("prune-eh", "Remove unused exception handling info");
}
ModulePass *llvm::createPruneEHPass() { return new PruneEH(); }
bool runOnModule(Module &M);
};
- RegisterOpt<RaiseAllocations>
+ RegisterPass<RaiseAllocations>
X("raiseallocs", "Raise allocations from calls to instructions");
} // end anonymous namespace
};
// Register the pass
-RegisterOpt<SimplifyLibCalls>
-X("simplify-libcalls","Simplify well-known library calls");
+RegisterPass<SimplifyLibCalls>
+X("simplify-libcalls", "Simplify well-known library calls");
} // anonymous namespace
AU.setPreservesAll();
}
};
- RegisterOpt<StripSymbols> X("strip", "Strip all symbols from a module");
+ RegisterPass<StripSymbols> X("strip", "Strip all symbols from a module");
}
ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) {
// If we're not just stripping debug info, strip all symbols from the
// functions and the names from any internal globals.
if (!OnlyDebugInfo) {
- for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
+ for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+ I != E; ++I)
if (I->hasInternalLinkage())
I->setName(""); // Internal symbols can't participate in linkage
bool runOnModule(Module &M);
};
- RegisterOpt<FunctionProfiler> X("insert-function-profiling",
+ RegisterPass<FunctionProfiler> X("insert-function-profiling",
"Insert instrumentation for function profiling");
RegisterAnalysisGroup<RSProfilers, FunctionProfiler> XG;
bool runOnModule(Module &M);
};
- RegisterOpt<BlockProfiler> Y("insert-block-profiling",
- "Insert instrumentation for block profiling");
+ RegisterPass<BlockProfiler> Y("insert-block-profiling",
+ "Insert instrumentation for block profiling");
RegisterAnalysisGroup<RSProfilers, BlockProfiler> YG;
}
bool runOnModule(Module &M);
};
- RegisterOpt<EdgeProfiler> X("insert-edge-profiling",
- "Insert instrumentation for edge profiling");
+ RegisterPass<EdgeProfiler> X("insert-edge-profiling",
+ "Insert instrumentation for edge profiling");
}
ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); }
bool runOnModule(Module &M);
};
- RegisterOpt<EmitFunctionTable>
+ RegisterPass<EmitFunctionTable>
X("emitfuncs", "Emit a function table for the reoptimizer");
}
};
static RegisterAnalysisGroup<RSProfilers> A("Profiling passes");
- static RegisterOpt<NullProfilerRS> NP("insert-null-profiling-rs",
+ static RegisterPass<NullProfilerRS> NP("insert-null-profiling-rs",
"Measure profiling framework overhead");
static RegisterAnalysisGroup<RSProfilers, NullProfilerRS, true> NPT;
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
};
- RegisterOpt<ProfilerRS> X("insert-rs-profiling-framework",
- "Insert random sampling instrumentation framework");
+ RegisterPass<ProfilerRS> X("insert-rs-profiling-framework",
+ "Insert random sampling instrumentation framework");
}
//Local utilities
bool runOnModule(Module &M);
};
- RegisterOpt<TraceBasicBlocks> X("trace-basic-blocks",
+ RegisterPass<TraceBasicBlocks> X("trace-basic-blocks",
"Insert instrumentation for basic block tracing");
}
};
// Register the passes...
- RegisterOpt<FunctionTracer> X("tracem","Insert Function trace code only");
- RegisterOpt<BasicBlockTracer> Y("trace","Insert BB and Function trace code");
+ RegisterPass<FunctionTracer> X("tracem","Insert Function trace code only");
+ RegisterPass<BasicBlockTracer> Y("trace","Insert BB and Function trace code");
} // end anonymous namespace
/// Just trace functions
bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI);
};
- RegisterOpt<RPR> X("raise", "Raise Pointer References");
+ RegisterPass<RPR> X("raise", "Raise Pointer References");
}
}
};
- RegisterOpt<ADCE> X("adce", "Aggressive Dead Code Elimination");
+ RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
} // End of anonymous namespace
FunctionPass *llvm::createAggressiveDCEPass() { return new ADCE(); }
void PlaceBlocks(BasicBlock *BB);
};
- RegisterOpt<BlockPlacement> X("block-placement",
- "Profile Guided Basic Block Placement");
+ RegisterPass<BlockPlacement> X("block-placement",
+ "Profile Guided Basic Block Placement");
}
FunctionPass *llvm::createBlockPlacementPass() { return new BlockPlacement(); }
void SimplifyPredecessors(SwitchInst *SI);
void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB);
};
- RegisterOpt<CondProp> X("condprop", "Conditional Propagation");
+ RegisterPass<CondProp> X("condprop", "Conditional Propagation");
}
FunctionPass *llvm::createCondPropagationPass() {
}
};
- RegisterOpt<ConstantPropagation> X("constprop","Simple constant propagation");
+ RegisterPass<ConstantPropagation> X("constprop",
+ "Simple constant propagation");
}
FunctionPass *llvm::createConstantPropagationPass() {
bool SimplifyBasicBlock(BasicBlock &BB, const RegionInfo &RI);
bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI);
};
- RegisterOpt<CEE> X("cee", "Correlated Expression Elimination");
+ RegisterPass<CEE> X("cee", "Correlated Expression Elimination");
}
FunctionPass *llvm::createCorrelatedExpressionEliminationPass() {
}
};
- RegisterOpt<DeadInstElimination> X("die", "Dead Instruction Elimination");
+ RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
}
FunctionPass *llvm::createDeadInstEliminationPass() {
}
};
- RegisterOpt<DCE> Y("dce", "Dead Code Elimination");
+ RegisterPass<DCE> Y("dce", "Dead Code Elimination");
}
bool DCE::runOnFunction(Function &F) {
AU.addPreserved<AliasAnalysis>();
}
};
- RegisterOpt<DSE> X("dse", "Dead Store Elimination");
+ RegisterPass<DSE> X("dse", "Dead Store Elimination");
}
FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); }
}
};
- RegisterOpt<GCSE> X("gcse", "Global Common Subexpression Elimination");
+ RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
}
// createGCSEPass - The public interface to this file...
void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
};
- RegisterOpt<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
+ RegisterPass<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
}
FunctionPass *llvm::createIndVarSimplifyPass() {
Value *EvaluateInDifferentType(Value *V, const Type *Ty);
};
- RegisterOpt<InstCombiner> X("instcombine", "Combine redundant instructions");
+ RegisterPass<InstCombiner> X("instcombine", "Combine redundant instructions");
}
// getComplexity: Assign a complexity or rank value to LLVM Values...
std::map<Value*, AllocaInst*> &Val2AlMap);
};
- RegisterOpt<LICM> X("licm", "Loop Invariant Code Motion");
+ RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
}
FunctionPass *llvm::createLICMPass() { return new LICM(); }
Loop *L, bool isOnlyStride);
void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
};
- RegisterOpt<LoopStrengthReduce> X("loop-reduce",
- "Loop Strength Reduction");
+ RegisterPass<LoopStrengthReduce> X("loop-reduce", "Loop Strength Reduction");
}
FunctionPass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
AU.addPreserved<LoopInfo>();
}
};
- RegisterOpt<LoopUnroll> X("loop-unroll", "Unroll loops");
+ RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
}
FunctionPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); }
std::vector<Instruction*> &Worklist);
void RemoveLoopFromHierarchy(Loop *L);
};
- RegisterOpt<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
+ RegisterPass<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
}
FunctionPass *llvm::createLoopUnswitchPass() { return new LoopUnswitch(); }
const StructType *getRootRecordType(unsigned NumRoots);
};
- RegisterOpt<LowerGC>
+ RegisterPass<LowerGC>
X("lowergc", "Lower GC intrinsics, for GCless code generators");
}
std::vector<Instruction*> instrsToRemove;
};
-RegisterOpt<LowerPacked>
+RegisterPass<LowerPacked>
X("lower-packed",
"lowers packed operations to operations on smaller packed datatypes");
void RemoveDeadBinaryOp(Value *V);
};
- RegisterOpt<Reassociate> X("reassociate", "Reassociate expressions");
+ RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
}
// Public interface to the Reassociate pass
}
};
- RegisterOpt<RegToMem> X("reg2mem", "Demote all values to stack slots");
+ RegisterPass<RegToMem> X("reg2mem", "Demote all values to stack slots");
}
// createDemoteRegisterToMemory - Provide an entry point to create this pass.
}
};
- RegisterOpt<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
+ RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
} // end anonymous namespace
bool runOnModule(Module &M);
};
- RegisterOpt<IPSCCP>
+ RegisterPass<IPSCCP>
Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
} // end anonymous namespace
void ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset);
};
- RegisterOpt<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
+ RegisterPass<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
}
// Public interface to the ScalarReplAggregates pass
struct CFGSimplifyPass : public FunctionPass {
virtual bool runOnFunction(Function &F);
};
- RegisterOpt<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
+ RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
}
// Public interface to the CFGSimplification pass
inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI);
inline void eliminateUnconditionalBranch(BranchInst *BI);
};
- RegisterOpt<TailDup> X("tailduplicate", "Tail Duplication");
+ RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
}
// Public interface to the Tail Duplication pass
bool CanMoveAboveCall(Instruction *I, CallInst *CI);
Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI);
};
- RegisterOpt<TailCallElim> X("tailcallelim", "Tail Call Elimination");
+ RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
}
// Public interface to the TailCallElimination pass
}
};
- RegisterOpt<BreakCriticalEdges> X("break-crit-edges",
+ RegisterPass<BreakCriticalEdges> X("break-crit-edges",
"Break critical edges in CFG");
}
}
};
- RegisterOpt<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
+ RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
}
FunctionPass *llvm::createLCSSAPass() { return new LCSSA(); }
std::vector<BasicBlock*> &PredBlocks);
};
- RegisterOpt<LoopSimplify>
+ RegisterPass<LoopSimplify>
X("loopsimplify", "Canonicalize natural loops", true);
}
bool runOnBasicBlock(BasicBlock &BB);
};
- RegisterOpt<LowerAllocations>
+ RegisterPass<LowerAllocations>
X("lowerallocs", "Lower allocations from instructions to calls");
}
unsigned JumpBufAlign;
};
- RegisterOpt<LowerInvoke>
+ RegisterPass<LowerInvoke>
X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
}
bool runOnFunction(Function &F);
};
- RegisterOpt<LowerSelect>
+ RegisterPass<LowerSelect>
X("lowerselect", "Lower select instructions to branches");
}
}
};
- RegisterOpt<LowerSwitch>
+ RegisterPass<LowerSwitch>
X("lowerswitch", "Lower SwitchInst's to branches");
}
}
};
- RegisterOpt<PromotePass> X("mem2reg", "Promote Memory to Register");
+ RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
} // end of anonymous namespace
bool PromotePass::runOnFunction(Function &F) {
#include "llvm/Type.h"
using namespace llvm;
-static RegisterOpt<UnifyFunctionExitNodes>
+static RegisterPass<UnifyFunctionExitNodes>
X("mergereturn", "Unify function exit nodes");
int UnifyFunctionExitNodes::stub;
} // end namespace llvm
-static RegisterOpt<PrintModulePass>
+static RegisterPass<PrintModulePass>
X("printm", "Print module to stderr");
-static RegisterOpt<PrintFunctionPass>
+static RegisterPass<PrintFunctionPass>
Y("print","Print function to stderr");
static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
}
};
- RegisterOpt<Verifier> X("verify", "Module Verifier");
+ RegisterPass<Verifier> X("verify", "Module Verifier");
} // End anonymous namespace
class BlockExtractorPass : public ModulePass {
bool runOnModule(Module &M);
};
- RegisterOpt<BlockExtractorPass>
+ RegisterPass<BlockExtractorPass>
XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)");
}