diff options
Diffstat (limited to 'lib/Transforms')
54 files changed, 119 insertions, 108 deletions
diff --git a/lib/Transforms/Hello/Hello.cpp b/lib/Transforms/Hello/Hello.cpp index abfa514e20..bf59c04473 100644 --- a/lib/Transforms/Hello/Hello.cpp +++ b/lib/Transforms/Hello/Hello.cpp @@ -37,7 +37,7 @@ namespace { } char Hello::ID = 0; -static RegisterPass<Hello> X("hello", "Hello World Pass"); +INITIALIZE_PASS(Hello, "hello", "Hello World Pass", false, false); namespace { // Hello2 - The second implementation with getAnalysisUsage implemented. @@ -60,5 +60,6 @@ namespace { } char Hello2::ID = 0; -static RegisterPass<Hello2> -Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)"); +INITIALIZE_PASS(Hello2, "hello2", + "Hello World Pass (with getAnalysisUsage implemented)", + false, false); diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index 28ea079abd..712deb467f 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -84,8 +84,8 @@ namespace { } char ArgPromotion::ID = 0; -static RegisterPass<ArgPromotion> -X("argpromotion", "Promote 'by reference' arguments to scalars"); +INITIALIZE_PASS(ArgPromotion, "argpromotion", + "Promote 'by reference' arguments to scalars", false, false); Pass *llvm::createArgumentPromotionPass(unsigned maxElements) { return new ArgPromotion(maxElements); diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp index 3c05f88027..5c6bc868c9 100644 --- a/lib/Transforms/IPO/ConstantMerge.cpp +++ b/lib/Transforms/IPO/ConstantMerge.cpp @@ -41,8 +41,8 @@ namespace { } char ConstantMerge::ID = 0; -static RegisterPass<ConstantMerge> -X("constmerge", "Merge Duplicate Global Constants"); +INITIALIZE_PASS(ConstantMerge, "constmerge", + "Merge Duplicate Global Constants", false, false); ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); } diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index b71bf5ff46..c06d688b3c 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -151,8 +151,7 @@ namespace { char DAE::ID = 0; -static RegisterPass<DAE> -X("deadargelim", "Dead Argument Elimination"); +INITIALIZE_PASS(DAE, "deadargelim", "Dead Argument Elimination", false, false); namespace { /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but @@ -167,8 +166,9 @@ namespace { } char DAH::ID = 0; -static RegisterPass<DAH> -Y("deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)"); +INITIALIZE_PASS(DAH, "deadarghaX0r", + "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)", + false, false); /// createDeadArgEliminationPass - This pass removes arguments from functions /// which are not used by the body of the function. diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp index 662fbb5cd4..5ff80f72cf 100644 --- a/lib/Transforms/IPO/DeadTypeElimination.cpp +++ b/lib/Transforms/IPO/DeadTypeElimination.cpp @@ -45,7 +45,7 @@ namespace { } char DTE::ID = 0; -static RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination"); +INITIALIZE_PASS(DTE, "deadtypeelim", "Dead Type Elimination", false, false); ModulePass *llvm::createDeadTypeEliminationPass() { return new DTE(); diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index 9bd7af61c5..030fe6e219 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -69,8 +69,8 @@ namespace { } char FunctionAttrs::ID = 0; -static RegisterPass<FunctionAttrs> -X("functionattrs", "Deduce function attributes"); +INITIALIZE_PASS(FunctionAttrs, "functionattrs", + "Deduce function attributes", false, false); Pass *llvm::createFunctionAttrsPass() { return new FunctionAttrs(); } diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index 44216a6df9..129cb7c46e 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -51,7 +51,8 @@ namespace { } char GlobalDCE::ID = 0; -static RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination"); +INITIALIZE_PASS(GlobalDCE, "globaldce", + "Dead Global Elimination", false, false); ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); } diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 1fb9e64965..3dbed864ff 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -74,7 +74,8 @@ namespace { } char GlobalOpt::ID = 0; -static RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer"); +INITIALIZE_PASS(GlobalOpt, "globalopt", + "Global Variable Optimizer", false, false); ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); } diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp index e4db235b1d..03cc542fee 100644 --- a/lib/Transforms/IPO/IPConstantPropagation.cpp +++ b/lib/Transforms/IPO/IPConstantPropagation.cpp @@ -45,8 +45,8 @@ namespace { } char IPCP::ID = 0; -static RegisterPass<IPCP> -X("ipconstprop", "Interprocedural constant propagation"); +INITIALIZE_PASS(IPCP, "ipconstprop", + "Interprocedural constant propagation", false, false); ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); } diff --git a/lib/Transforms/IPO/InlineAlways.cpp b/lib/Transforms/IPO/InlineAlways.cpp index 8e312e7d91..43b50fcb3d 100644 --- a/lib/Transforms/IPO/InlineAlways.cpp +++ b/lib/Transforms/IPO/InlineAlways.cpp @@ -61,8 +61,8 @@ namespace { } char AlwaysInliner::ID = 0; -static RegisterPass<AlwaysInliner> -X("always-inline", "Inliner for always_inline functions"); +INITIALIZE_PASS(AlwaysInliner, "always-inline", + "Inliner for always_inline functions", false, false); Pass *llvm::createAlwaysInlinerPass() { return new AlwaysInliner(); } diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index 74b4a1c10e..e609fb6867 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -56,8 +56,8 @@ namespace { } char SimpleInliner::ID = 0; -static RegisterPass<SimpleInliner> -X("inline", "Function Integration/Inlining"); +INITIALIZE_PASS(SimpleInliner, "inline", + "Function Integration/Inlining", false, false); Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); } diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index 47abb7dfd8..1f861e02e2 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -63,8 +63,8 @@ namespace { } // end anonymous namespace char InternalizePass::ID = 0; -static RegisterPass<InternalizePass> -X("internalize", "Internalize Global Symbols"); +INITIALIZE_PASS(InternalizePass, "internalize", + "Internalize Global Symbols", false, false); InternalizePass::InternalizePass(bool AllButMain) : ModulePass(&ID), AllButMain(AllButMain){ diff --git a/lib/Transforms/IPO/LoopExtractor.cpp b/lib/Transforms/IPO/LoopExtractor.cpp index cb813303fa..fa8eb5e9fb 100644 --- a/lib/Transforms/IPO/LoopExtractor.cpp +++ b/lib/Transforms/IPO/LoopExtractor.cpp @@ -50,8 +50,8 @@ namespace { } char LoopExtractor::ID = 0; -static RegisterPass<LoopExtractor> -X("loop-extract", "Extract loops into new functions"); +INITIALIZE_PASS(LoopExtractor, "loop-extract", + "Extract loops into new functions", false, false); namespace { /// SingleLoopExtractor - For bugpoint. @@ -62,8 +62,8 @@ namespace { } // End anonymous namespace char SingleLoopExtractor::ID = 0; -static RegisterPass<SingleLoopExtractor> -Y("loop-extract-single", "Extract at most one loop into a new function"); +INITIALIZE_PASS(SingleLoopExtractor, "loop-extract-single", + "Extract at most one loop into a new function", false, false); // createLoopExtractorPass - This pass extracts all natural loops from the // program into a function if it can. @@ -159,8 +159,9 @@ namespace { } char BlockExtractorPass::ID = 0; -static RegisterPass<BlockExtractorPass> -XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)"); +INITIALIZE_PASS(BlockExtractorPass, "extract-blocks", + "Extract Basic Blocks From Module (for bugpoint use)", + false, false); // createBlockExtractorPass - This pass extracts all blocks (except those // specified in the argument list) from the functions in the module. diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp index 76cfef8335..fa19ea1fa4 100644 --- a/lib/Transforms/IPO/LowerSetJmp.cpp +++ b/lib/Transforms/IPO/LowerSetJmp.cpp @@ -122,7 +122,7 @@ namespace { } // end anonymous namespace char LowerSetJmp::ID = 0; -static RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump"); +INITIALIZE_PASS(LowerSetJmp, "lowersetjmp", "Lower Set Jump", false, false); // run - Run the transformation on the program. We grab the function // prototypes for longjmp and setjmp. If they are used in the program, diff --git a/lib/Transforms/IPO/MergeFunctions.cpp b/lib/Transforms/IPO/MergeFunctions.cpp index 87b10f2e87..3b28d27820 100644 --- a/lib/Transforms/IPO/MergeFunctions.cpp +++ b/lib/Transforms/IPO/MergeFunctions.cpp @@ -111,7 +111,7 @@ namespace { } char MergeFunctions::ID = 0; -static RegisterPass<MergeFunctions> X("mergefunc", "Merge Functions"); +INITIALIZE_PASS(MergeFunctions, "mergefunc", "Merge Functions", false, false); ModulePass *llvm::createMergeFunctionsPass() { return new MergeFunctions(); diff --git a/lib/Transforms/IPO/PartialInlining.cpp b/lib/Transforms/IPO/PartialInlining.cpp index 6b9814ceb8..d3c4a50bc0 100644 --- a/lib/Transforms/IPO/PartialInlining.cpp +++ b/lib/Transforms/IPO/PartialInlining.cpp @@ -40,7 +40,8 @@ namespace { } char PartialInliner::ID = 0; -static RegisterPass<PartialInliner> X("partial-inliner", "Partial Inliner"); +INITIALIZE_PASS(PartialInliner, "partial-inliner", + "Partial Inliner", false, false); ModulePass* llvm::createPartialInliningPass() { return new PartialInliner(); } diff --git a/lib/Transforms/IPO/PartialSpecialization.cpp b/lib/Transforms/IPO/PartialSpecialization.cpp index 58e14481b0..e7c2cfcd0d 100644 --- a/lib/Transforms/IPO/PartialSpecialization.cpp +++ b/lib/Transforms/IPO/PartialSpecialization.cpp @@ -56,8 +56,8 @@ namespace { } char PartSpec::ID = 0; -static RegisterPass<PartSpec> -X("partialspecialization", "Partial Specialization"); +INITIALIZE_PASS(PartSpec, "partialspecialization", + "Partial Specialization", false, false); // Specialize F by replacing the arguments (keys) in replacements with the // constants (values). Replace all calls to F with those constants with diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index de6099cc1d..7d2968e024 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -48,8 +48,8 @@ namespace { } char PruneEH::ID = 0; -static RegisterPass<PruneEH> -X("prune-eh", "Remove unused exception handling info"); +INITIALIZE_PASS(PruneEH, "prune-eh", + "Remove unused exception handling info", false, false); Pass *llvm::createPruneEHPass() { return new PruneEH(); } diff --git a/lib/Transforms/IPO/StripDeadPrototypes.cpp b/lib/Transforms/IPO/StripDeadPrototypes.cpp index 4566a7634a..32722f1e1e 100644 --- a/lib/Transforms/IPO/StripDeadPrototypes.cpp +++ b/lib/Transforms/IPO/StripDeadPrototypes.cpp @@ -36,8 +36,8 @@ public: } // end anonymous namespace char StripDeadPrototypesPass::ID = 0; -static RegisterPass<StripDeadPrototypesPass> -X("strip-dead-prototypes", "Strip Unused Function Prototypes"); +INITIALIZE_PASS(StripDeadPrototypesPass, "strip-dead-prototypes", + "Strip Unused Function Prototypes", false, false); bool StripDeadPrototypesPass::runOnModule(Module &M) { bool MadeChange = false; diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index 3bcaee3437..55674614bc 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -89,32 +89,33 @@ namespace { } char StripSymbols::ID = 0; -static RegisterPass<StripSymbols> -X("strip", "Strip all symbols from a module"); +INITIALIZE_PASS(StripSymbols, "strip", + "Strip all symbols from a module", false, false); ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) { return new StripSymbols(OnlyDebugInfo); } char StripNonDebugSymbols::ID = 0; -static RegisterPass<StripNonDebugSymbols> -Y("strip-nondebug", "Strip all symbols, except dbg symbols, from a module"); +INITIALIZE_PASS(StripNonDebugSymbols, "strip-nondebug", + "Strip all symbols, except dbg symbols, from a module", + false, false); ModulePass *llvm::createStripNonDebugSymbolsPass() { return new StripNonDebugSymbols(); } char StripDebugDeclare::ID = 0; -static RegisterPass<StripDebugDeclare> -Z("strip-debug-declare", "Strip all llvm.dbg.declare intrinsics"); +INITIALIZE_PASS(StripDebugDeclare, "strip-debug-declare", + "Strip all llvm.dbg.declare intrinsics", false, false); ModulePass *llvm::createStripDebugDeclarePass() { return new StripDebugDeclare(); } char StripDeadDebugInfo::ID = 0; -static RegisterPass<StripDeadDebugInfo> -A("strip-dead-debug-info", "Strip debug info for unused symbols"); +INITIALIZE_PASS(StripDeadDebugInfo, "strip-dead-debug-info", + "Strip debug info for unused symbols", false, false); ModulePass *llvm::createStripDeadDebugInfoPass() { return new StripDeadDebugInfo(); diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index a74686f408..6857ef5246 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -62,8 +62,8 @@ namespace { } char SRETPromotion::ID = 0; -static RegisterPass<SRETPromotion> -X("sretpromotion", "Promote sret arguments to multiple ret values"); +INITIALIZE_PASS(SRETPromotion, "sretpromotion", + "Promote sret arguments to multiple ret values", false, false); Pass *llvm::createStructRetPromotionPass() { return new SRETPromotion(); diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index af2958fe3d..e46c67994e 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -60,8 +60,8 @@ STATISTIC(NumSunkInst , "Number of instructions sunk"); char InstCombiner::ID = 0; -static RegisterPass<InstCombiner> -X("instcombine", "Combine redundant instructions"); +INITIALIZE_PASS(InstCombiner, "instcombine", + "Combine redundant instructions", false, false); void InstCombiner::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreservedID(LCSSAID); diff --git a/lib/Transforms/Instrumentation/EdgeProfiling.cpp b/lib/Transforms/Instrumentation/EdgeProfiling.cpp index 9ae3786707..e5cd1f0ef4 100644 --- a/lib/Transforms/Instrumentation/EdgeProfiling.cpp +++ b/lib/Transforms/Instrumentation/EdgeProfiling.cpp @@ -43,8 +43,8 @@ namespace { } char EdgeProfiler::ID = 0; -static RegisterPass<EdgeProfiler> -X("insert-edge-profiling", "Insert instrumentation for edge profiling"); +INITIALIZE_PASS(EdgeProfiler, "insert-edge-profiling", + "Insert instrumentation for edge profiling", false, false); ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); } diff --git a/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp b/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp index 41e3a39f26..a6de60d293 100644 --- a/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp +++ b/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp @@ -50,9 +50,9 @@ namespace { } char OptimalEdgeProfiler::ID = 0; -static RegisterPass<OptimalEdgeProfiler> -X("insert-optimal-edge-profiling", - "Insert optimal instrumentation for edge profiling"); +INITIALIZE_PASS(OptimalEdgeProfiler, "insert-optimal-edge-profiling", + "Insert optimal instrumentation for edge profiling", + false, false); ModulePass *llvm::createOptimalEdgeProfilerPass() { return new OptimalEdgeProfiler(); diff --git a/lib/Transforms/Scalar/ABCD.cpp b/lib/Transforms/Scalar/ABCD.cpp index dcf14a6860..20f90839c9 100644 --- a/lib/Transforms/Scalar/ABCD.cpp +++ b/lib/Transforms/Scalar/ABCD.cpp @@ -441,8 +441,9 @@ class ABCD : public FunctionPass { } // end anonymous namespace. char ABCD::ID = 0; -static RegisterPass<ABCD> X("abcd", "ABCD: Eliminating Array Bounds Checks on Demand"); - +INITIALIZE_PASS(ABCD, "abcd", + "ABCD: Eliminating Array Bounds Checks on Demand", + false, false); bool ABCD::runOnFunction(Function &F) { modified = false; diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index 2d19467ce7..4df1c7c8b8 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -45,7 +45,7 @@ namespace { } char ADCE::ID = 0; -static RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination"); +INITIALIZE_PASS(ADCE, "adce", "Aggressive Dead Code Elimination", false, false); bool ADCE::runOnFunction(Function& F) { SmallPtrSet<Instruction*, 128> alive; diff --git a/lib/Transforms/Scalar/BasicBlockPlacement.cpp b/lib/Transforms/Scalar/BasicBlockPlacement.cpp index 54533f5040..89fb64c58b 100644 --- a/lib/Transforms/Scalar/BasicBlockPlacement.cpp +++ b/lib/Transforms/Scalar/BasicBlockPlacement.cpp @@ -74,8 +74,8 @@ namespace { } char BlockPlacement::ID = 0; -static RegisterPass<BlockPlacement> -X("block-placement", "Profile Guided Basic Block Placement"); +INITIALIZE_PASS(BlockPlacement, "block-placement", + "Profile Guided Basic Block Placement", false, false); FunctionPass *llvm::createBlockPlacementPass() { return new BlockPlacement(); } diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 960ef1e6b2..0c14b521ca 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -82,8 +82,8 @@ namespace { } char CodeGenPrepare::ID = 0; -static RegisterPass<CodeGenPrepare> X("codegenprepare", - "Optimize for code generation"); +INITIALIZE_PASS(CodeGenPrepare, "codegenprepare", + "Optimize for code generation", false, false); FunctionPass *llvm::createCodeGenPreparePass(const TargetLowering *TLI) { return new CodeGenPrepare(TLI); diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp index ea20813573..0e9d68cbe6 100644 --- a/lib/Transforms/Scalar/ConstantProp.cpp +++ b/lib/Transforms/Scalar/ConstantProp.cpp @@ -45,8 +45,8 @@ namespace { } char ConstantPropagation::ID = 0; -static RegisterPass<ConstantPropagation> -X("constprop", "Simple constant propagation"); +INITIALIZE_PASS(ConstantPropagation, "constprop", + "Simple constant propagation", false, false); FunctionPass *llvm::createConstantPropagationPass() { return new ConstantPropagation(); diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp index 39940c35da..6baeceb5ee 100644 --- a/l |