diff options
Diffstat (limited to 'utils/TableGen/InstrInfoEmitter.cpp')
| -rw-r--r-- | utils/TableGen/InstrInfoEmitter.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp index cf40c78fa72e..898c92af8da9 100644 --- a/utils/TableGen/InstrInfoEmitter.cpp +++ b/utils/TableGen/InstrInfoEmitter.cpp @@ -118,7 +118,20 @@ InstrInfoEmitter::GetOperandInfo(const CodeGenInstruction &Inst) { Res += "|(1<<TOI::OptionalDef)"; // Fill in constraint info. - Res += ", " + Inst.OperandList[i].Constraints[j]; + Res += ", "; + + const CodeGenInstruction::ConstraintInfo &Constraint = + Inst.OperandList[i].Constraints[j]; + if (Constraint.isNone()) + Res += "0"; + else if (Constraint.isEarlyClobber()) + Res += "(1 << TOI::EARLY_CLOBBER)"; + else { + assert(Constraint.isTied()); + Res += "((" + utostr(Constraint.getTiedOperand()) + + " << 16) | (1 << TOI::TIED_TO))"; + } + Result.push_back(Res); } } @@ -346,7 +359,7 @@ void InstrInfoEmitter::emitShiftedValue(Record *R, StringInit *Val, R->getName() != "IMPLICIT_DEF" && R->getName() != "SUBREG_TO_REG" && R->getName() != "COPY_TO_REGCLASS" && - R->getName() != "DEBUG_VALUE") + R->getName() != "DBG_VALUE") throw R->getName() + " doesn't have a field named '" + Val->getValue() + "'!"; return; |
