mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
Use const-ref in range-loop for to avoid copying pairs of std::string
No reason to create temporaries. Differential Revision: https://reviews.llvm.org/D29871 Patch by sergio.martins! llvm-svn: 295807
This commit is contained in:
parent
da00194d3c
commit
c35c905230
@ -1380,7 +1380,7 @@ bool AttrBuilder::overlaps(const AttrBuilder &B) const {
|
||||
return true;
|
||||
|
||||
// Then check if any target dependent ones do.
|
||||
for (auto I : td_attrs())
|
||||
for (const auto &I : td_attrs())
|
||||
if (B.contains(I.first))
|
||||
return true;
|
||||
|
||||
|
@ -364,7 +364,7 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
|
||||
// attribute can not be inherited.
|
||||
AttributeSet OldFnAttrs = oldFunction->getAttributes().getFnAttributes();
|
||||
AttrBuilder AB(OldFnAttrs, AttributeSet::FunctionIndex);
|
||||
for (auto Attr : AB.td_attrs())
|
||||
for (const auto &Attr : AB.td_attrs())
|
||||
newFunction->addFnAttr(Attr.first, Attr.second);
|
||||
|
||||
newFunction->getBasicBlockList().push_back(newRootNode);
|
||||
|
Loading…
Reference in New Issue
Block a user