[llvm] r267279 - [gold] Gate value name discarding under save-temps

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 22:16:00 PDT 2016


Author: tejohnson
Date: Sat Apr 23 00:15:59 2016
New Revision: 267279

URL: http://llvm.org/viewvc/llvm-project?rev=267279&view=rev
Log:
[gold] Gate value name discarding under save-temps

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

Reviewers: rafael

Subscribers: llvm-commits, pcc, davide

Differential Revision: http://reviews.llvm.org/D19384

Modified:
    llvm/trunk/test/tools/gold/X86/comdat.ll
    llvm/trunk/test/tools/gold/X86/strip_names.ll
    llvm/trunk/test/tools/gold/X86/type-merge2.ll
    llvm/trunk/tools/gold/gold-plugin.cpp

Modified: llvm/trunk/test/tools/gold/X86/comdat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/comdat.ll?rev=267279&r1=267278&r2=267279&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/comdat.ll (original)
+++ llvm/trunk/test/tools/gold/X86/comdat.ll Sat Apr 23 00:15:59 2016
@@ -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
 

Modified: llvm/trunk/test/tools/gold/X86/strip_names.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/strip_names.ll?rev=267279&r1=267278&r2=267279&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/strip_names.ll (original)
+++ llvm/trunk/test/tools/gold/X86/strip_names.ll Sat Apr 23 00:15:59 2016
@@ -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
 

Modified: llvm/trunk/test/tools/gold/X86/type-merge2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/type-merge2.ll?rev=267279&r1=267278&r2=267279&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/type-merge2.ll (original)
+++ llvm/trunk/test/tools/gold/X86/type-merge2.ll Sat Apr 23 00:15:59 2016
@@ -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()  {

Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=267279&r1=267278&r2=267279&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Sat Apr 23 00:15:59 2016
@@ -166,10 +166,8 @@ namespace options {
   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 @@ namespace options {
         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 @@ static void thinLTOBackendTask(claimed_f
                                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 @@ static ld_plugin_status allSymbolsReadHo
   }
 
   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);
 




More information about the llvm-commits mailing list