[llvm] r211804 - Fix the new LTOCodeGenerator setup in gold to parse options before using MAttrs.
Rafael EspĂndola
rafael.espindola at gmail.com
Sun Jun 29 15:45:26 PDT 2014
thanks!
On 26 June 2014 16:43, Tom Roeder <tmroeder at google.com> wrote:
> Author: tmroeder
> Date: Thu Jun 26 15:43:27 2014
> New Revision: 211804
>
> URL: http://llvm.org/viewvc/llvm-project?rev=211804&view=rev
> Log:
> Fix the new LTOCodeGenerator setup in gold to parse options before using MAttrs.
>
> This fixes a regression that made clang -flto -Wl,--plugin-opt=-mattr=+aes not
> pass the "+aes" option to the LTOCodeGenerator attributes.
>
> Modified:
> llvm/trunk/tools/gold/gold-plugin.cpp
>
> Modified: llvm/trunk/tools/gold/gold-plugin.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=211804&r1=211803&r2=211804&view=diff
> ==============================================================================
> --- llvm/trunk/tools/gold/gold-plugin.cpp (original)
> +++ llvm/trunk/tools/gold/gold-plugin.cpp Thu Jun 26 15:43:27 2014
> @@ -234,15 +234,6 @@ ld_plugin_status onload(ld_plugin_tv *tv
> InitializeAllAsmParsers();
> InitializeAllAsmPrinters();
> CodeGen = new LTOCodeGenerator();
> - if (MAttrs.size()) {
> - std::string Attrs;
> - for (unsigned I = 0; I < MAttrs.size(); ++I) {
> - if (I > 0)
> - Attrs.append(",");
> - Attrs.append(MAttrs[I]);
> - }
> - CodeGen->setAttr(Attrs.c_str());
> - }
>
> // Pass through extra options to the code generator.
> if (!options::extra.empty()) {
> @@ -253,6 +244,16 @@ ld_plugin_status onload(ld_plugin_tv *tv
> }
>
> CodeGen->parseCodeGenDebugOptions();
> + if (MAttrs.size()) {
> + std::string Attrs;
> + for (unsigned I = 0; I < MAttrs.size(); ++I) {
> + if (I > 0)
> + Attrs.append(",");
> + Attrs.append(MAttrs[I]);
> + }
> + CodeGen->setAttr(Attrs.c_str());
> + }
> +
> TargetOpts = InitTargetOptionsFromCodeGenFlags();
> CodeGen->setTargetOptions(TargetOpts);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list