Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit a51154f

Browse files
committed
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267279 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 29fa04d commit a51154f

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

test/tools/gold/X86/comdat.ll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
; RUN: llvm-as %s -o %t.o
22
; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o
33
; RUN: %gold -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold.so %t.o %t2.o \
4-
; RUN: -plugin-opt=no-discard-value-names \
5-
; RUN: -plugin-opt=emit-llvm
6-
; RUN: llvm-dis %t3.o -o - | FileCheck %s
4+
; RUN: -plugin-opt=save-temps
5+
; RUN: llvm-dis %t3.o.bc -o - | FileCheck %s
76

87
$c1 = comdat any
98

test/tools/gold/X86/strip_names.ll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
; RUN: llvm-as %s -o %t.o
22

33
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
4-
; RUN: --plugin-opt=emit-llvm \
5-
; RUN: --plugin-opt=no-discard-value-names \
4+
; RUN: --plugin-opt=save-temps \
65
; RUN: -shared %t.o -o %t2.o
7-
; RUN: llvm-dis %t2.o -o - | FileCheck %s
6+
; RUN: llvm-dis %t2.o.bc -o - | FileCheck %s
87

98
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
109
; RUN: --plugin-opt=emit-llvm \
11-
; RUN: --plugin-opt=discard-value-names \
1210
; RUN: -shared %t.o -o %t2.o
1311
; RUN: llvm-dis %t2.o -o - | FileCheck ---check-prefix=NONAME %s
1412

test/tools/gold/X86/type-merge2.ll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
; RUN: llvm-as %s -o %t.o
22
; RUN: llvm-as %p/Inputs/type-merge2.ll -o %t2.o
33
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
4-
; RUN: --plugin-opt=emit-llvm \
5-
; RUN: --plugin-opt=no-discard-value-names \
4+
; RUN: --plugin-opt=save-temps \
65
; RUN: -shared %t.o %t2.o -o %t3.o
7-
; RUN: llvm-dis %t3.o -o - | FileCheck %s
6+
; RUN: llvm-dis %t3.o.bc -o - | FileCheck %s
87

98
%zed = type { i8 }
109
define void @foo() {

tools/gold/gold-plugin.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,8 @@ namespace options {
166166
static unsigned Parallelism = 0;
167167
#ifdef NDEBUG
168168
static bool DisableVerify = true;
169-
static bool DiscardValueNames = true;
170169
#else
171170
static bool DisableVerify = false;
172-
static bool DiscardValueNames = false;
173171
#endif
174172
static std::string obj_path;
175173
static std::string extra_library_path;
@@ -226,10 +224,6 @@ namespace options {
226224
message(LDPL_FATAL, "Invalid parallelism level: %s", opt_ + 5);
227225
} else if (opt == "disable-verify") {
228226
DisableVerify = true;
229-
} else if (opt == "discard-value-names") {
230-
DiscardValueNames = true;
231-
} else if (opt == "no-discard-value-names") {
232-
DiscardValueNames = false;
233227
} else {
234228
// Save this option to pass to the code generator.
235229
// ParseCommandLineOptions() expects argv[0] to be program name. Lazily
@@ -1119,7 +1113,8 @@ static void thinLTOBackendTask(claimed_file &F, const void *View,
11191113
raw_fd_ostream *OS, unsigned TaskID) {
11201114
// Need to use a separate context for each task
11211115
LLVMContext Context;
1122-
Context.setDiscardValueNames(options::DiscardValueNames);
1116+
Context.setDiscardValueNames(options::TheOutputType !=
1117+
options::OT_SAVE_TEMPS);
11231118
Context.enableDebugTypeODRUniquing(); // Merge debug info types.
11241119
Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true);
11251120

@@ -1242,7 +1237,8 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) {
12421237
}
12431238

12441239
LLVMContext Context;
1245-
Context.setDiscardValueNames(options::DiscardValueNames);
1240+
Context.setDiscardValueNames(options::TheOutputType !=
1241+
options::OT_SAVE_TEMPS);
12461242
Context.enableDebugTypeODRUniquing(); // Merge debug info types.
12471243
Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true);
12481244

0 commit comments

Comments
 (0)