[llvm-commits] [llvm] r117968 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Chris Lattner
sabre at nondot.org
Mon Nov 1 16:08:02 PDT 2010
Author: lattner
Date: Mon Nov 1 18:08:02 2010
New Revision: 117968
URL: http://llvm.org/viewvc/llvm-project?rev=117968&view=rev
Log:
give MatchableInfo::Operand a constructor
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=117968&r1=117967&r2=117968&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Mon Nov 1 18:08:02 2010
@@ -329,6 +329,9 @@
/// The original operand this corresponds to, if any.
const CGIOperandList::OperandInfo *OperandInfo;
+
+ Operand(ClassInfo *C, const CGIOperandList::OperandInfo *OpInfo)
+ : Class(C), OperandInfo(OpInfo) {}
};
/// InstrName - The target name for this instruction.
@@ -1006,9 +1009,7 @@
// Check for singleton registers.
if (Record *RegRecord = II->getSingletonRegisterForToken(i, *this)) {
- MatchableInfo::Operand Op;
- Op.Class = RegisterClasses[RegRecord];
- Op.OperandInfo = 0;
+ MatchableInfo::Operand Op(RegisterClasses[RegRecord], 0);
assert(Op.Class && Op.Class->Registers.size() == 1 &&
"Unexpected class for singleton register");
II->Operands.push_back(Op);
@@ -1017,10 +1018,7 @@
// Check for simple tokens.
if (Token[0] != '$') {
- MatchableInfo::Operand Op;
- Op.Class = getTokenClass(Token);
- Op.OperandInfo = 0;
- II->Operands.push_back(Op);
+ II->Operands.push_back(MatchableInfo::Operand(getTokenClass(Token), 0));
continue;
}
@@ -1057,10 +1055,8 @@
assert(OI && "Unable to find tied operand target!");
}
- MatchableInfo::Operand Op;
- Op.Class = getOperandClass(Token, *OI);
- Op.OperandInfo = OI;
- II->Operands.push_back(Op);
+ II->Operands.push_back(MatchableInfo::Operand(getOperandClass(Token,
+ *OI), OI));
}
}
More information about the llvm-commits
mailing list