eliminate RegisterOpt. It does the same thing as RegisterPass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-08-27 22:42:52 +00:00
parent 21a82e6fc7
commit 7f8897f22e
76 changed files with 107 additions and 149 deletions

View File

@ -208,53 +208,6 @@ struct RegisterPass : public RegisterPassBase {
}
};
/// 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

View File

@ -109,7 +109,7 @@ namespace {
}
};
RegisterOpt<AliasAnalysisCounter>
RegisterPass<AliasAnalysisCounter>
X("count-aa", "Count Alias Analysis Query Responses");
RegisterAnalysisGroup<AliasAnalysis, AliasAnalysisCounter> Y;
}

View File

@ -70,7 +70,7 @@ namespace {
bool doFinalization(Module &M);
};
RegisterOpt<AAEval>
RegisterPass<AAEval>
X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator");
}

View File

@ -568,5 +568,5 @@ namespace {
return false;
}
};
RegisterOpt<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
}

View File

@ -72,7 +72,7 @@ namespace {
};
// Register this pass...
RegisterOpt<NoAA>
RegisterPass<NoAA>
U("no-aa", "No Alias Analysis (always returns 'may' alias)");
// Declare that we implement the AliasAnalysis interface
@ -117,7 +117,7 @@ namespace {
};
// Register this pass...
RegisterOpt<BasicAliasAnalysis>
RegisterPass<BasicAliasAnalysis>
X("basicaa", "Basic Alias Analysis (default AA impl)");
// Declare that we implement the AliasAnalysis interface

View File

@ -96,7 +96,7 @@ namespace {
};
// 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;

View File

@ -47,7 +47,7 @@ namespace {
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(); }

View File

@ -73,8 +73,8 @@ namespace {
};
// 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;

View File

@ -336,8 +336,8 @@ namespace {
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;
}

View File

@ -182,7 +182,7 @@ private:
};
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

View File

@ -135,8 +135,8 @@ 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;
}

View File

@ -81,7 +81,7 @@ namespace {
};
// 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;

View File

@ -85,7 +85,7 @@ namespace {
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

View File

@ -49,7 +49,7 @@ namespace {
virtual bool runOnModule(Module &M);
};
RegisterOpt<LoaderPass>
RegisterPass<LoaderPass>
X("profile-loader", "Load profile information from llvmprof.out");
RegisterAnalysisGroup<ProfileInfo, LoaderPass> Y;

View File

@ -60,7 +60,7 @@ namespace {
};
// Register this pass...
RegisterOpt<BasicVN>
RegisterPass<BasicVN>
X("basicvn", "Basic Value Numbering (default GVN impl)");
// Declare that we implement the ValueNumbering interface

View File

@ -35,7 +35,7 @@ namespace {
class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
virtual bool runOnFunction(Function &F);
};
RegisterOpt<UnreachableBlockElim>
RegisterPass<UnreachableBlockElim>
X("unreachableblockelim", "Remove unreachable blocks from the CFG");
}

View File

@ -34,7 +34,7 @@ namespace {
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 {
@ -52,5 +52,6 @@ namespace {
AU.setPreservesAll();
};
};
RegisterOpt<Hello2> Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)");
RegisterPass<Hello2> Y("hello2",
"Hello World Pass (with getAnalysisUsage implemented)");
}

View File

@ -72,8 +72,8 @@ namespace {
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() {

View File

@ -33,7 +33,7 @@ namespace {
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(); }

View File

@ -93,7 +93,7 @@ namespace {
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

View File

@ -36,7 +36,7 @@ namespace {
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");
}

View File

@ -43,7 +43,7 @@ namespace {
bool runOnModule(Module &M);
};
RegisterOpt<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
RegisterPass<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
}
ModulePass *llvm::createFunctionResolvingPass() {
@ -314,7 +314,8 @@ bool FunctionResolvingPass::runOnModule(Module &M) {
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);
@ -346,7 +347,8 @@ bool FunctionResolvingPass::runOnModule(Module &M) {
++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;

View File

@ -44,7 +44,7 @@ namespace {
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(); }

View File

@ -60,10 +60,10 @@ namespace {
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(); }
@ -800,7 +800,8 @@ static bool ValueIsOnlyUsedLocallyOrStoredToOneGlobal(Instruction *V,
// 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)){

View File

@ -28,7 +28,7 @@ namespace {
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
///
@ -38,7 +38,7 @@ namespace {
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(); }
@ -69,7 +69,7 @@ bool IPCP::runOnModule(Module &M) {
/// 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());

View File

@ -38,7 +38,7 @@ namespace {
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

View File

@ -55,7 +55,7 @@ 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(); }

View File

@ -49,7 +49,7 @@ namespace {
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)

View File

@ -46,7 +46,7 @@ namespace {
}
};
RegisterOpt<LoopExtractor>
RegisterPass<LoopExtractor>
X("loop-extract", "Extract loops into new functions");
/// SingleLoopExtractor - For bugpoint.
@ -54,7 +54,7 @@ namespace {
SingleLoopExtractor() : LoopExtractor(1) {}
};
RegisterOpt<SingleLoopExtractor>
RegisterPass<SingleLoopExtractor>
Y("loop-extract-single", "Extract at most one loop into a new function");
} // End anonymous namespace
@ -148,7 +148,7 @@ namespace {
bool runOnModule(Module &M);
};
RegisterOpt<BlockExtractorPass>
RegisterPass<BlockExtractorPass>
XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
}

View File

@ -120,7 +120,7 @@ namespace {
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

View File

@ -46,7 +46,7 @@ namespace {
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(); }

View File

@ -44,7 +44,7 @@ namespace {
bool runOnModule(Module &M);
};
RegisterOpt<RaiseAllocations>
RegisterPass<RaiseAllocations>
X("raiseallocs", "Raise allocations from calls to instructions");
} // end anonymous namespace

View File

@ -366,8 +366,8 @@ private:
};
// 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

View File

@ -43,7 +43,7 @@ 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) {
@ -75,7 +75,8 @@ bool StripSymbols::runOnModule(Module &M) {
// 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

View File

@ -35,7 +35,7 @@ namespace {
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;
@ -81,8 +81,8 @@ namespace {
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;
}

View File

@ -33,8 +33,8 @@ namespace {
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(); }

View File

@ -40,7 +40,7 @@ namespace {
bool runOnModule(Module &M);
};
RegisterOpt<EmitFunctionTable>
RegisterPass<EmitFunctionTable>
X("emitfuncs", "Emit a function table for the reoptimizer");
}

View File

@ -87,7 +87,7 @@ namespace {
};
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;
@ -160,8 +160,8 @@ namespace {
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

View File

@ -31,7 +31,7 @@ namespace {
bool runOnModule(Module &M);
};
RegisterOpt<TraceBasicBlocks> X("trace-basic-blocks",
RegisterPass<TraceBasicBlocks> X("trace-basic-blocks",
"Insert instrumentation for basic block tracing");
}

View File

@ -104,8 +104,8 @@ namespace {
};
// 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

View File

@ -80,7 +80,7 @@ namespace {
bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI);
};
RegisterOpt<RPR> X("raise", "Raise Pointer References");
RegisterPass<RPR> X("raise", "Raise Pointer References");
}

View File

@ -102,7 +102,7 @@ private:
}
};
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(); }

View File

@ -68,8 +68,8 @@ namespace {
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(); }

View File

@ -46,7 +46,7 @@ namespace {
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() {

View File

@ -39,7 +39,8 @@ namespace {
}
};
RegisterOpt<ConstantPropagation> X("constprop","Simple constant propagation");
RegisterPass<ConstantPropagation> X("constprop",
"Simple constant propagation");
}
FunctionPass *llvm::createConstantPropagationPass() {

View File

@ -286,7 +286,7 @@ namespace {
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() {

View File

@ -50,7 +50,7 @@ namespace {
}
};
RegisterOpt<DeadInstElimination> X("die", "Dead Instruction Elimination");
RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
}
FunctionPass *llvm::createDeadInstEliminationPass() {
@ -71,7 +71,7 @@ namespace {
}
};
RegisterOpt<DCE> Y("dce", "Dead Code Elimination");
RegisterPass<DCE> Y("dce", "Dead Code Elimination");
}
bool DCE::runOnFunction(Function &F) {

View File

@ -54,7 +54,7 @@ namespace {
AU.addPreserved<AliasAnalysis>();
}
};
RegisterOpt<DSE> X("dse", "Dead Store Elimination");
RegisterPass<DSE> X("dse", "Dead Store Elimination");
}
FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); }

View File

@ -51,7 +51,7 @@ namespace {
}
};
RegisterOpt<GCSE> X("gcse", "Global Common Subexpression Elimination");
RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
}
// createGCSEPass - The public interface to this file...

View File

@ -92,7 +92,7 @@ namespace {
void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
};
RegisterOpt<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
RegisterPass<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
}
FunctionPass *llvm::createIndVarSimplifyPass() {

View File

@ -264,7 +264,7 @@ namespace {
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...

View File

@ -197,7 +197,7 @@ namespace {
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(); }

View File

@ -194,8 +194,7 @@ private:
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) {

View File

@ -60,7 +60,7 @@ namespace {
AU.addPreserved<LoopInfo>();
}
};
RegisterOpt<LoopUnroll> X("loop-unroll", "Unroll loops");
RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
}
FunctionPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); }

View File

@ -103,7 +103,7 @@ namespace {
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(); }

View File

@ -56,7 +56,7 @@ namespace {
const StructType *getRootRecordType(unsigned NumRoots);
};
RegisterOpt<LowerGC>
RegisterPass<LowerGC>
X("lowergc", "Lower GC intrinsics, for GCless code generators");
}

View File

@ -102,7 +102,7 @@ private:
std::vector<Instruction*> instrsToRemove;
};
RegisterOpt<LowerPacked>
RegisterPass<LowerPacked>
X("lower-packed",
"lowers packed operations to operations on smaller packed datatypes");

View File

@ -90,7 +90,7 @@ namespace {
void RemoveDeadBinaryOp(Value *V);
};
RegisterOpt<Reassociate> X("reassociate", "Reassociate expressions");
RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
}
// Public interface to the Reassociate pass

View File

@ -76,7 +76,7 @@ namespace {
}
};
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.

View File

@ -1075,7 +1075,7 @@ namespace {
}
};
RegisterOpt<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
} // end anonymous namespace
@ -1183,7 +1183,7 @@ namespace {
bool runOnModule(Module &M);
};
RegisterOpt<IPSCCP>
RegisterPass<IPSCCP>
Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
} // end anonymous namespace

View File

@ -70,7 +70,7 @@ 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

View File

@ -35,7 +35,7 @@ namespace {
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

View File

@ -47,7 +47,7 @@ namespace {
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

View File

@ -75,7 +75,7 @@ namespace {
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

View File

@ -47,7 +47,7 @@ namespace {
}
};
RegisterOpt<BreakCriticalEdges> X("break-crit-edges",
RegisterPass<BreakCriticalEdges> X("break-crit-edges",
"Break critical edges in CFG");
}

View File

@ -80,7 +80,7 @@ namespace {
}
};
RegisterOpt<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
}
FunctionPass *llvm::createLCSSAPass() { return new LCSSA(); }

View File

@ -89,7 +89,7 @@ namespace {
std::vector<BasicBlock*> &PredBlocks);
};
RegisterOpt<LoopSimplify>
RegisterPass<LoopSimplify>
X("loopsimplify", "Canonicalize natural loops", true);
}

View File

@ -65,7 +65,7 @@ namespace {
bool runOnBasicBlock(BasicBlock &BB);
};
RegisterOpt<LowerAllocations>
RegisterPass<LowerAllocations>
X("lowerallocs", "Lower allocations from instructions to calls");
}

View File

@ -94,7 +94,7 @@ namespace {
unsigned JumpBufAlign;
};
RegisterOpt<LowerInvoke>
RegisterPass<LowerInvoke>
X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
}

View File

@ -50,7 +50,7 @@ namespace {
bool runOnFunction(Function &F);
};
RegisterOpt<LowerSelect>
RegisterPass<LowerSelect>
X("lowerselect", "Lower select instructions to branches");
}

View File

@ -68,7 +68,7 @@ namespace {
}
};
RegisterOpt<LowerSwitch>
RegisterPass<LowerSwitch>
X("lowerswitch", "Lower SwitchInst's to branches");
}

View File

@ -48,7 +48,7 @@ namespace {
}
};
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) {

View File

@ -22,7 +22,7 @@
#include "llvm/Type.h"
using namespace llvm;
static RegisterOpt<UnifyFunctionExitNodes>
static RegisterPass<UnifyFunctionExitNodes>
X("mergereturn", "Unify function exit nodes");
int UnifyFunctionExitNodes::stub;

View File

@ -162,9 +162,9 @@ public:
} // 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,

View File

@ -239,7 +239,7 @@ namespace { // Anonymous namespace for class
}
};
RegisterOpt<Verifier> X("verify", "Module Verifier");
RegisterPass<Verifier> X("verify", "Module Verifier");
} // End anonymous namespace

View File

@ -420,7 +420,7 @@ namespace {
class BlockExtractorPass : public ModulePass {
bool runOnModule(Module &M);
};
RegisterOpt<BlockExtractorPass>
RegisterPass<BlockExtractorPass>
XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)");
}