diff options
| author | Jack Carter <jack.carter@imgtec.com> | 2014-01-22 23:08:42 +0000 |
|---|---|---|
| committer | Jack Carter <jack.carter@imgtec.com> | 2014-01-22 23:08:42 +0000 |
| commit | 39536724a7332857a1b8ba8afd9da6a252e9f4e8 (patch) | |
| tree | 2a485c075bcdafe2113b3d98ce672bd908f72d18 /llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | |
| parent | 8c7bd6ac1a32e667d3f57682d6c0f3e4e6c7a97f (diff) | |
| download | bcm5719-llvm-39536724a7332857a1b8ba8afd9da6a252e9f4e8.tar.gz bcm5719-llvm-39536724a7332857a1b8ba8afd9da6a252e9f4e8.zip | |
[Mips] TargetStreamer Support for .set mips16.
This patch updates .set mips16 support which
affects the ELF ABI and its flags. In addition the patch uses
a common interface for both the MipsTargetSteamer and
MipsObjectStreamer that the assembler uses for
both ELF and ASCII output for these directives.
llvm-svn: 199851
Diffstat (limited to 'llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp')
| -rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 31ece464bba..d63f88f3ed8 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -203,6 +203,8 @@ class MipsAsmParser : public MCTargetAsmParser { bool parseSetNoMacroDirective(); bool parseSetReorderDirective(); bool parseSetNoReorderDirective(); + bool parseSetMips16Directive(); + bool parseSetNoMips16Directive(); bool parseSetAssignment(); @@ -2341,6 +2343,30 @@ bool MipsAsmParser::parseSetNoMacroDirective() { return false; } +bool MipsAsmParser::parseSetMips16Directive() { + Parser.Lex(); + // If this is not the end of the statement, report an error. + if (getLexer().isNot(AsmToken::EndOfStatement)) { + reportParseError("unexpected token in statement"); + return false; + } + getTargetStreamer().emitDirectiveSetMips16(true); + Parser.Lex(); // Consume the EndOfStatement. + return false; +} + +bool MipsAsmParser::parseSetNoMips16Directive() { + Parser.Lex(); + // If this is not the end of the statement, report an error. + if (getLexer().isNot(AsmToken::EndOfStatement)) { + reportParseError("unexpected token in statement"); + return false; + } + // For now do nothing. + Parser.Lex(); // Consume the EndOfStatement. + return false; +} + bool MipsAsmParser::parseSetAssignment() { StringRef Name; const MCExpr *Value; @@ -2382,10 +2408,10 @@ bool MipsAsmParser::parseDirectiveSet() { return parseSetMacroDirective(); } else if (Tok.getString() == "nomacro") { return parseSetNoMacroDirective(); + } else if (Tok.getString() == "mips16") { + return parseSetMips16Directive(); } else if (Tok.getString() == "nomips16") { - // Ignore this directive for now. - Parser.eatToEndOfStatement(); - return false; + return parseSetNoMips16Directive(); } else if (Tok.getString() == "nomicromips") { getTargetStreamer().emitDirectiveSetNoMicroMips(); Parser.eatToEndOfStatement(); |

