diff options
author | Devang Patel <dpatel@apple.com> | 2007-05-03 01:11:54 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-05-03 01:11:54 +0000 |
commit | 1997473cf72957d0e70322e2fe6fe2ab141c58a6 (patch) | |
tree | c98464a35a7d5a7893b1ffa191981a820b34bff9 /lib/Transforms | |
parent | 10c9a8211d48ddd34ebe4b0abea21917a8dc7ed4 (diff) |
Drop 'const'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
60 files changed, 133 insertions, 133 deletions
diff --git a/lib/Transforms/Hello/Hello.cpp b/lib/Transforms/Hello/Hello.cpp index 2db4990c91..ca8f89dd83 100644 --- a/lib/Transforms/Hello/Hello.cpp +++ b/lib/Transforms/Hello/Hello.cpp @@ -25,7 +25,7 @@ STATISTIC(HelloCounter, "Counts number of functions greeted"); namespace { // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid Hello() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -37,12 +37,12 @@ namespace { } }; - const char Hello::ID = 0; + char Hello::ID = 0; RegisterPass<Hello> X("hello", "Hello World Pass"); // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid Hello2() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -58,7 +58,7 @@ namespace { AU.setPreservesAll(); }; }; - const char Hello2::ID = 0; + char Hello2::ID = 0; RegisterPass<Hello2> Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)"); } diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index a91dbc263a..5a6b466d9e 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -63,7 +63,7 @@ namespace { } virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC); - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ArgPromotion() : CallGraphSCCPass((intptr_t)&ID) {} private: @@ -72,7 +72,7 @@ namespace { Function *DoPromotion(Function *F, std::vector<Argument*> &ArgsToPromote); }; - const char ArgPromotion::ID = 0; + char ArgPromotion::ID = 0; RegisterPass<ArgPromotion> X("argpromotion", "Promote 'by reference' arguments to scalars"); } diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp index 635caf5c69..c13b69fb51 100644 --- a/lib/Transforms/IPO/ConstantMerge.cpp +++ b/lib/Transforms/IPO/ConstantMerge.cpp @@ -29,7 +29,7 @@ STATISTIC(NumMerged, "Number of global constants merged"); namespace { struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ConstantMerge() : ModulePass((intptr_t)&ID) {} // run - For this pass, process all of the globals in the module, @@ -38,7 +38,7 @@ namespace { bool runOnModule(Module &M); }; - const char ConstantMerge::ID = 0; + char ConstantMerge::ID = 0; RegisterPass<ConstantMerge>X("constmerge","Merge Duplicate Global Constants"); } diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index f355021a66..019949c858 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -76,7 +76,7 @@ namespace { std::multimap<Function*, CallSite> CallSites; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid DAE() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -95,17 +95,17 @@ namespace { void RemoveDeadArgumentsFromFunction(Function *F); }; - const char DAE::ID = 0; + char DAE::ID = 0; 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 /// by bugpoint. struct DAH : public DAE { - static const char ID; + static char ID; virtual bool ShouldHackArguments() const { return true; } }; - const char DAH::ID = 0; + char DAH::ID = 0; RegisterPass<DAH> Y("deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)"); } diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp index 4dff7a36f1..a2ee18e325 100644 --- a/lib/Transforms/IPO/DeadTypeElimination.cpp +++ b/lib/Transforms/IPO/DeadTypeElimination.cpp @@ -26,7 +26,7 @@ STATISTIC(NumKilled, "Number of unused typenames removed from symtab"); namespace { struct VISIBILITY_HIDDEN DTE : public ModulePass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid DTE() : ModulePass((intptr_t)&ID) {} // doPassInitialization - For this pass, it removes global symbol table @@ -43,7 +43,7 @@ namespace { AU.addRequired<FindUsedTypes>(); } }; - const char DTE::ID = 0; + char DTE::ID = 0; RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination"); } diff --git a/lib/Transforms/IPO/ExtractFunction.cpp b/lib/Transforms/IPO/ExtractFunction.cpp index 2d5c0347b6..1a284c4f5b 100644 --- a/lib/Transforms/IPO/ExtractFunction.cpp +++ b/lib/Transforms/IPO/ExtractFunction.cpp @@ -25,7 +25,7 @@ namespace { bool deleteFunc; bool reLink; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid /// FunctionExtractorPass - If deleteFn is true, this pass deletes as the /// specified function. Otherwise, it deletes as much of the module as @@ -134,7 +134,7 @@ namespace { } }; - const char FunctionExtractorPass::ID = 0; + char FunctionExtractorPass::ID = 0; RegisterPass<FunctionExtractorPass> X("extract", "Function Extractor"); } diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index 4a08b453bb..f309847ecf 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -30,7 +30,7 @@ STATISTIC(NumVariables, "Number of global variables removed"); namespace { struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid GlobalDCE() : ModulePass((intptr_t)&ID) {} // run - Do the GlobalDCE pass on the specified module, optionally updating @@ -49,7 +49,7 @@ namespace { bool SafeToDestroyConstant(Constant* C); bool RemoveUnusedGlobalValue(GlobalValue &GV); }; - const char GlobalDCE::ID = 0; + char GlobalDCE::ID = 0; RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination"); } diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 421bda6fbd..6aea4aa0e8 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -50,7 +50,7 @@ namespace { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<TargetData>(); } - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid GlobalOpt() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -63,7 +63,7 @@ namespace { bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI); }; - const char GlobalOpt::ID = 0; + char GlobalOpt::ID = 0; RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer"); } diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp index 00b829e248..8321b22bf0 100644 --- a/lib/Transforms/IPO/IPConstantPropagation.cpp +++ b/lib/Transforms/IPO/IPConstantPropagation.cpp @@ -33,7 +33,7 @@ namespace { /// IPCP - The interprocedural constant propagation pass /// struct VISIBILITY_HIDDEN IPCP : public ModulePass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid IPCP() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -41,7 +41,7 @@ namespace { bool PropagateConstantsIntoArguments(Function &F); bool PropagateConstantReturn(Function &F); }; - const char IPCP::ID = 0; + char IPCP::ID = 0; RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation"); } diff --git a/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp index 5dd82bd248..f21e4f6368 100644 --- a/lib/Transforms/IPO/IndMemRemoval.cpp +++ b/lib/Transforms/IPO/IndMemRemoval.cpp @@ -32,12 +32,12 @@ STATISTIC(NumBounce , "Number of bounce functions created"); namespace { class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid IndMemRemPass() : ModulePass((intptr_t)&ID) {} virtual bool runOnModule(Module &M); }; - const char IndMemRemPass::ID = 0; + char IndMemRemPass::ID = 0; RegisterPass<IndMemRemPass> X("indmemrem","Indirect Malloc and Free Removal"); } // end anonymous namespace diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index a300c62a3e..85061d7fb0 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -54,10 +54,10 @@ namespace { class VISIBILITY_HIDDEN SimpleInliner : public Inliner { std::map<const Function*, FunctionInfo> CachedFunctionInfo; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid int getInlineCost(CallSite CS); }; - const char SimpleInliner::ID = 0; + char SimpleInliner::ID = 0; RegisterPass<SimpleInliner> X("inline", "Function Integration/Inlining"); } diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index d769043694..cd204a7433 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -36,7 +36,7 @@ namespace { cl::desc("Control the amount of inlining to perform (default = 200)")); } -const char Inliner::ID = 0; +char Inliner::ID = 0; Inliner::Inliner() : CallGraphSCCPass((intptr_t)&ID), InlineThreshold(InlineLimit) {} diff --git a/lib/Transforms/IPO/Inliner.h b/lib/Transforms/IPO/Inliner.h index 6a7c665e29..80be81a1e9 100644 --- a/lib/Transforms/IPO/Inliner.h +++ b/lib/Transforms/IPO/Inliner.h @@ -27,7 +27,7 @@ namespace llvm { /// perform the inlining operations that does not depend on the policy. /// struct Inliner : public CallGraphSCCPass { - static const char ID; + static char ID; Inliner(); /// getAnalysisUsage - For this class, we declare that we require and preserve diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index eeabc3f592..5046401773 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -46,13 +46,13 @@ namespace { std::set<std::string> ExternalNames; bool DontInternalize; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid InternalizePass(bool InternalizeEverything = true); InternalizePass(const std::vector <const char *>& exportList); void LoadFile(const char *Filename); virtual bool runOnModule(Module &M); }; - const char InternalizePass::ID = 0; + char InternalizePass::ID = 0; RegisterPass<InternalizePass> X("internalize", "Internalize Global Symbols"); } // end anonymous namespace diff --git a/lib/Transforms/IPO/LoopExtractor.cpp b/lib/Transforms/IPO/LoopExtractor.cpp index dc0ad432ac..7b10186231 100644 --- a/lib/Transforms/IPO/LoopExtractor.cpp +++ b/lib/Transforms/IPO/LoopExtractor.cpp @@ -34,7 +34,7 @@ namespace { // Module passes to require FunctionPasses, so we can't get loop info if we're // not a function pass. struct VISIBILITY_HIDDEN LoopExtractor : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid unsigned NumLoops; LoopExtractor(unsigned numLoops = ~0) @@ -51,17 +51,17 @@ namespace { } }; - const char LoopExtractor::ID = 0; + char LoopExtractor::ID = 0; RegisterPass<LoopExtractor> X("loop-extract", "Extract loops into new functions"); /// SingleLoopExtractor - For bugpoint. struct SingleLoopExtractor : public LoopExtractor { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid SingleLoopExtractor() : LoopExtractor(1) {} }; - const char SingleLoopExtractor::ID = 0; + char SingleLoopExtractor::ID = 0; RegisterPass<SingleLoopExtractor> Y("loop-extract-single", "Extract at most one loop into a new function"); } // End anonymous namespace @@ -152,7 +152,7 @@ namespace { class BlockExtractorPass : public ModulePass { std::vector<BasicBlock*> BlocksToNotExtract; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid BlockExtractorPass(std::vector<BasicBlock*> &B) : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {} BlockExtractorPass() : ModulePass((intptr_t)&ID) {} @@ -160,7 +160,7 @@ namespace { bool runOnModule(Module &M); }; - const char BlockExtractorPass::ID = 0; + char BlockExtractorPass::ID = 0; RegisterPass<BlockExtractorPass> XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)"); } diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp index 1fd90715d6..1f83add34a 100644 --- a/lib/Transforms/IPO/LowerSetJmp.cpp +++ b/lib/Transforms/IPO/LowerSetJmp.cpp @@ -109,7 +109,7 @@ namespace { bool IsTransformableFunction(const std::string& Name); public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LowerSetJmp() : ModulePass((intptr_t)&ID) {} void visitCallInst(CallInst& CI); @@ -121,7 +121,7 @@ namespace { bool doInitialization(Module& M); }; - const char LowerSetJmp::ID = 0; + char LowerSetJmp::ID = 0; RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump"); } // end anonymous namespace diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index 3d70f165d0..6f497e24e7 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -35,7 +35,7 @@ STATISTIC(NumUnreach, "Number of noreturn calls optimized"); namespace { struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid PruneEH() : CallGraphSCCPass((intptr_t)&ID) {} /// DoesNotUnwind - This set contains all of the functions which we have @@ -53,7 +53,7 @@ namespace { void DeleteBasicBlock(BasicBlock *BB); }; - const char PruneEH::ID = 0; + char PruneEH::ID = 0; RegisterPass<PruneEH> X("prune-eh", "Remove unused exception handling info"); } diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp index 7b338b1d1d..6b8f7e66d9 100644 --- a/lib/Transforms/IPO/RaiseAllocations.cpp +++ b/lib/Transforms/IPO/RaiseAllocations.cpp @@ -35,7 +35,7 @@ namespace { Function *MallocFunc; // Functions in the module we are processing Function *FreeFunc; // Initialized by doPassInitializationVirt public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid RaiseAllocations() : ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {} @@ -49,7 +49,7 @@ namespace { bool runOnModule(Module &M); }; - const char RaiseAllocations::ID = 0; + char RaiseAllocations::ID = 0; RegisterPass<RaiseAllocations> X("raiseallocs", "Raise allocations from calls to instructions"); } // end anonymous namespace diff --git a/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp index 8e5567cd3e..b55b9c5e51 100644 --- a/lib/Transforms/IPO/SimplifyLibCalls.cpp +++ b/lib/Transforms/IPO/SimplifyLibCalls.cpp @@ -152,7 +152,7 @@ public: /// @brief A ModulePass for optimizing well-known function calls. class VISIBILITY_HIDDEN SimplifyLibCalls : public ModulePass { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid SimplifyLibCalls() : ModulePass((intptr_t)&ID) {} /// We need some target data for accurate signature details that are @@ -376,7 +376,7 @@ private: TargetData *TD; ///< Cached TargetData }; -const char SimplifyLibCalls::ID = 0; +char SimplifyLibCalls::ID = 0; // Register the pass RegisterPass<SimplifyLibCalls> X("simplify-libcalls", "Simplify well-known library calls"); diff --git a/lib/Transforms/IPO/StripDeadPrototypes.cpp b/lib/Transforms/IPO/StripDeadPrototypes.cpp index d40e743833..5d30969278 100644 --- a/lib/Transforms/IPO/StripDeadPrototypes.cpp +++ b/lib/Transforms/IPO/StripDeadPrototypes.cpp @@ -27,12 +27,12 @@ namespace { /// @brief Pass to remove unused function declarations. class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { } virtual bool runOnModule(Module &M); }; -const char StripDeadPrototypesPass::ID = 0; +char StripDeadPrototypesPass::ID = 0; RegisterPass<StripDeadPrototypesPass> X("strip-dead-prototypes", "Strip Unused Function Prototypes"); diff --git a/lib/Transforms/IPO/S |