Revert "[CallGraph] Refine call graph for indirect calls with !callees metadata"
This reverts commit r369025. Crashes clang, test case is on the mailing
list.
llvm-svn: 369096
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp
index c832dc9..08d6e76 100644
--- a/llvm/lib/Analysis/LazyCallGraph.cpp
+++ b/llvm/lib/Analysis/LazyCallGraph.cpp
@@ -100,14 +100,12 @@
for (BasicBlock &BB : *F)
for (Instruction &I : BB) {
if (auto CS = CallSite(&I))
- for (Function *Callee : CS.getKnownCallees())
+ if (Function *Callee = CS.getCalledFunction())
if (!Callee->isDeclaration())
if (Callees.insert(Callee).second) {
Visited.insert(Callee);
- auto EdgeK = CS.getCalledFunction() ? LazyCallGraph::Edge::Call
- : LazyCallGraph::Edge::Ref;
addEdge(Edges->Edges, Edges->EdgeIndexMap, G->get(*Callee),
- EdgeK);
+ LazyCallGraph::Edge::Call);
}
for (Value *Op : I.operand_values())