aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCParser/ELFAsmParser.cpp
diff options
context:
space:
mode:
authorDavid Peixotto <dpeixott@codeaurora.org>2014-01-15 22:40:02 +0000
committerDavid Peixotto <dpeixott@codeaurora.org>2014-01-15 22:40:02 +0000
commitc0f92a2dc9ea2f10480f35096e6af0fac897e0d1 (patch)
tree6f1128526548c5c6a4b57926cf3fc29a25e14105 /llvm/lib/MC/MCParser/ELFAsmParser.cpp
parent5fa1f6f57ab71e3e590626ec8d714ba4167fba2d (diff)
downloadllvm-c0f92a2dc9ea2f10480f35096e6af0fac897e0d1.zip
llvm-c0f92a2dc9ea2f10480f35096e6af0fac897e0d1.tar.gz
llvm-c0f92a2dc9ea2f10480f35096e6af0fac897e0d1.tar.bz2
Fix parsing of .symver directive on ARM
ARM assembly syntax uses @ for a comment, execpt for the second parameter of the .symver directive which requires @ as part of the symbol name. This commit fixes the parsing of this directive by adding a special case for ARM for this one argumnet. To make the change we had to move the AllowAtInIdentifier variable to the MCAsmLexer interface (from AsmLexer) and expose a setter for the value. The ELFAsmParser then toggles this value when parsing the second argument to the .symver directive for a target that uses @ as a comment symbol llvm-svn: 199339
Diffstat (limited to 'llvm/lib/MC/MCParser/ELFAsmParser.cpp')
-rw-r--r--llvm/lib/MC/MCParser/ELFAsmParser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
index 8807975..ca5532d 100644
--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -590,7 +590,14 @@ bool ELFAsmParser::ParseDirectiveSymver(StringRef, SMLoc) {
if (getLexer().isNot(AsmToken::Comma))
return TokError("expected a comma");
+ // ARM assembly uses @ for a comment...
+ // except when parsing the second parameter of the .symver directive.
+ // Force the next symbol to allow @ in the identifier, which is
+ // required for this directive and then reset it to its initial state.
+ const bool AllowAtInIdentifier = getLexer().getAllowAtInIdentifier();
+ getLexer().setAllowAtInIdentifier(true);
Lex();
+ getLexer().setAllowAtInIdentifier(AllowAtInIdentifier);
StringRef AliasName;
if (getParser().parseIdentifier(AliasName))