mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211804 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -234,15 +234,6 @@ ld_plugin_status onload(ld_plugin_tv *tv) {
|
|||||||
InitializeAllAsmParsers();
|
InitializeAllAsmParsers();
|
||||||
InitializeAllAsmPrinters();
|
InitializeAllAsmPrinters();
|
||||||
CodeGen = new LTOCodeGenerator();
|
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.
|
// Pass through extra options to the code generator.
|
||||||
if (!options::extra.empty()) {
|
if (!options::extra.empty()) {
|
||||||
@ -253,6 +244,16 @@ ld_plugin_status onload(ld_plugin_tv *tv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CodeGen->parseCodeGenDebugOptions();
|
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();
|
TargetOpts = InitTargetOptionsFromCodeGenFlags();
|
||||||
CodeGen->setTargetOptions(TargetOpts);
|
CodeGen->setTargetOptions(TargetOpts);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user