[TableGen] Simplify copying OperandMap entries for tied operands in CompressInstEmitter. NFC
Copy the whole struct instead of copying both fields.
This commit is contained in:
@@ -229,9 +229,9 @@ void CompressInstEmitter::addDagOperandMapping(const Record *Rec,
|
|||||||
for (const auto &Opnd : Inst.Operands) {
|
for (const auto &Opnd : Inst.Operands) {
|
||||||
int TiedOpIdx = Opnd.getTiedRegister();
|
int TiedOpIdx = Opnd.getTiedRegister();
|
||||||
if (-1 != TiedOpIdx) {
|
if (-1 != TiedOpIdx) {
|
||||||
|
assert((unsigned)TiedOpIdx < OpNo);
|
||||||
// Set the entry in OperandMap for the tied operand we're skipping.
|
// Set the entry in OperandMap for the tied operand we're skipping.
|
||||||
OperandMap[OpNo].Kind = OperandMap[TiedOpIdx].Kind;
|
OperandMap[OpNo] = OperandMap[TiedOpIdx];
|
||||||
OperandMap[OpNo].Data = OperandMap[TiedOpIdx].Data;
|
|
||||||
if (IsSourceInst)
|
if (IsSourceInst)
|
||||||
*SourceLastTiedOpPtr = OpNo;
|
*SourceLastTiedOpPtr = OpNo;
|
||||||
++OpNo;
|
++OpNo;
|
||||||
@@ -405,8 +405,8 @@ void CompressInstEmitter::createInstOperandMapping(
|
|||||||
int TiedInstOpIdx = Operand.getTiedRegister();
|
int TiedInstOpIdx = Operand.getTiedRegister();
|
||||||
if (TiedInstOpIdx != -1) {
|
if (TiedInstOpIdx != -1) {
|
||||||
++TiedCount;
|
++TiedCount;
|
||||||
DestOperandMap[OpNo].Data = DestOperandMap[TiedInstOpIdx].Data;
|
assert((unsigned)TiedInstOpIdx < OpNo);
|
||||||
DestOperandMap[OpNo].Kind = DestOperandMap[TiedInstOpIdx].Kind;
|
DestOperandMap[OpNo] = DestOperandMap[TiedInstOpIdx];
|
||||||
if (DestOperandMap[OpNo].Kind == OpData::Operand)
|
if (DestOperandMap[OpNo].Kind == OpData::Operand)
|
||||||
// No need to fill the SourceOperandMap here since it was mapped to
|
// No need to fill the SourceOperandMap here since it was mapped to
|
||||||
// destination operand 'TiedInstOpIdx' in a previous iteration.
|
// destination operand 'TiedInstOpIdx' in a previous iteration.
|
||||||
|
|||||||
Reference in New Issue
Block a user