diff options
author | Simon Dardis <simon.dardis@imgtec.com> | 2017-02-01 18:50:24 +0000 |
---|---|---|
committer | Simon Dardis <simon.dardis@imgtec.com> | 2017-02-01 18:50:24 +0000 |
commit | ac9c30c37fcbd5f5d23e976e42e28375d28356dd (patch) | |
tree | 37a8357c666e8267f109ec632e7ebdcadcb5ae99 /llvm/lib | |
parent | d50c01308e670a9a4feaa5b419dedc8e5dcf7cb5 (diff) | |
download | bcm5719-llvm-ac9c30c37fcbd5f5d23e976e42e28375d28356dd.tar.gz bcm5719-llvm-ac9c30c37fcbd5f5d23e976e42e28375d28356dd.zip |
[mips] Parse the 'bopt' and 'nobopt' directives in IAS.
The GAS assembler supports the ".set bopt" directive but according
to the sources it doesn't do anything. It's supposed to optimize
branches by filling the delay slot of a branch with it's target.
This patch teaches the MIPS asm parser to accept both and warn in
the case of 'bopt' that the bopt directive is unsupported.
This resolves PR/31841.
Thanks to Sean Bruno for reporting the issue!
llvm-svn: 293798
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 504a4983036..015e6adad5c 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -6030,6 +6030,14 @@ bool MipsAsmParser::parseDirectiveSet() { return parseSetAtDirective(); } else if (Tok.getString() == "arch") { return parseSetArchDirective(); + } else if (Tok.getString() == "bopt") { + Warning(Tok.getLoc(), "'bopt' feature is unsupported"); + getParser().Lex(); + return false; + } else if (Tok.getString() == "nobopt") { + // We're already running in nobopt mode, so nothing to do. + getParser().Lex(); + return false; } else if (Tok.getString() == "fp") { return parseSetFpDirective(); } else if (Tok.getString() == "oddspreg") { |