hasNUses(0) == use_empty() ; NFCI

Also, improve variable name and remove unnecessary braces.

llvm-svn: 257687
This commit is contained in:
Sanjay Patel 2016-01-13 22:16:48 +00:00
parent 2d2f2b5c80
commit 42c73555b0
1 changed files with 3 additions and 4 deletions

View File

@ -506,10 +506,9 @@ static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap,
const Function *CalledFunc = CS.getCalledFunction();
SmallVector<const Argument *, 4> NoAliasArgs;
for (const Argument &I : CalledFunc->args()) {
if (I.hasNoAliasAttr() && !I.hasNUses(0))
NoAliasArgs.push_back(&I);
}
for (const Argument &Arg : CalledFunc->args())
if (Arg.hasNoAliasAttr() && !Arg.use_empty())
NoAliasArgs.push_back(&Arg);
if (NoAliasArgs.empty())
return;