give MatchableInfo::Operand a constructor

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117968 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-11-01 23:08:02 +00:00
parent efd8dadb4f
commit 4c9f4e4002

View File

@ -329,6 +329,9 @@ struct MatchableInfo {
/// The original operand this corresponds to, if any. /// The original operand this corresponds to, if any.
const CGIOperandList::OperandInfo *OperandInfo; const CGIOperandList::OperandInfo *OperandInfo;
Operand(ClassInfo *C, const CGIOperandList::OperandInfo *OpInfo)
: Class(C), OperandInfo(OpInfo) {}
}; };
/// InstrName - The target name for this instruction. /// InstrName - The target name for this instruction.
@ -1006,9 +1009,7 @@ void AsmMatcherInfo::BuildInfo() {
// Check for singleton registers. // Check for singleton registers.
if (Record *RegRecord = II->getSingletonRegisterForToken(i, *this)) { if (Record *RegRecord = II->getSingletonRegisterForToken(i, *this)) {
MatchableInfo::Operand Op; MatchableInfo::Operand Op(RegisterClasses[RegRecord], 0);
Op.Class = RegisterClasses[RegRecord];
Op.OperandInfo = 0;
assert(Op.Class && Op.Class->Registers.size() == 1 && assert(Op.Class && Op.Class->Registers.size() == 1 &&
"Unexpected class for singleton register"); "Unexpected class for singleton register");
II->Operands.push_back(Op); II->Operands.push_back(Op);
@ -1017,10 +1018,7 @@ void AsmMatcherInfo::BuildInfo() {
// Check for simple tokens. // Check for simple tokens.
if (Token[0] != '$') { if (Token[0] != '$') {
MatchableInfo::Operand Op; II->Operands.push_back(MatchableInfo::Operand(getTokenClass(Token), 0));
Op.Class = getTokenClass(Token);
Op.OperandInfo = 0;
II->Operands.push_back(Op);
continue; continue;
} }
@ -1057,10 +1055,8 @@ void AsmMatcherInfo::BuildInfo() {
assert(OI && "Unable to find tied operand target!"); assert(OI && "Unable to find tied operand target!");
} }
MatchableInfo::Operand Op; II->Operands.push_back(MatchableInfo::Operand(getOperandClass(Token,
Op.Class = getOperandClass(Token, *OI); *OI), OI));
Op.OperandInfo = OI;
II->Operands.push_back(Op);
} }
} }