diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2017-07-24 23:16:33 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2017-07-24 23:16:33 +0000 |
commit | 48666a694c7ba4f230a4c2ad8ca3be3084c32f47 (patch) | |
tree | f4c61f820cced8f90ba29ebe2c403782d9a85df8 /llvm/lib/Analysis/CallGraph.cpp | |
parent | 1d70d75f468c2df944dffe48aa4efe22716156f9 (diff) | |
download | bcm5719-llvm-48666a694c7ba4f230a4c2ad8ca3be3084c32f47.tar.gz bcm5719-llvm-48666a694c7ba4f230a4c2ad8ca3be3084c32f47.zip |
[Analysis] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 308936
Diffstat (limited to 'llvm/lib/Analysis/CallGraph.cpp')
-rw-r--r-- | llvm/lib/Analysis/CallGraph.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/CallGraph.cpp b/llvm/lib/Analysis/CallGraph.cpp index ff5242f69a1..ac3ea2b73fe 100644 --- a/llvm/lib/Analysis/CallGraph.cpp +++ b/llvm/lib/Analysis/CallGraph.cpp @@ -8,12 +8,20 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/CallGraph.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/IR/CallSite.h" -#include "llvm/IR/Instructions.h" -#include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Module.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Intrinsics.h" +#include "llvm/IR/PassManager.h" +#include "llvm/Pass.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +#include <algorithm> +#include <cassert> + using namespace llvm; //===----------------------------------------------------------------------===// @@ -125,7 +133,6 @@ Function *CallGraph::removeFunctionFromModule(CallGraphNode *CGN) { /// This does not rescan the body of the function, so it is suitable when /// splicing the body of the old function to the new while also updating all /// callers from old to new. -/// void CallGraph::spliceFunction(const Function *From, const Function *To) { assert(FunctionMap.count(From) && "No CallGraphNode for function!"); assert(!FunctionMap.count(To) && @@ -256,7 +263,7 @@ CallGraphWrapperPass::CallGraphWrapperPass() : ModulePass(ID) { initializeCallGraphWrapperPassPass(*PassRegistry::getPassRegistry()); } -CallGraphWrapperPass::~CallGraphWrapperPass() {} +CallGraphWrapperPass::~CallGraphWrapperPass() = default; void CallGraphWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -291,8 +298,10 @@ void CallGraphWrapperPass::dump() const { print(dbgs(), nullptr); } #endif namespace { + struct CallGraphPrinterLegacyPass : public ModulePass { static char ID; // Pass ID, replacement for typeid + CallGraphPrinterLegacyPass() : ModulePass(ID) { initializeCallGraphPrinterLegacyPassPass(*PassRegistry::getPassRegistry()); } @@ -301,12 +310,14 @@ struct CallGraphPrinterLegacyPass : public ModulePass { AU.setPreservesAll(); AU.addRequiredTransitive<CallGraphWrapperPass>(); } + bool runOnModule(Module &M) override { getAnalysis<CallGraphWrapperPass>().print(errs(), &M); return false; } }; -} + +} // end anonymous namespace char CallGraphPrinterLegacyPass::ID = 0; |