diff options
author | David Peixotto <dpeixott@codeaurora.org> | 2014-01-15 22:40:02 +0000 |
---|---|---|
committer | David Peixotto <dpeixott@codeaurora.org> | 2014-01-15 22:40:02 +0000 |
commit | a034c96443006487a566d960d5e14f6f1c4cdf7c (patch) | |
tree | 9f6f88330ff7a92ccdaa524bb7c0cf430a70b510 /lib/MC | |
parent | 4c831d97bf065ae5d0fcba80b28e8396dfda7f39 (diff) | |
download | llvm-a034c96443006487a566d960d5e14f6f1c4cdf7c.tar.gz llvm-a034c96443006487a566d960d5e14f6f1c4cdf7c.tar.bz2 llvm-a034c96443006487a566d960d5e14f6f1c4cdf7c.tar.xz |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCParser/ELFAsmParser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp index 8807975e85..ca5532d485 100644 --- a/lib/MC/MCParser/ELFAsmParser.cpp +++ b/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)) |