add an assert so that PR2356 explodes instead of running off an
[oota-llvm.git] / lib / CodeGen / SelectionDAG / TargetLowering.cpp
index 4e4fd2b7d36b97653a2468c0011b4a07667f76bf..664e06d2d27753f744a79c0eed31da3d69fe256b 100644 (file)
@@ -1962,6 +1962,21 @@ getRegForInlineAsmConstraint(const std::string &Constraint,
 //===----------------------------------------------------------------------===//
 // Constraint Selection.
 
+/// isMatchingConstraint - Return true of this is an input operand that is a
+/// matching constraint like "4".
+bool TargetLowering::AsmOperandInfo::isMatchingConstraint() const {
+  assert(!ConstraintCode.empty() && "No known constraint!");
+  return isdigit(ConstraintCode[0]);
+}
+
+/// getMatchedOperand - If this is an input matching constraint, this method
+/// returns the output operand it matches.
+unsigned TargetLowering::AsmOperandInfo::getMatchedOperand() const {
+  assert(!ConstraintCode.empty() && "No known constraint!");
+  return atoi(ConstraintCode.c_str());
+}
+
+
 /// getConstraintGenerality - Return an integer indicating how general CT
 /// is.
 static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {