[llvm-commits] [llvm] r118359 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Chris Lattner
sabre at nondot.org
Sat Nov 6 15:06:04 PDT 2010
Author: lattner
Date: Sat Nov 6 17:06:03 2010
New Revision: 118359
URL: http://llvm.org/viewvc/llvm-project?rev=118359&view=rev
Log:
pass literals like $$1 through to the asm matcher. This isn't right yet, but doesn't hurt.
Modified:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=118359&r1=118358&r2=118359&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sat Nov 6 17:06:03 2010
@@ -629,21 +629,17 @@
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 @@
continue;
}
+ if (Token.size() > 1 && isdigit(Token[1])) {
+ Op.Class = getTokenClass(Token);
+ continue;
+ }
+
// Otherwise this is an operand reference.
StringRef OperandName;
if (Token[1] == '{')
More information about the llvm-commits
mailing list