r241141 - -frewrite-includes: Prefer insert to emplace

Justin Bogner mail at justinbogner.com
Tue Jun 30 21:53:19 PDT 2015


Author: bogner
Date: Tue Jun 30 23:53:19 2015
New Revision: 241141

URL: http://llvm.org/viewvc/llvm-project?rev=241141&view=rev
Log:
-frewrite-includes: Prefer insert to emplace

Some bots didn't like r241140.

Modified:
    cfe/trunk/lib/Frontend/Rewrite/InclusionRewriter.cpp

Modified: cfe/trunk/lib/Frontend/Rewrite/InclusionRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/InclusionRewriter.cpp?rev=241141&r1=241140&r2=241141&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Rewrite/InclusionRewriter.cpp (original)
+++ cfe/trunk/lib/Frontend/Rewrite/InclusionRewriter.cpp Tue Jun 30 23:53:19 2015
@@ -148,8 +148,8 @@ void InclusionRewriter::FileChanged(Sour
     // we didn't reach this file (eg: the main file) via an inclusion directive
     return;
   FileID Id = FullSourceLoc(Loc, SM).getFileID();
-  auto P = FileIncludes.emplace(LastInclusionLocation.getRawEncoding(),
-                                IncludedFile(Id, NewFileType));
+  auto P = FileIncludes.insert(std::make_pair(
+      LastInclusionLocation.getRawEncoding(), IncludedFile(Id, NewFileType)));
   assert(P.second && "Unexpected revisitation of the same include directive");
   LastInclusionLocation = SourceLocation();
 }
@@ -182,7 +182,8 @@ void InclusionRewriter::InclusionDirecti
          "Another inclusion directive was found before the previous one "
          "was processed");
   if (Imported) {
-    auto P = ModuleIncludes.emplace(HashLoc.getRawEncoding(), Imported);
+    auto P = ModuleIncludes.insert(
+        std::make_pair(HashLoc.getRawEncoding(), Imported));
     assert(P.second && "Unexpected revisitation of the same include directive");
   } else
     LastInclusionLocation = HashLoc;





More information about the cfe-commits mailing list