[llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h Pass.h PassManagers.h PassSupport.h
Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.12 -> 1.13 Pass.h updated: 1.86 -> 1.87 PassManagers.h updated: 1.16 -> 1.17 PassSupport.h updated: 1.38 -> 1.39 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+29 -19) CallGraphSCCPass.h |2 ++ Pass.h | 16 +++- PassManagers.h |4 +++- PassSupport.h | 26 +- 4 files changed, 29 insertions(+), 19 deletions(-) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.12 llvm/include/llvm/CallGraphSCCPass.h:1.13 --- llvm/include/llvm/CallGraphSCCPass.h:1.12 Mon Apr 16 13:51:25 2007 +++ llvm/include/llvm/CallGraphSCCPass.hTue May 1 16:15:46 2007 @@ -31,6 +31,8 @@ struct CallGraphSCCPass : public Pass { + CallGraphSCCPass(intptr_t pid) : Pass(pid) {} + /// doInitialization - This method is called before the SCC's of the program /// has been processed, allowing the pass to do initialization as necessary. virtual bool doInitialization(CallGraph &CG) { Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.86 llvm/include/llvm/Pass.h:1.87 --- llvm/include/llvm/Pass.h:1.86 Thu Apr 26 16:33:41 2007 +++ llvm/include/llvm/Pass.hTue May 1 16:15:46 2007 @@ -34,8 +34,8 @@ #include #include #include -#include #include +#include namespace llvm { @@ -77,7 +77,7 @@ /// class Pass { AnalysisResolver *Resolver; // Used to resolve analysis - const PassInfo *PassInfoCache; + intptr_t PassID; // AnalysisImpls - This keeps track of which passes implement the interfaces // that are required by the current pass (to implement getAnalysis()). @@ -87,7 +87,7 @@ void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - Pass() : Resolver(0), PassInfoCache(0) {} + Pass(intptr_t pid) : Resolver(0), PassID(pid) {} virtual ~Pass(); /// getPassName - Return a nice clean name for a pass. This usually @@ -163,12 +163,12 @@ template static const PassInfo *getClassPassInfo() { -return lookupPassInfo(typeid(AnalysisClass)); +return lookupPassInfo((intptr_t)&AnalysisClass::ID); } // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. - static const PassInfo *lookupPassInfo(const std::type_info &TI); + static const PassInfo *lookupPassInfo(intptr_t TI); /// getAnalysisToUpdate() - This function is used by subclasses /// to get to the analysis information that might be around that needs to be @@ -232,6 +232,7 @@ return PMT_ModulePassManager; } + ModulePass(intptr_t pid) : Pass(pid) {} // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -256,6 +257,7 @@ /// virtual bool runOnModule(Module &M) { return false; } + ImmutablePass(intptr_t pid) : ModulePass(pid) {} // Force out-of-line virtual method. virtual ~ImmutablePass(); }; @@ -271,6 +273,8 @@ /// class FunctionPass : public Pass { public: + FunctionPass(intptr_t pid) : Pass(pid) {} + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// @@ -320,6 +324,8 @@ /// class BasicBlockPass : public Pass { public: + BasicBlockPass(intptr_t pid) : Pass(pid) {} + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// Index: llvm/include/llvm/PassManagers.h diff -u llvm/include/llvm/PassManagers.h:1.16 llvm/include/llvm/PassManagers.h:1.17 --- llvm/include/llvm/PassManagers.h:1.16 Mon Apr 16 15:12:57 2007 +++ llvm/include/llvm/PassManagers.hTue May 1 16:15:46 2007 @@ -336,7 +336,9 @@ class FPPassManager : public ModulePass, public PMDataManager { public: - explicit FPPassManager(int Depth) : PMDataManager(Depth) { } + static const int ID; + explicit FPPassManager(int Depth) + : ModulePass((intptr_t)&ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.38 llvm/include/llvm/PassSupport.h:1.39 --- llvm/include/llvm/PassSupport.h:1.38Mon Apr 16 13:10:22 2007 +++ llvm/include/llvm/PassSupport.h Tue May 1 16:15:46 2007 @@ -37,19 +37,19 @@ class PassInfo { const char *PassName; // Nice name for Pass const char *PassArgument; // Command Line argument to run this pass - const std::type_info &TypeInfo; // type_info object for this Pass class + intptr_t PassID; bool IsCFGOnlyPass; // Pass only looks at the CFG. bool IsAnalysisGroup;// True if an analysis group. std::vector ItfImpl;// Interfaces implemen
[llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h Pass.h PassSupport.h
Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.10 -> 1.11 Pass.h updated: 1.81 -> 1.82 PassSupport.h updated: 1.37 -> 1.38 --- Log message: Removed tabs everywhere except autogenerated & external files. Add make target for tabs checking. --- Diffs of the changes: (+9 -7) CallGraphSCCPass.h |2 +- Pass.h |8 PassSupport.h |6 -- 3 files changed, 9 insertions(+), 7 deletions(-) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.10 llvm/include/llvm/CallGraphSCCPass.h:1.11 --- llvm/include/llvm/CallGraphSCCPass.h:1.10 Thu Jan 25 19:08:18 2007 +++ llvm/include/llvm/CallGraphSCCPass.hMon Apr 16 13:10:22 2007 @@ -52,7 +52,7 @@ /// Assign pass manager to manager this pass virtual void assignPassManager(PMStack &PMS, -PassManagerType PMT = PMT_CallGraphPassManager); + PassManagerType PMT = PMT_CallGraphPassManager); /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.81 llvm/include/llvm/Pass.h:1.82 --- llvm/include/llvm/Pass.h:1.81 Mon Mar 5 19:55:46 2007 +++ llvm/include/llvm/Pass.hMon Apr 16 13:10:22 2007 @@ -123,7 +123,7 @@ /// Each pass is responsible for assigning a pass manager to itself. /// PMS is the stack of available pass manager. virtual void assignPassManager(PMStack &PMS, -PassManagerType T = PMT_Unknown) {} + PassManagerType T = PMT_Unknown) {} /// Check if available pass managers are suitable for this pass or not. virtual void preparePassManager(PMStack &PMS) {} @@ -215,7 +215,7 @@ virtual bool runPass(BasicBlock&) { return false; } virtual void assignPassManager(PMStack &PMS, -PassManagerType T = PMT_ModulePassManager); + PassManagerType T = PMT_ModulePassManager); // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -282,7 +282,7 @@ bool run(Function &F); virtual void assignPassManager(PMStack &PMS, -PassManagerType T = PMT_FunctionPassManager); + PassManagerType T = PMT_FunctionPassManager); }; @@ -337,7 +337,7 @@ virtual bool runPass(BasicBlock &BB); virtual void assignPassManager(PMStack &PMS, -PassManagerType T = PMT_BasicBlockPassManager); + PassManagerType T = PMT_BasicBlockPassManager); }; /// PMStack Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.37 llvm/include/llvm/PassSupport.h:1.38 --- llvm/include/llvm/PassSupport.h:1.37Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/PassSupport.h Mon Apr 16 13:10:22 2007 @@ -137,8 +137,10 @@ /// const PassInfo *getPassInfo() const { return &PIObj; } + typedef Pass* (*NormalCtor_t)(); + RegisterPassBase(const char *Name, const char *Arg, const std::type_info &TI, - Pass *(*NormalCtor)() = 0, bool CFGOnly = false) + NormalCtor_t NormalCtor = 0, bool CFGOnly = false) : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) { registerPass(); } @@ -164,7 +166,7 @@ // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false) : RegisterPassBase(Name, PassArg, typeid(PassName), - callDefaultCtor, CFGOnly) { + (RegisterPassBase::NormalCtor_t)callDefaultCtor, CFGOnly) { } }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h
Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.9 -> 1.10 --- Log message: Remove dead code. CallGraphSCCPass does not need to implement runOnModule(). It supports runOnSCC(). --- Diffs of the changes: (+0 -5) CallGraphSCCPass.h |5 - 1 files changed, 5 deletions(-) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.9 llvm/include/llvm/CallGraphSCCPass.h:1.10 --- llvm/include/llvm/CallGraphSCCPass.h:1.9Thu Jan 25 18:47:38 2007 +++ llvm/include/llvm/CallGraphSCCPass.hThu Jan 25 19:08:18 2007 @@ -50,11 +50,6 @@ return false; } - /// run - Run this pass, returning true if a modification was made to the - /// module argument. This is implemented in terms of the runOnSCC method. - /// - virtual bool runOnModule(Module &M); - /// Assign pass manager to manager this pass virtual void assignPassManager(PMStack &PMS, PassManagerType PMT = PMT_CallGraphPassManager); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h
Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.8 -> 1.9 --- Log message: Inherit CallGraphSCCPass directly from Pass. --- Diffs of the changes: (+1 -1) CallGraphSCCPass.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.8 llvm/include/llvm/CallGraphSCCPass.h:1.9 --- llvm/include/llvm/CallGraphSCCPass.h:1.8Tue Jan 23 15:52:35 2007 +++ llvm/include/llvm/CallGraphSCCPass.hThu Jan 25 18:47:38 2007 @@ -29,7 +29,7 @@ class CallGraph; class PMStack; -struct CallGraphSCCPass : public ModulePass { +struct CallGraphSCCPass : public Pass { /// doInitialization - This method is called before the SCC's of the program /// has been processed, allowing the pass to do initialization as necessary. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h
Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.7 -> 1.8 --- Log message: Add CallGraphSCCPass::assignPassManager(). This enables CalLGraphPassManager. --- Diffs of the changes: (+4 -0) CallGraphSCCPass.h |4 1 files changed, 4 insertions(+) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.7 llvm/include/llvm/CallGraphSCCPass.h:1.8 --- llvm/include/llvm/CallGraphSCCPass.h:1.7Thu Apr 21 15:11:51 2005 +++ llvm/include/llvm/CallGraphSCCPass.hTue Jan 23 15:52:35 2007 @@ -27,6 +27,7 @@ class CallGraphNode; class CallGraph; +class PMStack; struct CallGraphSCCPass : public ModulePass { @@ -54,6 +55,9 @@ /// virtual bool runOnModule(Module &M); + /// Assign pass manager to manager this pass + virtual void assignPassManager(PMStack &PMS, +PassManagerType PMT = PMT_CallGraphPassManager); /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits