aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/ExtractFunction.cpp3
-rw-r--r--tools/bugpoint/TestPasses.cpp4
-rw-r--r--tools/bugpoint/bugpoint.cpp3
-rw-r--r--tools/llvm-prof/llvm-prof.cpp2
-rw-r--r--tools/opt/AnalysisWrappers.cpp4
-rw-r--r--tools/opt/GraphPrinters.cpp4
-rw-r--r--tools/opt/PrintSCC.cpp4
-rw-r--r--tools/opt/opt.cpp33
8 files changed, 26 insertions, 31 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index bbdc728890..6913fd06a9 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -100,8 +100,7 @@ Module *BugDriver::deleteInstructionFromProgram(const Instruction *I,
}
static const PassInfo *getPI(Pass *P) {
- const void *ID = P->getPassID();
- const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID);
+ const PassInfo *PI = P->getPassInfo();
delete P;
return PI;
}
diff --git a/tools/bugpoint/TestPasses.cpp b/tools/bugpoint/TestPasses.cpp
index 4ae23f5b76..900bf632a8 100644
--- a/tools/bugpoint/TestPasses.cpp
+++ b/tools/bugpoint/TestPasses.cpp
@@ -27,7 +27,7 @@ namespace {
class CrashOnCalls : public BasicBlockPass {
public:
static char ID; // Pass ID, replacement for typeid
- CrashOnCalls() : BasicBlockPass(ID) {}
+ CrashOnCalls() : BasicBlockPass(&ID) {}
private:
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
@@ -54,7 +54,7 @@ namespace {
class DeleteCalls : public BasicBlockPass {
public:
static char ID; // Pass ID, replacement for typeid
- DeleteCalls() : BasicBlockPass(ID) {}
+ DeleteCalls() : BasicBlockPass(&ID) {}
private:
bool runOnBasicBlock(BasicBlock &BB) {
for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp
index b4bc455db1..ba5234bdc8 100644
--- a/tools/bugpoint/bugpoint.cpp
+++ b/tools/bugpoint/bugpoint.cpp
@@ -90,8 +90,7 @@ namespace {
AddToDriver(BugDriver &_D) : D(_D) {}
virtual void add(Pass *P) {
- const void *ID = P->getPassID();
- const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID);
+ const PassInfo *PI = P->getPassInfo();
D.addPasses(&PI, &PI + 1);
}
};
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp
index 0c6c4d7bb7..88adeb43e6 100644
--- a/tools/llvm-prof/llvm-prof.cpp
+++ b/tools/llvm-prof/llvm-prof.cpp
@@ -128,7 +128,7 @@ namespace {
public:
static char ID; // Class identification, replacement for typeinfo.
explicit ProfileInfoPrinterPass(ProfileInfoLoader &_PIL)
- : ModulePass(ID), PIL(_PIL) {}
+ : ModulePass(&ID), PIL(_PIL) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp
index 2fe5d226ec..a4891d8d76 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 fa4339a055..e7c6d1e6af 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 067c2038f7..ea486ca290 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 f6b829fde9..0878737d34 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();
}
};