diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-10-18 20:46:28 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-10-18 20:46:28 +0000 |
commit | 22f9dd4591e8af6d6feed10a4b6e11a784582edc (patch) | |
tree | c95ba0547f40c0a5129e40d5e7716867351767f7 /lib/MC/MCParser/AsmLexer.cpp | |
parent | 2d8a1d677c81c8e05d1dbc7832e1ced10cfc629a (diff) | |
download | llvm-22f9dd4591e8af6d6feed10a4b6e11a784582edc.tar.gz llvm-22f9dd4591e8af6d6feed10a4b6e11a784582edc.tar.bz2 llvm-22f9dd4591e8af6d6feed10a4b6e11a784582edc.tar.xz |
MC asm parser: allow ?'s in symbol names, and handle @'s in names in MS asm
This is another (final?) stab at making us able to parse our own asm output
on Windows.
Symbols on Windows often contain @'s and ?'s in their names. Our asm parser
didn't like this. ?'s were not allowed, and @'s were intepreted as trying to
reference PLT/GOT/etc.
We can't just add quotes around the bad names, since e.g. for MinGW, we use gas
to assemble, and it doesn't like quotes in some places (notably in .def
directives).
This commit makes us allow ?'s in symbol names, and @'s in symbol names for MS
assembly.
Differential Revision: http://llvm-reviews.chandlerc.com/D1978
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser/AsmLexer.cpp')
-rw-r--r-- | lib/MC/MCParser/AsmLexer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/MC/MCParser/AsmLexer.cpp b/lib/MC/MCParser/AsmLexer.cpp index 1ce0cc2a1d..b49dd01047 100644 --- a/lib/MC/MCParser/AsmLexer.cpp +++ b/lib/MC/MCParser/AsmLexer.cpp @@ -138,9 +138,9 @@ AsmToken AsmLexer::LexHexFloatLiteral(bool NoIntDigits) { return AsmToken(AsmToken::Real, StringRef(TokStart, CurPtr - TokStart)); } -/// LexIdentifier: [a-zA-Z_.][a-zA-Z0-9_$.@]* +/// LexIdentifier: [a-zA-Z_.][a-zA-Z0-9_$.@?]* static bool IsIdentifierChar(char c) { - return isalnum(c) || c == '_' || c == '$' || c == '.' || c == '@'; + return isalnum(c) || c == '_' || c == '$' || c == '.' || c == '@' || c == '?'; } AsmToken AsmLexer::LexIdentifier() { // Check for floating point literals. |