diff options
author | Toma Tabacu <toma.tabacu@imgtec.com> | 2015-04-16 09:53:47 +0000 |
---|---|---|
committer | Toma Tabacu <toma.tabacu@imgtec.com> | 2015-04-16 09:53:47 +0000 |
commit | 9ca5096f59b50ec6125fc25654def5af3da44607 (patch) | |
tree | 828cf3863b5a37856f409f7152ecf8344dd16ec3 /llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | |
parent | 3a6a2e58d5d3710b24dcf733fafea7b9861a67f1 (diff) | |
download | bcm5719-llvm-9ca5096f59b50ec6125fc25654def5af3da44607.tar.gz bcm5719-llvm-9ca5096f59b50ec6125fc25654def5af3da44607.zip |
[mips] [IAS] Add support for the .insn directive.
Summary:
This assembler directive marks the current label as an instruction label in microMIPS and MIPS16.
This initial implementation works only for microMIPS.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8006
llvm-svn: 235084
Diffstat (limited to 'llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 6086e9f8bb8..6f7e3c16a9b 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -220,6 +220,7 @@ class MipsAsmParser : public MCTargetAsmParser { bool parseDirectiveNaN(); bool parseDirectiveSet(); bool parseDirectiveOption(); + bool parseInsnDirective(); bool parseSetAtDirective(); bool parseSetNoAtDirective(); @@ -4045,6 +4046,23 @@ bool MipsAsmParser::parseDirectiveOption() { return false; } +/// parseInsnDirective +/// ::= .insn +bool MipsAsmParser::parseInsnDirective() { + // If this is not the end of the statement, report an error. + if (getLexer().isNot(AsmToken::EndOfStatement)) { + reportParseError("unexpected token, expected end of statement"); + return false; + } + + // The actual label marking happens in + // MipsELFStreamer::createPendingLabelRelocs(). + getTargetStreamer().emitDirectiveInsn(); + + getParser().Lex(); // Eat EndOfStatement token. + return false; +} + /// parseDirectiveModule /// ::= .module oddspreg /// ::= .module nooddspreg @@ -4438,6 +4456,9 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) { if (IDVal == ".llvm_internal_mips_reallow_module_directive") return parseInternalDirectiveReallowModule(); + if (IDVal == ".insn") + return parseInsnDirective(); + return true; } |