Skip to content

Commit 15dbcb4

Browse files
committed
simplify code from previous commits (Thanks Duncan)
llvm-svn: 158999
1 parent 46e14f8 commit 15dbcb4

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

llvm/lib/Analysis/MemoryBuiltins.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,8 @@ static Function *getCalledFunction(const Value *V, bool LookThroughBitCast) {
6666
if (LookThroughBitCast)
6767
V = V->stripPointerCasts();
6868

69-
Value *I = const_cast<Value*>(V);
70-
CallSite CS;
71-
if (CallInst *CI = dyn_cast<CallInst>(I))
72-
CS = CallSite(CI);
73-
else if (InvokeInst *II = dyn_cast<InvokeInst>(I))
74-
CS = CallSite(II);
75-
else
69+
CallSite CS(const_cast<Value*>(V));
70+
if (!CS.getInstruction())
7671
return 0;
7772

7873
Function *Callee = CS.getCalledFunction();

0 commit comments

Comments
 (0)