[cfe-commits] r61292 - /cfe/trunk/lib/CodeGen/CGStmt.cpp

Eli Friedman eli.friedman at gmail.com
Sat Dec 20 15:18:30 PST 2008


Author: efriedma
Date: Sat Dec 20 17:18:29 2008
New Revision: 61292

URL: http://llvm.org/viewvc/llvm-project?rev=61292&view=rev
Log:
Extend the unsupported error to include break and continue, and fix a 
warning by using an unsigned index.


Modified:
    cfe/trunk/lib/CodeGen/CGStmt.cpp

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=61292&r1=61291&r2=61292&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Sat Dec 20 17:18:29 2008
@@ -220,7 +220,7 @@
     return;
   }
 
-  for (int i = 0; i < StackSaveValues.size(); i++) {
+  for (unsigned i = 0; i < StackSaveValues.size(); i++) {
     if (StackSaveValues[i]) {
       CGM.ErrorUnsupported(&S, "goto inside scope with VLA");
       return;
@@ -478,7 +478,7 @@
 /// if the function returns void, or may be missing one if the function returns
 /// non-void.  Fun stuff :).
 void CodeGenFunction::EmitReturnStmt(const ReturnStmt &S) {
-  for (int i = 0; i < StackSaveValues.size(); i++) {
+  for (unsigned i = 0; i < StackSaveValues.size(); i++) {
     if (StackSaveValues[i]) {
       CGM.ErrorUnsupported(&S, "return inside scope with VLA");
       return;
@@ -532,9 +532,11 @@
     return;
   }
 
-  if (StackSaveValues.back()) {
-    CGM.ErrorUnsupported(&S, "break inside scope with VLA");
-    return;
+  for (unsigned i = 0; i < StackSaveValues.size(); i++) {
+    if (StackSaveValues[i]) {
+      CGM.ErrorUnsupported(&S, "break inside scope with VLA");
+      return;
+    }
   }
   
   // If this code is reachable then emit a stop point (if generating
@@ -555,9 +557,11 @@
     return;
   }
 
-  if (StackSaveValues.back()) {
-    CGM.ErrorUnsupported(&S, "continue inside scope with VLA");
-    return;
+  for (unsigned i = 0; i < StackSaveValues.size(); i++) {
+    if (StackSaveValues[i]) {
+      CGM.ErrorUnsupported(&S, "continue inside scope with VLA");
+      return;
+    }
   }
   
   // If this code is reachable then emit a stop point (if generating





More information about the cfe-commits mailing list