[llvm] r257687 - hasNUses(0) == use_empty() ; NFCI
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 13 14:16:49 PST 2016
Author: spatel
Date: Wed Jan 13 16:16:48 2016
New Revision: 257687
URL: http://llvm.org/viewvc/llvm-project?rev=257687&view=rev
Log:
hasNUses(0) == use_empty() ; NFCI
Also, improve variable name and remove unnecessary braces.
Modified:
llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=257687&r1=257686&r2=257687&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Wed Jan 13 16:16:48 2016
@@ -506,10 +506,9 @@ static void AddAliasScopeMetadata(CallSi
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;
More information about the llvm-commits
mailing list