Turn an assert into an error message. This is commonly triggered when
authorChris Lattner <sabre@nondot.org>
Tue, 31 Oct 2006 07:33:13 +0000 (07:33 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 31 Oct 2006 07:33:13 +0000 (07:33 +0000)
we don't support a specific constraint yet.  When this happens, print the
unsupported constraint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31310 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 6a2a8e79c1b3f5222fe6dd03aa1905d96c840705..374f5673094e5213ac9eef76f20a347f08f40e33 100644 (file)
@@ -2417,7 +2417,11 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) {
         GetRegistersForValue(ConstraintCode, ConstraintVTs[i],
                              true, UsesInputRegister, 
                              OutputRegs, InputRegs);
-      assert(!Regs.Regs.empty() && "Couldn't allocate output reg!");
+      if (Regs.Regs.empty()) {
+        std::cerr << "Couldn't allocate output reg for contraint '"
+                  << ConstraintCode << "'!\n";
+        exit(1);
+      }
 
       if (!Constraints[i].isIndirectOutput) {
         assert(RetValRegs.Regs.empty() &&