summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2019-04-04 09:11:17 +0000
committerSander de Smalen <sander.desmalen@arm.com>2019-04-04 09:11:17 +0000
commit772e4734d9d6733b60adfbe1e62ac7f1ab2db849 (patch)
tree865a5fd456aa85115ac3b1bf75b32747817216b8 /llvm/lib
parent734a2bc7378482fc5dc593be2021c9ea9e3196f6 (diff)
downloadbcm5719-llvm-772e4734d9d6733b60adfbe1e62ac7f1ab2db849.tar.gz
bcm5719-llvm-772e4734d9d6733b60adfbe1e62ac7f1ab2db849.zip
[AArch64][AsmParser] Fix .arch_extension directive parsing
This patch fixes .arch_extension directive parsing to handle a wider range of architecture extension options. The existing parser was parsing extensions as an identifier which breaks for extensions containing a "-", such as the "tlb-rmi" extension. The extension is now parsed as a string. This is consistent with the extension parsing in the .arch and .cpu directive parsing. Patch by Cullen Rhodes (c-rhodes) Reviewed By: SjoerdMeijer Differential Revision: https://reviews.llvm.org/D60118 llvm-svn: 357677
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index 7c3cdb1423e..37d4c9a3f8a 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -5153,15 +5153,9 @@ bool AArch64AsmParser::parseDirectiveArch(SMLoc L) {
/// parseDirectiveArchExtension
/// ::= .arch_extension [no]feature
bool AArch64AsmParser::parseDirectiveArchExtension(SMLoc L) {
- MCAsmParser &Parser = getParser();
-
- if (getLexer().isNot(AsmToken::Identifier))
- return Error(getLexer().getLoc(), "expected architecture extension name");
+ SMLoc ExtLoc = getLoc();
- const AsmToken &Tok = Parser.getTok();
- StringRef Name = Tok.getString();
- SMLoc ExtLoc = Tok.getLoc();
- Lex();
+ StringRef Name = getParser().parseStringToEndOfStatement().trim();
if (parseToken(AsmToken::EndOfStatement,
"unexpected token in '.arch_extension' directive"))
OpenPOWER on IntegriCloud