diff options
author | Devang Patel <dpatel@apple.com> | 2007-05-01 21:15:47 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-05-01 21:15:47 +0000 |
commit | 09f162ca6a10446d6377b957f3a58ac92ce38306 (patch) | |
tree | b41e816449956582e447ab616707e1afbf1a88fe /llvm/lib/Analysis/CFGPrinter.cpp | |
parent | a612049dd849d1e659eeaeefbcf82147af7f669f (diff) | |
download | bcm5719-llvm-09f162ca6a10446d6377b957f3a58ac92ce38306.tar.gz bcm5719-llvm-09f162ca6a10446d6377b957f3a58ac92ce38306.zip |
Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
Diffstat (limited to 'llvm/lib/Analysis/CFGPrinter.cpp')
-rw-r--r-- | llvm/lib/Analysis/CFGPrinter.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/CFGPrinter.cpp b/llvm/lib/Analysis/CFGPrinter.cpp index a57a0685a7e..61544603758 100644 --- a/llvm/lib/Analysis/CFGPrinter.cpp +++ b/llvm/lib/Analysis/CFGPrinter.cpp @@ -91,6 +91,9 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits { namespace { struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + CFGPrinter() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getName() + ".dot"; cerr << "Writing '" << Filename << "'..."; @@ -111,10 +114,12 @@ namespace { } }; + const int CFGPrinter::ID = 0; RegisterPass<CFGPrinter> P1("print-cfg", "Print CFG of function to 'dot' file"); struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { + static const int ID; // Pass identifcation, replacement for typeid virtual bool runOnFunction(Function &F) { bool OldCFGOnly = CFGOnly; CFGOnly = true; @@ -129,6 +134,7 @@ namespace { } }; + const int CFGOnlyPrinter::ID = 0; RegisterPass<CFGOnlyPrinter> P2("print-cfg-only", "Print CFG of function to 'dot' file (with no function bodies)"); |