summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-04-20 13:01:37 +0000
committerTeresa Johnson <tejohnson@google.com>2016-04-20 13:01:37 +0000
commitd3ded4a4413997c6fb7c6461e37a1bf327b4a78e (patch)
treeda116d53fe32758aa97090572ae03d4cc40a5523 /llvm/tools
parent6b2362619284d0e68b6d7a8ab93dc397c35a6ba0 (diff)
downloadbcm5719-llvm-d3ded4a4413997c6fb7c6461e37a1bf327b4a78e.tar.gz
bcm5719-llvm-d3ded4a4413997c6fb7c6461e37a1bf327b4a78e.zip
[gold-plugin] Disable name for values other than GlobalValue
Summary: Applies Mehdi's optimization (r263086) to disable value names other than for GlobalValues to LTO/ThinLTO performed via the gold-plugin, in the same manner as it is applied in libLTO. Reviewers: rafael, joker-eph Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19269 llvm-svn: 266871
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/gold/gold-plugin.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index 1c78d2fc745..d32ad76eb2d 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -167,8 +167,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;
@@ -225,6 +227,8 @@ 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 {
// Save this option to pass to the code generator.
// ParseCommandLineOptions() expects argv[0] to be program name. Lazily
@@ -1114,6 +1118,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);
@@ -1236,6 +1241,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);
OpenPOWER on IntegriCloud