diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-06 22:06:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-06 22:06:03 +0000 |
commit | 7ad3147f98eb4e84c24629e88a7d8bb1e04df3d4 (patch) | |
tree | 7ecf9aa47ef8b0faf32a847ec806195b0a6c8681 | |
parent | 17671510a711b7479e89fc65419d794e1931a3c4 (diff) | |
download | external_llvm-7ad3147f98eb4e84c24629e88a7d8bb1e04df3d4.zip external_llvm-7ad3147f98eb4e84c24629e88a7d8bb1e04df3d4.tar.gz external_llvm-7ad3147f98eb4e84c24629e88a7d8bb1e04df3d4.tar.bz2 |
pass literals like $$1 through to the asm matcher. This isn't right yet, but doesn't hurt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118359 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 151c1b2..248ce4f 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -629,21 +629,17 @@ void MatchableInfo::TokenizeAsmString(const AsmMatcherInfo &Info) { break; case '$': { + if (InTok) { + AsmOperands.push_back(AsmOperand(String.slice(Prev, i))); + InTok = false; + } + // If this isn't "${", treat like a normal token. if (i + 1 == String.size() || String[i + 1] != '{') { - if (InTok) { - AsmOperands.push_back(AsmOperand(String.slice(Prev, i))); - InTok = false; - } Prev = i; break; } - if (InTok) { - AsmOperands.push_back(AsmOperand(String.slice(Prev, i))); - InTok = false; - } - StringRef::iterator End = std::find(String.begin() + i, String.end(),'}'); assert(End != String.end() && "Missing brace in operand reference!"); size_t EndPos = End - String.begin(); @@ -1122,6 +1118,11 @@ void AsmMatcherInfo::BuildInfo() { continue; } + if (Token.size() > 1 && isdigit(Token[1])) { + Op.Class = getTokenClass(Token); + continue; + } + // Otherwise this is an operand reference. StringRef OperandName; if (Token[1] == '{') |