Create fewer copies of StringMaps. No functionality change intended.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 22 Oct 2017 20:16:28 +0000 (20:16 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 22 Oct 2017 20:16:28 +0000 (20:16 +0000)
llvm-svn: 316301

clang/lib/Frontend/PrecompiledPreamble.cpp
clang/lib/Parse/ParseStmtAsm.cpp
llvm/include/llvm/ProfileData/SampleProf.h

index 81466d0..e44f55d 100644 (file)
@@ -445,7 +445,7 @@ PrecompiledPreamble::PrecompiledPreamble(
     TempPCHFile PCHFile, std::vector<char> PreambleBytes,
     bool PreambleEndsAtStartOfLine,
     llvm::StringMap<PreambleFileHash> FilesInPreamble)
-    : PCHFile(std::move(PCHFile)), FilesInPreamble(FilesInPreamble),
+    : PCHFile(std::move(PCHFile)), FilesInPreamble(std::move(FilesInPreamble)),
       PreambleBytes(std::move(PreambleBytes)),
       PreambleEndsAtStartOfLine(PreambleEndsAtStartOfLine) {}
 
index f38ad27..3bd7fcc 100644 (file)
@@ -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(), ",");
 
index 09e2723..3aba123 100644 (file)
@@ -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);
   }