aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CallGraph.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2020-04-10 14:58:13 -0700
committerVedant Kumar <vsk@apple.com>2020-04-13 10:55:17 -0700
commit122a6bfb07eb1ec7332ad1ee2e1a2136cc54a9c6 (patch)
treed59a869b727a63f9004d8b36c42ec6b57ab8dae0 /llvm/lib/Analysis/CallGraph.cpp
parent95e6f5c655fa39c26e4dc8d5ca65749af69cb484 (diff)
downloadllvm-122a6bfb07eb1ec7332ad1ee2e1a2136cc54a9c6.zip
llvm-122a6bfb07eb1ec7332ad1ee2e1a2136cc54a9c6.tar.gz
llvm-122a6bfb07eb1ec7332ad1ee2e1a2136cc54a9c6.tar.bz2
[Debugify] Strip added metadata in the -debugify-each pipeline
Summary: Share logic to strip debugify metadata between the IR and MIR level debugify passes. This makes it simpler to hunt for bugs by diffing IR with vs. without -debugify-each turned on. As a drive-by, fix an issue causing CallGraphNodes to become invalid when a dead llvm.dbg.value prototype is deleted. Reviewers: dsanders, aprantl Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77915
Diffstat (limited to 'llvm/lib/Analysis/CallGraph.cpp')
-rw-r--r--llvm/lib/Analysis/CallGraph.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/CallGraph.cpp b/llvm/lib/Analysis/CallGraph.cpp
index 777821c..7dd5a71 100644
--- a/llvm/lib/Analysis/CallGraph.cpp
+++ b/llvm/lib/Analysis/CallGraph.cpp
@@ -11,6 +11,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Function.h"
+#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
@@ -31,9 +32,10 @@ using namespace llvm;
CallGraph::CallGraph(Module &M)
: M(M), ExternalCallingNode(getOrInsertFunction(nullptr)),
CallsExternalNode(std::make_unique<CallGraphNode>(nullptr)) {
- // Add every function to the call graph.
+ // Add every interesting function to the call graph.
for (Function &F : M)
- addToCallGraph(&F);
+ if (!isDbgInfoIntrinsic(F.getIntrinsicID()))
+ addToCallGraph(&F);
}
CallGraph::CallGraph(CallGraph &&Arg)