[PATCH] D19384: [gold] Gate value name discarding under save-temps

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 12:31:00 PDT 2016


tejohnson created this revision.
tejohnson added a reviewer: rafael.
tejohnson added subscribers: davide, pcc, llvm-commits.

This removes a couple of flags added to control this behavior, and
simply keeps all value names when save-temps is specified.

http://reviews.llvm.org/D19384

Files:
  test/tools/gold/X86/comdat.ll
  test/tools/gold/X86/strip_names.ll
  test/tools/gold/X86/type-merge2.ll
  tools/gold/gold-plugin.cpp

Index: tools/gold/gold-plugin.cpp
===================================================================
--- tools/gold/gold-plugin.cpp
+++ tools/gold/gold-plugin.cpp
@@ -166,10 +166,8 @@
   static unsigned Parallelism = 0;
 #ifdef NDEBUG
   static bool DisableVerify = true;
-  static bool DiscardValueNames = true;
 #else
   static bool DisableVerify = false;
-  static bool DiscardValueNames = false;
 #endif
   static std::string obj_path;
   static std::string extra_library_path;
@@ -226,10 +224,6 @@
         message(LDPL_FATAL, "Invalid parallelism level: %s", opt_ + 5);
     } else if (opt == "disable-verify") {
       DisableVerify = true;
-    } else if (opt == "discard-value-names") {
-      DiscardValueNames = true;
-    } else if (opt == "no-discard-value-names") {
-      DiscardValueNames = false;
     } else {
       // Save this option to pass to the code generator.
       // ParseCommandLineOptions() expects argv[0] to be program name. Lazily
@@ -1119,7 +1113,8 @@
                                raw_fd_ostream *OS, unsigned TaskID) {
   // Need to use a separate context for each task
   LLVMContext Context;
-  Context.setDiscardValueNames(options::DiscardValueNames);
+  Context.setDiscardValueNames(options::TheOutputType !=
+                               options::OT_SAVE_TEMPS);
   Context.enableDebugTypeODRUniquing(); // Merge debug info types.
   Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true);
 
@@ -1242,7 +1237,8 @@
   }
 
   LLVMContext Context;
-  Context.setDiscardValueNames(options::DiscardValueNames);
+  Context.setDiscardValueNames(options::TheOutputType !=
+                               options::OT_SAVE_TEMPS);
   Context.enableDebugTypeODRUniquing(); // Merge debug info types.
   Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true);
 
Index: test/tools/gold/X86/type-merge2.ll
===================================================================
--- test/tools/gold/X86/type-merge2.ll
+++ test/tools/gold/X86/type-merge2.ll
@@ -1,10 +1,9 @@
 ; RUN: llvm-as %s -o %t.o
 ; RUN: llvm-as %p/Inputs/type-merge2.ll -o %t2.o
 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
-; RUN:    --plugin-opt=emit-llvm \
-; RUN:    --plugin-opt=no-discard-value-names \
+; RUN:    --plugin-opt=save-temps \
 ; RUN:    -shared %t.o %t2.o -o %t3.o
-; RUN: llvm-dis %t3.o -o - | FileCheck %s
+; RUN: llvm-dis %t3.o.bc -o - | FileCheck %s
 
 %zed = type { i8 }
 define void @foo()  {
Index: test/tools/gold/X86/strip_names.ll
===================================================================
--- test/tools/gold/X86/strip_names.ll
+++ test/tools/gold/X86/strip_names.ll
@@ -1,14 +1,12 @@
 ; RUN: llvm-as %s -o %t.o
 
 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
-; RUN:    --plugin-opt=emit-llvm \
-; RUN:    --plugin-opt=no-discard-value-names \
+; RUN:    --plugin-opt=save-temps \
 ; RUN:    -shared %t.o -o %t2.o
-; RUN: llvm-dis %t2.o -o - | FileCheck %s
+; RUN: llvm-dis %t2.o.bc -o - | FileCheck %s
 
 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
 ; RUN:    --plugin-opt=emit-llvm \
-; RUN:    --plugin-opt=discard-value-names \
 ; RUN:    -shared %t.o -o %t2.o
 ; RUN: llvm-dis %t2.o -o - | FileCheck ---check-prefix=NONAME %s
 
Index: test/tools/gold/X86/comdat.ll
===================================================================
--- test/tools/gold/X86/comdat.ll
+++ test/tools/gold/X86/comdat.ll
@@ -1,9 +1,8 @@
 ; RUN: llvm-as %s -o %t.o
 ; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o
 ; RUN: %gold -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold.so %t.o %t2.o \
-; RUN:  -plugin-opt=no-discard-value-names \
-; RUN:  -plugin-opt=emit-llvm
-; RUN: llvm-dis %t3.o -o - | FileCheck %s
+; RUN:  -plugin-opt=save-temps
+; RUN: llvm-dis %t3.o.bc -o - | FileCheck %s
 
 $c1 = comdat any
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19384.54563.patch
Type: text/x-patch
Size: 3783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160421/59287252/attachment.bin>


More information about the llvm-commits mailing list