check for the NoAlias attribute through CallSite

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159145 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nuno Lopes 2012-06-25 16:17:54 +00:00
parent 986da6c3fd
commit e8742d084c

View 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);
}