diff options
author | Alex Lorenz <arphaman@gmail.com> | 2015-07-17 22:48:04 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2015-07-17 22:48:04 +0000 |
commit | 484903ecd2d74fb087ed10fc9eaa91b0344a2944 (patch) | |
tree | 3fe46852c8a7f5b417547317942e99d63d3afb62 /llvm/lib/CodeGen/MIRParser | |
parent | 91443edff106f295f703a8bb0f10ffb8be8e1ef6 (diff) | |
download | bcm5719-llvm-484903ecd2d74fb087ed10fc9eaa91b0344a2944.tar.gz bcm5719-llvm-484903ecd2d74fb087ed10fc9eaa91b0344a2944.zip |
MIR Parser: Allow the dollar characters in all of the identifier tokens.
This commit modifies the machine instruction lexer so that it now accepts the
'$' characters in identifier tokens.
This change makes the syntax for unquoted global value tokens consistent with
the syntax for the global idenfitier tokens in the LLVM's assembly language.
llvm-svn: 242584
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp index 6f74838812f..771e3e1aa0f 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp +++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp @@ -61,8 +61,11 @@ static Cursor skipWhitespace(Cursor C) { return C; } +/// Return true if the given character satisfies the following regular +/// expression: [-a-zA-Z$._0-9] static bool isIdentifierChar(char C) { - return isalpha(C) || isdigit(C) || C == '_' || C == '-' || C == '.'; + return isalpha(C) || isdigit(C) || C == '_' || C == '-' || C == '.' || + C == '$'; } static MIToken::TokenKind getIdentifierKind(StringRef Identifier) { |