diff options
| author | Teresa Johnson <tejohnson@google.com> | 2016-04-20 15:16:57 +0000 |
|---|---|---|
| committer | Teresa Johnson <tejohnson@google.com> | 2016-04-20 15:16:57 +0000 |
| commit | 143d15bc29bdd913c9bfa92123738bcd141013b9 (patch) | |
| tree | 8df6e1bbd57060a95ece454c749246c411747629 /llvm/tools | |
| parent | 2081dbcc7a9839066ac2e6c914decfaf82427bcb (diff) | |
| download | bcm5719-llvm-143d15bc29bdd913c9bfa92123738bcd141013b9.tar.gz bcm5719-llvm-143d15bc29bdd913c9bfa92123738bcd141013b9.zip | |
Re-enable "[gold-plugin] Disable name for values other than GlobalValue"
This restores r266871 with a fix for gold tests relying on the value
names, when using a release compiler, by adding a way to disable the
default discarding. Update affected tests to use the new mechanism so
that value names are preserved as expected, regardless of how the
compiler was built.
llvm-svn: 266881
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 42e93b1c58f..46a5f4668b1 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -166,8 +166,10 @@ 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; @@ -224,6 +226,10 @@ 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 @@ -1113,6 +1119,7 @@ static void thinLTOBackendTask(claimed_file &F, const void *View, raw_fd_ostream *OS, unsigned TaskID) { // Need to use a separate context for each task LLVMContext Context; + Context.setDiscardValueNames(options::DiscardValueNames); Context.enableDebugTypeODRUniquing(); // Merge debug info types. Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true); @@ -1235,6 +1242,7 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) { } LLVMContext Context; + Context.setDiscardValueNames(options::DiscardValueNames); Context.enableDebugTypeODRUniquing(); // Merge debug info types. Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true); |

