From: Benjamin Kramer Date: Sun, 22 Oct 2017 20:16:28 +0000 (+0000) Subject: Create fewer copies of StringMaps. No functionality change intended. X-Git-Tag: llvmorg-6.0.0-rc1~5191 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24952ce5b97146800f84d1df586cf0e78acabaa4;p=platform%2Fupstream%2Fllvm.git Create fewer copies of StringMaps. No functionality change intended. llvm-svn: 316301 --- diff --git a/clang/lib/Frontend/PrecompiledPreamble.cpp b/clang/lib/Frontend/PrecompiledPreamble.cpp index 81466d0..e44f55d 100644 --- a/clang/lib/Frontend/PrecompiledPreamble.cpp +++ b/clang/lib/Frontend/PrecompiledPreamble.cpp @@ -445,7 +445,7 @@ PrecompiledPreamble::PrecompiledPreamble( TempPCHFile PCHFile, std::vector PreambleBytes, bool PreambleEndsAtStartOfLine, llvm::StringMap FilesInPreamble) - : PCHFile(std::move(PCHFile)), FilesInPreamble(FilesInPreamble), + : PCHFile(std::move(PCHFile)), FilesInPreamble(std::move(FilesInPreamble)), PreambleBytes(std::move(PreambleBytes)), PreambleEndsAtStartOfLine(PreambleEndsAtStartOfLine) {} diff --git a/clang/lib/Parse/ParseStmtAsm.cpp b/clang/lib/Parse/ParseStmtAsm.cpp index f38ad27..3bd7fcc 100644 --- a/clang/lib/Parse/ParseStmtAsm.cpp +++ b/clang/lib/Parse/ParseStmtAsm.cpp @@ -558,7 +558,7 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) { if (buildMSAsmString(PP, AsmLoc, AsmToks, TokOffsets, AsmString)) return StmtError(); - TargetOptions TO = Actions.Context.getTargetInfo().getTargetOpts(); + const TargetOptions &TO = Actions.Context.getTargetInfo().getTargetOpts(); std::string FeaturesStr = llvm::join(TO.Features.begin(), TO.Features.end(), ","); diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h index 09e2723..3aba123 100644 --- a/llvm/include/llvm/ProfileData/SampleProf.h +++ b/llvm/include/llvm/ProfileData/SampleProf.h @@ -372,7 +372,7 @@ public: if (!Callee || !Callee->getSubprogram()) S.insert(Function::getGUID(TS.getKey())); } - for (auto CS : CallsiteSamples) + for (const auto &CS : CallsiteSamples) for (const auto &NameFS : CS.second) NameFS.second.findImportedFunctions(S, M, Threshold); }