summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Analysis/CallGraph.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2018-04-06 14:26:03 +0000
committerpatrick <patrick@openbsd.org>2018-04-06 14:26:03 +0000
commitbdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch)
treec50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/lib/Analysis/CallGraph.cpp
parentPrint a 'p' flag for file descriptors that were opened after pledge(2). (diff)
downloadwireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz
wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/lib/Analysis/CallGraph.cpp')
-rw-r--r--gnu/llvm/lib/Analysis/CallGraph.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/gnu/llvm/lib/Analysis/CallGraph.cpp b/gnu/llvm/lib/Analysis/CallGraph.cpp
index ff5242f69a1..ac3ea2b73fe 100644
--- a/gnu/llvm/lib/Analysis/CallGraph.cpp
+++ b/gnu/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;