summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/AsmParser
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-03-28 18:50:26 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-03-28 18:50:26 +0000
commitbe560a3fb7f5d1901583d84e22b10aadb502b4af (patch)
tree93e813e7d922614ca9aec71e88ea38262800846f /lib/Target/Mips/AsmParser
parent904658f8d43c82cc897b26045e1da4aaa6b735c5 (diff)
downloadllvm-be560a3fb7f5d1901583d84e22b10aadb502b4af.tar.gz
llvm-be560a3fb7f5d1901583d84e22b10aadb502b4af.tar.bz2
llvm-be560a3fb7f5d1901583d84e22b10aadb502b4af.tar.xz
Parse .gpdword and convert another llc -filetype=obj test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/AsmParser')
-rw-r--r--lib/Target/Mips/AsmParser/MipsAsmParser.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 1433b4319c..9ea2522b96 100644
--- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -212,6 +212,7 @@ class MipsAsmParser : public MCTargetAsmParser {
bool parseDataDirective(unsigned Size, SMLoc L);
bool parseDirectiveGpWord();
+ bool parseDirectiveGpdWord();
MCSymbolRefExpr::VariantKind getVariantKind(StringRef Symbol);
@@ -2715,6 +2716,22 @@ bool MipsAsmParser::parseDirectiveGpWord() {
return false;
}
+/// parseDirectiveGpdWord
+/// ::= .gpdword local_sym
+bool MipsAsmParser::parseDirectiveGpdWord() {
+ const MCExpr *Value;
+ // EmitGPRel64Value requires an expression, so we are using base class
+ // method to evaluate the expression.
+ if (getParser().parseExpression(Value))
+ return true;
+ getParser().getStreamer().EmitGPRel64Value(Value);
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return Error(getLexer().getLoc(), "unexpected token in directive");
+ Parser.Lex(); // Eat EndOfStatement token.
+ return false;
+}
+
bool MipsAsmParser::parseDirectiveOption() {
// Get the option token.
AsmToken Tok = Parser.getTok();
@@ -2798,11 +2815,15 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
}
if (IDVal == ".gpword") {
- // Ignore this directive for now.
parseDirectiveGpWord();
return false;
}
+ if (IDVal == ".gpdword") {
+ parseDirectiveGpdWord();
+ return false;
+ }
+
if (IDVal == ".word") {
parseDataDirective(4, DirectiveID.getLoc());
return false;