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:
Sean Silva
2017-02-22 06:34:04 +00:00
parent 8856aa9a54
commit 9011aca5f4
2 changed files with 2 additions and 2 deletions

View File

@@ -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);