check for the NoAlias attribute through CallSite
authorNuno Lopes <nunoplopes@sapo.pt>
Mon, 25 Jun 2012 16:17:54 +0000 (16:17 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Mon, 25 Jun 2012 16:17:54 +0000 (16:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159145 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryBuiltins.cpp

index a9f124453507746b899f510c34b873cfcd4df6bd..6b21b73f22f831dd27aa3aa5349dcc72d15ec0e3 100644 (file)
@@ -118,8 +118,8 @@ static const AllocFnsTy *getAllocationData(const Value *V, AllocType AllocTy,
 }
 
 static bool hasNoAliasAttr(const Value *V, bool LookThroughBitCast) {
-  Function *Callee = getCalledFunction(V, LookThroughBitCast);
-  return Callee && Callee->hasFnAttr(Attribute::NoAlias);
+  ImmutableCallSite CS(LookThroughBitCast ? V->stripPointerCasts() : V);
+  return CS && CS.hasFnAttr(Attribute::NoAlias);
 }