mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-01 13:20:25 +00:00
[Asm] Don't list '@<type>' in diag when '@' is a comment
This fixes https://bugs.llvm.org//show_bug.cgi?id=31280 Differential revision: https://reviews.llvm.org/D31026 llvm-svn: 298067
This commit is contained in:
parent
b7f0f45ffe
commit
8761e9bb43
@ -391,8 +391,12 @@ bool ELFAsmParser::maybeParseSectionType(StringRef &TypeName) {
|
|||||||
return false;
|
return false;
|
||||||
Lex();
|
Lex();
|
||||||
if (L.isNot(AsmToken::At) && L.isNot(AsmToken::Percent) &&
|
if (L.isNot(AsmToken::At) && L.isNot(AsmToken::Percent) &&
|
||||||
L.isNot(AsmToken::String))
|
L.isNot(AsmToken::String)) {
|
||||||
return TokError("expected '@<type>', '%<type>' or \"<type>\"");
|
if (L.getAllowAtInIdentifier())
|
||||||
|
return TokError("expected '@<type>', '%<type>' or \"<type>\"");
|
||||||
|
else
|
||||||
|
return TokError("expected '%<type>' or \"<type>\"");
|
||||||
|
}
|
||||||
if (!L.is(AsmToken::String))
|
if (!L.is(AsmToken::String))
|
||||||
Lex();
|
Lex();
|
||||||
if (L.is(AsmToken::Integer)) {
|
if (L.is(AsmToken::Integer)) {
|
||||||
|
@ -7,3 +7,7 @@
|
|||||||
// CHECK: .type TYPE #32
|
// CHECK: .type TYPE #32
|
||||||
// CHECK: ^
|
// CHECK: ^
|
||||||
|
|
||||||
|
// For ARM, the comment character is '@', so we don't list '@<type>' as a
|
||||||
|
// valid option.
|
||||||
|
.section "foo", "a", @progbits
|
||||||
|
// CHECK: error: expected '%<type>' or "<type>"
|
||||||
|
Loading…
Reference in New Issue
Block a user