[PATCH] D23612: [LTO] Change addSaveTemps API: do not add dot to the supplied prefix path

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 15:44:29 PDT 2016


mehdi_amini updated this revision to Diff 68440.
mehdi_amini added a comment.

Fix the "." for the UseInputModulePath case


https://reviews.llvm.org/D23612

Files:
  lib/LTO/LTOBackend.cpp
  tools/gold/gold-plugin.cpp
  tools/llvm-lto2/llvm-lto2.cpp

Index: tools/llvm-lto2/llvm-lto2.cpp
===================================================================
--- tools/llvm-lto2/llvm-lto2.cpp
+++ tools/llvm-lto2/llvm-lto2.cpp
@@ -136,7 +136,8 @@
   };
 
   if (SaveTemps)
-    check(Conf.addSaveTemps(OutputFilename), "Config::addSaveTemps failed");
+    check(Conf.addSaveTemps(OutputFilename + "."),
+          "Config::addSaveTemps failed");
 
   LTO Lto(std::move(Conf));
 
Index: tools/gold/gold-plugin.cpp
===================================================================
--- tools/gold/gold-plugin.cpp
+++ tools/gold/gold-plugin.cpp
@@ -796,7 +796,8 @@
     break;
 
   case options::OT_SAVE_TEMPS:
-    check(Conf.addSaveTemps(output_name, /* UseInputModulePath */ true));
+    check(Conf.addSaveTemps(Twine(output_name) + ".",
+                            /* UseInputModulePath */ true));
     break;
   }
 
Index: lib/LTO/LTOBackend.cpp
===================================================================
--- lib/LTO/LTOBackend.cpp
+++ lib/LTO/LTOBackend.cpp
@@ -40,7 +40,7 @@
 
   std::error_code EC;
   ResolutionFile = llvm::make_unique<raw_fd_ostream>(
-      OutputFileName + ".resolution.txt", EC, sys::fs::OpenFlags::F_Text);
+      OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::F_Text);
   if (EC)
     return errorCodeToError(EC);
 
@@ -58,9 +58,7 @@
       // user hasn't requested using the input module's path, emit to a file
       // named from the provided OutputFileName with the Task ID appended.
       if (M.getModuleIdentifier() == "ld-temp.o" || !UseInputModulePath) {
-        PathPrefix = OutputFileName;
-        if (Task != 0)
-          PathPrefix += "." + utostr(Task);
+        PathPrefix = OutputFileName + utostr(Task);
       } else
         PathPrefix = M.getModuleIdentifier();
       std::string Path = PathPrefix + "." + PathSuffix + ".bc";
@@ -86,7 +84,7 @@
   setHook("5.precodegen", PreCodeGenModuleHook);
 
   CombinedIndexHook = [=](const ModuleSummaryIndex &Index) {
-    std::string Path = OutputFileName + ".index.bc";
+    std::string Path = OutputFileName + "index.bc";
     std::error_code EC;
     raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None);
     if (EC) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23612.68440.patch
Type: text/x-patch
Size: 2189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160817/d2da8a1c/attachment.bin>


More information about the llvm-commits mailing list