[llvm] r194570 - Fix bug in .gpword directive parsing.
Vladimir Medic
Vladimir.Medic at imgtec.com
Wed Nov 13 05:18:04 PST 2013
Author: vmedic
Date: Wed Nov 13 07:18:04 2013
New Revision: 194570
URL: http://llvm.org/viewvc/llvm-project?rev=194570&view=rev
Log:
Fix bug in .gpword directive parsing.
Modified:
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/trunk/test/MC/Mips/mips_directives.s
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=194570&r1=194569&r2=194570&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Wed Nov 13 07:18:04 2013
@@ -2379,13 +2379,11 @@ bool MipsAsmParser::parseDirectiveGpWord
// method to evaluate the expression.
if (getParser().parseExpression(Value))
return true;
-
getParser().getStreamer().EmitGPRel32Value(Value);
- Parser.Lex(); // Eat last token.
- if (getLexer().is(AsmToken::EndOfStatement))
+ if (getLexer().isNot(AsmToken::EndOfStatement))
return Error(getLexer().getLoc(), "unexpected token in directive");
-
+ Parser.Lex(); // Eat EndOfStatement token.
return false;
}
Modified: llvm/trunk/test/MC/Mips/mips_directives.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_directives.s?rev=194570&r1=194569&r2=194570&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips_directives.s (original)
+++ llvm/trunk/test/MC/Mips/mips_directives.s Wed Nov 13 07:18:04 2013
@@ -19,10 +19,11 @@ $BB0_2:
.set noat
$JTI0_0:
.gpword ($BB0_2)
+
.word 0x77fffffc
# CHECK: $JTI0_0:
# CHECK: .gpword ($BB0_2)
-# CHECK-NEXT: .4byte 2013265916
+# CHECK: .4byte 2013265916
.set at=$12
.set macro
# CHECK: b 1332 # encoding: [0x10,0x00,0x01,0x4d]
More information about the llvm-commits
mailing list