[llvm-commits] [dragonegg] r126511 - /dragonegg/trunk/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Fri Feb 25 12:55:08 PST 2011


Author: baldrick
Date: Fri Feb 25 14:55:08 2011
New Revision: 126511

URL: http://llvm.org/viewvc/llvm-project?rev=126511&view=rev
Log:
Reject multiple alternative asm constraints which are not consistent
in the number of alternatives.  Use the same error message as GCC
rather than asserting.

Modified:
    dragonegg/trunk/llvm-convert.cpp

Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=126511&r1=126510&r2=126511&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Fri Feb 25 14:55:08 2011
@@ -6776,8 +6776,11 @@
          *p; ++p)
       if (*p == ',')
         ++NumInputChoices;
-    assert((!NumChoices || NumChoices == NumInputChoices) &&
-           "invalid constraints!");
+    if (NumChoices && (NumInputChoices != NumChoices)) {
+      error_at(gimple_location(stmt), "operand constraints for %<asm%> differ "
+               "in number of alternatives");
+      return;
+    }
     if (NumChoices == 0)
       NumChoices = NumInputChoices;
   }
@@ -6788,8 +6791,11 @@
          *p; ++p)
       if (*p == ',')
         ++NumOutputChoices;
-    assert((!NumChoices || NumChoices == NumOutputChoices) &&
-           "invalid constraints!");
+    if (NumChoices && (NumOutputChoices != NumChoices)) {
+      error_at(gimple_location(stmt), "operand constraints for %<asm%> differ "
+               "in number of alternatives");
+      return;
+    }
     if (NumChoices == 0)
       NumChoices = NumOutputChoices;
   }





More information about the llvm-commits mailing list