mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 22:07:27 +00:00
Now that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
teach the callgraph logic to not create callgraph edges to intrinsics for invoke instructions; it already skips this for call instructions. Fixes PR13903. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164707 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
696e06e453
commit
44401b7c80
@ -141,12 +141,13 @@ private:
|
|||||||
for (BasicBlock::iterator II = BB->begin(), IE = BB->end();
|
for (BasicBlock::iterator II = BB->begin(), IE = BB->end();
|
||||||
II != IE; ++II) {
|
II != IE; ++II) {
|
||||||
CallSite CS(cast<Value>(II));
|
CallSite CS(cast<Value>(II));
|
||||||
if (CS && !isa<IntrinsicInst>(II)) {
|
if (CS) {
|
||||||
const Function *Callee = CS.getCalledFunction();
|
const Function *Callee = CS.getCalledFunction();
|
||||||
if (Callee)
|
if (!Callee)
|
||||||
Node->addCalledFunction(CS, getOrInsertFunction(Callee));
|
// Indirect calls of intrinsics are not allowed so no need to check.
|
||||||
else
|
|
||||||
Node->addCalledFunction(CS, CallsExternalNode);
|
Node->addCalledFunction(CS, CallsExternalNode);
|
||||||
|
else if (!Callee->isIntrinsic())
|
||||||
|
Node->addCalledFunction(CS, getOrInsertFunction(Callee));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
test/Analysis/CallGraph/do-nothing-intrinsic.ll
Normal file
13
test/Analysis/CallGraph/do-nothing-intrinsic.ll
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
; RUN: opt < %s -basiccg
|
||||||
|
; PR13903
|
||||||
|
|
||||||
|
define void @main() {
|
||||||
|
invoke void @llvm.donothing()
|
||||||
|
to label %ret unwind label %unw
|
||||||
|
unw:
|
||||||
|
%tmp = landingpad i8 personality i8 0 cleanup
|
||||||
|
br label %ret
|
||||||
|
ret:
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
declare void @llvm.donothing() nounwind readnone
|
Loading…
Reference in New Issue
Block a user