summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
diff options
context:
space:
mode:
authorToma Tabacu <toma.tabacu@imgtec.com>2015-03-06 12:15:12 +0000
committerToma Tabacu <toma.tabacu@imgtec.com>2015-03-06 12:15:12 +0000
commit4e0cf8e21148ab9cb0dc22d5d00152c40f86af07 (patch)
tree29b72fc3f9c6e94bffb641c3ddc56d76e36b8c5d /llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
parent98f8ae34da229b16a59953731651c0b37933b74c (diff)
downloadbcm5719-llvm-4e0cf8e21148ab9cb0dc22d5d00152c40f86af07.tar.gz
bcm5719-llvm-4e0cf8e21148ab9cb0dc22d5d00152c40f86af07.zip
[mips] [IAS] Add missing constraints and improve testing for the .module directive.
Summary: None of the .set directives can be used before the .module directives. The .set mips0/pop/push were not triggering this constraint. Also added testing for all the other implemented directives which are supposed to trigger this constraint. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7140 llvm-svn: 231465
Diffstat (limited to 'llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp')
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index f58ed565627..51de707d949 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -236,6 +236,8 @@ class MipsAsmParser : public MCTargetAsmParser {
bool parseFpABIValue(MipsABIFlagsSection::FpABIKind &FpABI,
StringRef Directive);
+ bool parseInternalDirectiveReallowModule();
+
MCSymbolRefExpr::VariantKind getVariantKind(StringRef Symbol);
bool eatComma(StringRef ErrorStr);
@@ -4429,9 +4431,25 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
if (IDVal == ".module")
return parseDirectiveModule();
+ if (IDVal == ".llvm_internal_mips_reallow_module_directive")
+ return parseInternalDirectiveReallowModule();
+
return true;
}
+bool MipsAsmParser::parseInternalDirectiveReallowModule() {
+ // 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;
+ }
+
+ getTargetStreamer().reallowModuleDirective();
+
+ getParser().Lex(); // Eat EndOfStatement token.
+ return false;
+}
+
extern "C" void LLVMInitializeMipsAsmParser() {
RegisterMCAsmParser<MipsAsmParser> X(TheMipsTarget);
RegisterMCAsmParser<MipsAsmParser> Y(TheMipselTarget);
OpenPOWER on IntegriCloud