[llvm] r225167 - Parse Tag_compatibility correctly.
Charlie Turner
charlie.turner at arm.com
Mon Jan 5 05:26:37 PST 2015
Author: chatur01
Date: Mon Jan 5 07:26:37 2015
New Revision: 225167
URL: http://llvm.org/viewvc/llvm-project?rev=225167&view=rev
Log:
Parse Tag_compatibility correctly.
Tag_compatibility takes two arguments, but before this patch it would
erroneously accept just one, it now produces an error in that case.
Change-Id: I530f918587620d0d5dfebf639944d6083871ef7d
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/test/MC/ARM/directive-eabi_attribute-diagnostics.s
llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s
llvm/trunk/test/MC/ARM/directive-eabi_attribute.s
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=225167&r1=225166&r2=225167&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Mon Jan 5 07:26:37 2015
@@ -9130,8 +9130,13 @@ bool ARMAsmParser::parseDirectiveEabiAtt
if (Tag == ARMBuildAttrs::compatibility) {
if (Parser.getTok().isNot(AsmToken::Comma))
IsStringValue = false;
- else
- Parser.Lex();
+ if (Parser.getTok().isNot(AsmToken::Comma)) {
+ Error(Parser.getTok().getLoc(), "comma expected");
+ Parser.eatToEndOfStatement();
+ return false;
+ } else {
+ Parser.Lex();
+ }
}
if (IsStringValue) {
Modified: llvm/trunk/test/MC/ARM/directive-eabi_attribute-diagnostics.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/directive-eabi_attribute-diagnostics.s?rev=225167&r1=225166&r2=225167&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/directive-eabi_attribute-diagnostics.s (original)
+++ llvm/trunk/test/MC/ARM/directive-eabi_attribute-diagnostics.s Mon Jan 5 07:26:37 2015
@@ -29,6 +29,11 @@
@ CHECK: .eabi_attribute 0
@ CHECK: ^
+ .eabi_attribute Tag_compatibility, 1
+@ CHECK: error: comma expected
+@ CHECK: .eabi_attribute Tag_compatibility, 1
+@ CHECK: ^
+
.eabi_attribute Tag_MPextension_use_old, 0
@ CHECK: error: attribute name not recognised: Tag_MPextension_use_old
@ CHECK: .eabi_attribute Tag_MPextension_use_old, 0
Modified: llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s?rev=225167&r1=225166&r2=225167&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s (original)
+++ llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s Mon Jan 5 07:26:37 2015
@@ -3,8 +3,6 @@
.syntax unified
.thumb
-@ FIXME: The next directive is not correct, Tag_compatibility isn't getting parsed correctly.
- .eabi_attribute Tag_compatibility, 1
.eabi_attribute Tag_compatibility, 1, "aeabi"
@ CHECK-ATTR: FileAttributes {
Modified: llvm/trunk/test/MC/ARM/directive-eabi_attribute.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/directive-eabi_attribute.s?rev=225167&r1=225166&r2=225167&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/directive-eabi_attribute.s (original)
+++ llvm/trunk/test/MC/ARM/directive-eabi_attribute.s Mon Jan 5 07:26:37 2015
@@ -173,8 +173,6 @@
@ CHECK-OBJ-NEXT: Value: 1
@ CHECK-OBJ-NEXT: TagName: ABI_FP_optimization_goals
@ CHECK-OBJ-NEXT: Description: Speed
- .eabi_attribute Tag_compatibility, 1
-@ CHECK: .eabi_attribute 32, 1
.eabi_attribute Tag_compatibility, 1, "aeabi"
@ CHECK: .eabi_attribute 32, 1, "aeabi"
@ CHECK-OBJ: Tag: 32
More information about the llvm-commits
mailing list