diff options
author | dim <dim@FreeBSD.org> | 2010-09-17 15:48:55 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-09-17 15:48:55 +0000 |
commit | 5d5cc59cc77afe655b3707cb0e69e0827b444cad (patch) | |
tree | 36453626c792cccd91f783a38a169d610a6b9db9 /tools/opt/AnalysisWrappers.cpp | |
parent | 786a18553586229ad99ecb5ecde8a9d914c45e27 (diff) | |
download | FreeBSD-src-5d5cc59cc77afe655b3707cb0e69e0827b444cad.zip FreeBSD-src-5d5cc59cc77afe655b3707cb0e69e0827b444cad.tar.gz |
Vendor import of llvm r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/llvm/branches/release_28@114020
Approved by: rpaulo (mentor)
Diffstat (limited to 'tools/opt/AnalysisWrappers.cpp')
-rw-r--r-- | tools/opt/AnalysisWrappers.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index f548d00..a2b57bb 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; @@ -42,8 +42,8 @@ namespace { Instruction *User = dyn_cast<Instruction>(*UI); if (!User) continue; - CallSite CS = CallSite::get(User); - if (!CS.getInstruction()) continue; + CallSite CS(cast<Value>(User)); + if (!CS) continue; for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) { @@ -66,15 +66,17 @@ namespace { AU.setPreservesAll(); } }; +} - char ExternalFunctionsPassedConstants::ID = 0; - RegisterPass<ExternalFunctionsPassedConstants> +char ExternalFunctionsPassedConstants::ID = 0; +static RegisterPass<ExternalFunctionsPassedConstants> P1("print-externalfnconstants", "Print external fn callsites passed constants"); +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(); @@ -85,8 +87,8 @@ namespace { return false; } }; - - char CallGraphPrinter::ID = 0; - RegisterPass<CallGraphPrinter> - P2("print-callgraph", "Print a call graph"); } + +char CallGraphPrinter::ID = 0; +static RegisterPass<CallGraphPrinter> + P2("print-callgraph", "Print a call graph"); |