[PATCH] D50803: [gold-plugin] Add "obj-files" option

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 15 13:23:58 PDT 2018


void created this revision.
void added a reviewer: pcc.
Herald added subscribers: llvm-commits, dexonsmith, mehdi_amini.

Add the option "obj-files" that will print out the intermediate object files during ThinLTO. This is similar to "save-temps", but doesn't output intermediate bitcode files.


Repository:
  rL LLVM

https://reviews.llvm.org/D50803

Files:
  tools/gold/gold-plugin.cpp


Index: tools/gold/gold-plugin.cpp
===================================================================
--- tools/gold/gold-plugin.cpp
+++ tools/gold/gold-plugin.cpp
@@ -128,7 +128,8 @@
     OT_NORMAL,
     OT_DISABLE,
     OT_BC_ONLY,
-    OT_SAVE_TEMPS
+    OT_SAVE_TEMPS,
+    OT_OBJ_FILES
   };
   static OutputType TheOutputType = OT_NORMAL;
   static unsigned OptLevel = 2;
@@ -227,6 +228,8 @@
       TheOutputType = OT_BC_ONLY;
     } else if (opt == "save-temps") {
       TheOutputType = OT_SAVE_TEMPS;
+    } else if (opt == "obj-files") {
+      TheOutputType = OT_OBJ_FILES;
     } else if (opt == "disable-output") {
       TheOutputType = OT_DISABLE;
     } else if (opt == "thinlto") {
@@ -863,6 +866,7 @@
 
   switch (options::TheOutputType) {
   case options::OT_NORMAL:
+  case options::OT_OBJ_FILES:
     break;
 
   case options::OT_DISABLE:
@@ -1009,7 +1013,8 @@
   // Note that getOutputFileName will append a unique ID for each task
   if (!options::obj_path.empty())
     Filename = options::obj_path;
-  else if (options::TheOutputType == options::OT_SAVE_TEMPS)
+  else if (options::TheOutputType == options::OT_SAVE_TEMPS ||
+           options::TheOutputType == options::OT_OBJ_FILES)
     Filename = output_name + ".o";
   bool SaveTemps = !Filename.empty();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50803.160908.patch
Type: text/x-patch
Size: 1288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180815/47a075ef/attachment.bin>


More information about the llvm-commits mailing list