TargetLowering::isOperandValidForConstraint
authorChris Lattner <sabre@nondot.org>
Tue, 31 Oct 2006 19:41:18 +0000 (19:41 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 31 Oct 2006 19:41:18 +0000 (19:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31319 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 374f5673094e5213ac9eef76f20a347f08f40e33..65548701f03ee24c5dcd6a85ee1c616463f918c5 100644 (file)
@@ -2487,8 +2487,13 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) {
         CTy = TLI.getConstraintType(ConstraintCode[0]);
         
       if (CTy == TargetLowering::C_Other) {
-        if (!TLI.isOperandValidForConstraint(InOperandVal, ConstraintCode[0]))
-          assert(0 && "MATCH FAIL!");
+        InOperandVal = TLI.isOperandValidForConstraint(InOperandVal,
+                                                       ConstraintCode[0], DAG);
+        if (!InOperandVal.Val) {
+          std::cerr << "Invalid operand for inline asm constraint '"
+                    << ConstraintCode << "'!\n";
+          exit(1);
+        }
         
         // Add information to the INLINEASM node to know about this input.
         unsigned ResOpType = 3 /*IMM*/ | (1 << 3);