summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-07-17 22:48:04 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-07-17 22:48:04 +0000
commit484903ecd2d74fb087ed10fc9eaa91b0344a2944 (patch)
tree3fe46852c8a7f5b417547317942e99d63d3afb62 /llvm/lib/CodeGen/MIRParser
parent91443edff106f295f703a8bb0f10ffb8be8e1ef6 (diff)
downloadbcm5719-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.cpp5
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) {
OpenPOWER on IntegriCloud