[PATCH] D19269: [gold-plugin] Disable name for values other than GlobalValue

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 10:10:15 PDT 2016


Lgtm, but can you add a test?
On Apr 19, 2016 12:10 PM, "Teresa Johnson" <tejohnson at google.com> wrote:

> tejohnson created this revision.
> tejohnson added reviewers: rafael, joker-eph.
> tejohnson added a subscriber: llvm-commits.
>
> 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.
>
> http://reviews.llvm.org/D19269
>
> Files:
>   tools/gold/gold-plugin.cpp
>
> Index: tools/gold/gold-plugin.cpp
> ===================================================================
> --- tools/gold/gold-plugin.cpp
> +++ tools/gold/gold-plugin.cpp
> @@ -167,8 +167,10 @@
>    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 @@
>          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 @@
>                                 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 @@
>    }
>
>    LLVMContext Context;
> +  Context.setDiscardValueNames(options::DiscardValueNames);
>    Context.enableDebugTypeODRUniquing(); // Merge debug info types.
>    Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr,
> true);
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160419/83b78c38/attachment.html>


More information about the llvm-commits mailing list