From d845c34170be5ece8aee3a1097849aa8ce9259cb Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Fri, 22 Jun 2012 15:50:53 +0000 Subject: simplify code from previous commits (Thanks Duncan) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158999 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/MemoryBuiltins.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/Analysis/MemoryBuiltins.cpp') diff --git a/lib/Analysis/MemoryBuiltins.cpp b/lib/Analysis/MemoryBuiltins.cpp index d1a9363b41..a9f1244535 100644 --- a/lib/Analysis/MemoryBuiltins.cpp +++ b/lib/Analysis/MemoryBuiltins.cpp @@ -66,13 +66,8 @@ static Function *getCalledFunction(const Value *V, bool LookThroughBitCast) { if (LookThroughBitCast) V = V->stripPointerCasts(); - Value *I = const_cast(V); - CallSite CS; - if (CallInst *CI = dyn_cast(I)) - CS = CallSite(CI); - else if (InvokeInst *II = dyn_cast(I)) - CS = CallSite(II); - else + CallSite CS(const_cast(V)); + if (!CS.getInstruction()) return 0; Function *Callee = CS.getCalledFunction(); -- cgit v1.2.3-18-g5258