[cfe-commits] r60989 - in /cfe/trunk/lib/CodeGen: CGDecl.cpp CGExprScalar.cpp

Chris Lattner sabre at nondot.org
Sat Dec 13 10:58:59 PST 2008


Author: lattner
Date: Sat Dec 13 12:58:59 2008
New Revision: 60989

URL: http://llvm.org/viewvc/llvm-project?rev=60989&view=rev
Log:
disable Anders' recent VLA patch, this fixes PR3209.

Modified:
    cfe/trunk/lib/CodeGen/CGDecl.cpp
    cfe/trunk/lib/CodeGen/CGExprScalar.cpp

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Sat Dec 13 12:58:59 2008
@@ -160,6 +160,15 @@
         D.getStorageClass() == VarDecl::Register ? ".reg." : ".auto.";
       DeclPtr = GenerateStaticBlockVarDecl(D, true, Class);
     }
+  } else if (1) {
+    // FIXME: The code below is disabled because is causes a regression in the
+    // testsuite.
+    CGM.ErrorUnsupported(&D, "variable-length array"); 
+    
+    const llvm::Type *LTy = ConvertType(Ty);
+    llvm::AllocaInst *Alloc = 
+      CreateTempAlloca(LTy, D.getIdentifier()->getName());
+    DeclPtr = Alloc;
   } else {
     const VariableArrayType *VAT = getContext().getAsVariableArrayType(Ty);
 

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Sat Dec 13 12:58:59 2008
@@ -667,8 +667,8 @@
         CGF.getContext().getAsVariableArrayType(TypeToSize)) {
     if (E->isSizeOf())
       return CGF.GetVLASize(VAT);
-    else
-      assert(0 && "alignof VLAs not implemented yet");
+    // FIXME: This should be an UNSUPPORTED error.
+    assert(0 && "alignof VLAs not implemented yet");
   }
   
   std::pair<uint64_t, unsigned> Info = CGF.getContext().getTypeInfo(TypeToSize);





More information about the cfe-commits mailing list