aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/CodeGenInstruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/CodeGenInstruction.cpp')
-rw-r--r--utils/TableGen/CodeGenInstruction.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp
index 08005fb5e1..6b1fc6ed1a 100644
--- a/utils/TableGen/CodeGenInstruction.cpp
+++ b/utils/TableGen/CodeGenInstruction.cpp
@@ -439,6 +439,7 @@ CodeGenInstAlias::CodeGenInstAlias(Record *R, CodeGenTarget &T) : TheDef(R) {
// Now that it is validated, add it.
ResultOperands.push_back(ResultOperand(ADI->getDef()));
+ ResultInstOperandIndex.push_back(i);
++AliasOpNo;
continue;
}
@@ -454,6 +455,7 @@ CodeGenInstAlias::CodeGenInstAlias(Record *R, CodeGenTarget &T) : TheDef(R) {
// Now that it is validated, add it.
ResultOperands.push_back(ResultOperand(static_cast<Record*>(0)));
+ ResultInstOperandIndex.push_back(i);
++AliasOpNo;
continue;
}
@@ -485,6 +487,7 @@ CodeGenInstAlias::CodeGenInstAlias(Record *R, CodeGenTarget &T) : TheDef(R) {
// Now that it is validated, add it.
ResultOperands.push_back(ResultOperand(Result->getArgName(AliasOpNo),
ADI->getDef()));
+ ResultInstOperandIndex.push_back(i);
++AliasOpNo;
continue;
}
@@ -500,6 +503,7 @@ CodeGenInstAlias::CodeGenInstAlias(Record *R, CodeGenTarget &T) : TheDef(R) {
ResultOpRec->getName() +
" for integer result operand!");
ResultOperands.push_back(ResultOperand(II->getValue()));
+ ResultInstOperandIndex.push_back(i);
++AliasOpNo;
continue;
}
@@ -513,21 +517,3 @@ CodeGenInstAlias::CodeGenInstAlias(Record *R, CodeGenTarget &T) : TheDef(R) {
" instruction expects " + utostr(ResultInst->Operands.size())+
" operands!");
}
-
-/// getResultInstOperandIndexForResultOperandIndex - Given an index into the
-/// ResultOperands array, translate it to a valid index in ResultInst's
-/// operand list.
-unsigned CodeGenInstAlias::
-getResultInstOperandIndexForResultOperandIndex(unsigned OpNo) const {
- unsigned OpIdx = 0;
-
- for (unsigned i = 0;; ++i) {
- assert(i != ResultInst->Operands.size() && "Didn't find entry");
- if (ResultInst->Operands[i].getTiedRegister() != -1)
- continue;
-
- if (OpIdx == OpNo) return i;
-
- ++OpIdx;
- }
-}