[PATCH] D20423: Passing LLVM arguments to gold plugin

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 06:01:49 PDT 2016


Please add llvm-commits as a subscriber for all patches, so that the patch
and review gets posted to the mailing list. I've cc'ed llvm-commits here,
which might be enough to get llvm-commits added.

On Thu, May 19, 2016 at 5:04 AM, Bhargav Reddy Godala <
Bhargav-reddy.Godala at amd.com> wrote:

> bunty2020 created this revision.
> bunty2020 added a reviewer: tejohnson.
>
> Currently CLANG does not pass LLVM options to gold plugin.
> Ex: -mllvm <some-option> is not passed on to gold plugin.
> This patch enables passing LLVM arguments to gold plugin
>
> http://reviews.llvm.org/D20423
>
> Files:
>   lib/Driver/Tools.cpp
>
> Index: lib/Driver/Tools.cpp
> ===================================================================
> --- lib/Driver/Tools.cpp
> +++ lib/Driver/Tools.cpp
> @@ -8366,6 +8366,12 @@
>    if (D.isUsingLTO())
>      AddGoldPlugin(ToolChain, Args, CmdArgs, D.getLTOMode() == LTOK_Thin);
>
> +  if (D.isUsingLTO()) {
> +    for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
> +        CmdArgs.push_back(Args.MakeArgString("-plugin-opt=" +
> StringRef(A->getValue(0))));
> +    }
> +  }
> +
>    bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args,
> CmdArgs);
>    AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
>
> @@ -9261,6 +9267,12 @@
>    if (D.isUsingLTO())
>      AddGoldPlugin(ToolChain, Args, CmdArgs, D.getLTOMode() == LTOK_Thin);
>
> +  if (D.isUsingLTO()) {
> +    for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
> +        CmdArgs.push_back(Args.MakeArgString("-plugin-opt=" +
> StringRef(A->getValue(0))));
> +    }
> +  }
> +
>    if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle))
>      CmdArgs.push_back("--no-demangle");
>
>
>
>


-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160519/391f585b/attachment.html>


More information about the llvm-commits mailing list