mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Teach the .ll parser to handle named metadata with non-simple names.
Unfortunately we can't follow what the rest of the language does (wrapping it in double-quotes) because that would cause an ambiguity with metadata strings, so instead we escape any unusual characters with \xx escaping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -422,13 +422,15 @@ static bool JustWhitespaceNewLine(const char *&Ptr) {
|
||||
/// !
|
||||
lltok::Kind LLLexer::LexExclaim() {
|
||||
// Lex a metadata name as a MetadataVar.
|
||||
if (isalpha(CurPtr[0])) {
|
||||
if (isalpha(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
|
||||
CurPtr[0] == '.' || CurPtr[0] == '_' || CurPtr[0] == '\\') {
|
||||
++CurPtr;
|
||||
while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
|
||||
CurPtr[0] == '.' || CurPtr[0] == '_')
|
||||
CurPtr[0] == '.' || CurPtr[0] == '_' || CurPtr[0] == '\\')
|
||||
++CurPtr;
|
||||
|
||||
StrVal.assign(TokStart+1, CurPtr); // Skip !
|
||||
UnEscapeLexed(StrVal);
|
||||
return lltok::MetadataVar;
|
||||
}
|
||||
return lltok::exclaim;
|
||||
|
||||
Reference in New Issue
Block a user