rangify; NFCI

llvm-svn: 257677
This commit is contained in:
Sanjay Patel 2016-01-13 21:39:26 +00:00
parent d99299e4bc
commit e01dcab39d
1 changed files with 5 additions and 6 deletions

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)