1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

rangify; NFCI

llvm-svn: 257677
This commit is contained in:
Sanjay Patel 2016-01-13 21:39:26 +00:00
parent f5d97ee4eb
commit 2747253c1e

View File

@ -590,17 +590,16 @@ static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap,
IsArgMemOnlyCall = true;
}
for (ImmutableCallSite::arg_iterator AI = ICS.arg_begin(),
AE = ICS.arg_end(); AI != AE; ++AI) {
for (Value *Arg : ICS.args()) {
// We need to check the underlying objects of all arguments, not just
// the pointer arguments, because we might be passing pointers as
// integers, etc.
// However, if we know that the call only accesses pointer arguments,
// then we only need to check the pointer arguments.
if (IsArgMemOnlyCall && !(*AI)->getType()->isPointerTy())
if (IsArgMemOnlyCall && !Arg->getType()->isPointerTy())
continue;
PtrArgs.push_back(*AI);
PtrArgs.push_back(Arg);
}
}
@ -618,9 +617,9 @@ static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap,
SmallVector<Metadata *, 4> Scopes, NoAliases;
SmallSetVector<const Argument *, 4> NAPtrArgs;
for (unsigned i = 0, ie = PtrArgs.size(); i != ie; ++i) {
for (const Value *V : PtrArgs) {
SmallVector<Value *, 4> Objects;
GetUnderlyingObjects(const_cast<Value*>(PtrArgs[i]),
GetUnderlyingObjects(const_cast<Value*>(V),
Objects, DL, /* LI = */ nullptr);
for (Value *O : Objects)