diff options
author | Owen Anderson <resistor@mac.com> | 2010-08-06 00:23:35 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-08-06 00:23:35 +0000 |
commit | 1f74590e9d1b9cf0f1f81a156efea73f76546e05 (patch) | |
tree | f3b2fa6368e824b1dd3ad04e8c1c4f070b4bb4a0 /tools/opt | |
parent | f6d6df40060eef9af19b084b2fb7a8fd627415ae (diff) |
Revert r110396 to fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt')
-rw-r--r-- | tools/opt/AnalysisWrappers.cpp | 4 | ||||
-rw-r--r-- | tools/opt/GraphPrinters.cpp | 4 | ||||
-rw-r--r-- | tools/opt/PrintSCC.cpp | 4 | ||||
-rw-r--r-- | tools/opt/opt.cpp | 33 |
4 files changed, 21 insertions, 24 deletions
diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index 2fe5d226ec7..a4891d8d767 100644 --- a/tools/opt/AnalysisWrappers.cpp +++ b/tools/opt/AnalysisWrappers.cpp @@ -31,7 +31,7 @@ namespace { /// or handle in alias analyses. struct ExternalFunctionsPassedConstants : public ModulePass { static char ID; // Pass ID, replacement for typeid - ExternalFunctionsPassedConstants() : ModulePass(ID) {} + ExternalFunctionsPassedConstants() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { if (!I->isDeclaration()) continue; @@ -74,7 +74,7 @@ namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass(ID) {} + CallGraphPrinter() : ModulePass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); diff --git a/tools/opt/GraphPrinters.cpp b/tools/opt/GraphPrinters.cpp index fa4339a0554..e7c6d1e6af8 100644 --- a/tools/opt/GraphPrinters.cpp +++ b/tools/opt/GraphPrinters.cpp @@ -65,7 +65,7 @@ namespace llvm { namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass(ID) {} + CallGraphPrinter() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { WriteGraphToFile(llvm::errs(), "callgraph", &getAnalysis<CallGraph>()); @@ -93,7 +93,7 @@ namespace { class DomInfoPrinter : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - DomInfoPrinter() : FunctionPass(ID) {} + DomInfoPrinter() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); diff --git a/tools/opt/PrintSCC.cpp b/tools/opt/PrintSCC.cpp index 067c2038f76..ea486ca2900 100644 --- a/tools/opt/PrintSCC.cpp +++ b/tools/opt/PrintSCC.cpp @@ -36,7 +36,7 @@ using namespace llvm; namespace { struct CFGSCC : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSCC() : FunctionPass(ID) {} + CFGSCC() : FunctionPass(&ID) {} bool runOnFunction(Function& func); void print(raw_ostream &O, const Module* = 0) const { } @@ -48,7 +48,7 @@ namespace { struct CallGraphSCC : public ModulePass { static char ID; // Pass identification, replacement for typeid - CallGraphSCC() : ModulePass(ID) {} + CallGraphSCC() : ModulePass(&ID) {} // run - Print out SCCs in the call graph for the specified module. bool runOnModule(Module &M); diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index f6b829fde93..0878737d34b 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -139,7 +139,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass { static char ID; const PassInfo *PassToPrint; CallGraphSCCPassPrinter(const PassInfo *PI) : - CallGraphSCCPass(ID), PassToPrint(PI) {} + CallGraphSCCPass(&ID), PassToPrint(PI) {} virtual bool runOnSCC(CallGraphSCC &SCC) { if (!Quiet) { @@ -148,8 +148,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass { for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { Function *F = (*I)->getFunction(); if (F) - getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(), - F->getParent()); + getAnalysisID<Pass>(PassToPrint).print(outs(), F->getParent()); } } // Get and print pass... @@ -159,7 +158,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass { virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; @@ -169,13 +168,13 @@ char CallGraphSCCPassPrinter::ID = 0; struct ModulePassPrinter : public ModulePass { static char ID; const PassInfo *PassToPrint; - ModulePassPrinter(const PassInfo *PI) : ModulePass(ID), + ModulePassPrinter(const PassInfo *PI) : ModulePass(&ID), PassToPrint(PI) {} virtual bool runOnModule(Module &M) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(), &M); + getAnalysisID<Pass>(PassToPrint).print(outs(), &M); } // Get and print pass... @@ -185,7 +184,7 @@ struct ModulePassPrinter : public ModulePass { virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; @@ -194,7 +193,7 @@ char ModulePassPrinter::ID = 0; struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; static char ID; - FunctionPassPrinter(const PassInfo *PI) : FunctionPass(ID), + FunctionPassPrinter(const PassInfo *PI) : FunctionPass(&ID), PassToPrint(PI) {} virtual bool runOnFunction(Function &F) { @@ -203,15 +202,14 @@ struct FunctionPassPrinter : public FunctionPass { << "' for function '" << F.getName() << "':\n"; } // Get and print pass... - getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(), - F.getParent()); + getAnalysisID<Pass>(PassToPrint).print(outs(), F.getParent()); return false; } virtual const char *getPassName() const { return "FunctionPass Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; @@ -222,12 +220,12 @@ struct LoopPassPrinter : public LoopPass { static char ID; const PassInfo *PassToPrint; LoopPassPrinter(const PassInfo *PI) : - LoopPass(ID), PassToPrint(PI) {} + LoopPass(&ID), PassToPrint(PI) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(), + getAnalysisID<Pass>(PassToPrint).print(outs(), L->getHeader()->getParent()->getParent()); } // Get and print pass... @@ -237,7 +235,7 @@ struct LoopPassPrinter : public LoopPass { virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; @@ -248,7 +246,7 @@ struct BasicBlockPassPrinter : public BasicBlockPass { const PassInfo *PassToPrint; static char ID; BasicBlockPassPrinter(const PassInfo *PI) - : BasicBlockPass(ID), PassToPrint(PI) {} + : BasicBlockPass(&ID), PassToPrint(PI) {} virtual bool runOnBasicBlock(BasicBlock &BB) { if (!Quiet) { @@ -257,15 +255,14 @@ struct BasicBlockPassPrinter : public BasicBlockPass { } // Get and print pass... - getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(outs(), - BB.getParent()->getParent()); + getAnalysisID<Pass>(PassToPrint).print(outs(), BB.getParent()->getParent()); return false; } virtual const char *getPassName() const { return "BasicBlockPass Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; |