]> granicus.if.org Git - clang/commitdiff
disable Anders' recent VLA patch, this fixes PR3209.
authorChris Lattner <sabre@nondot.org>
Sat, 13 Dec 2008 18:58:59 +0000 (18:58 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 13 Dec 2008 18:58:59 +0000 (18:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60989 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExprScalar.cpp

index 62684bae496360b81dfa6721d4d17cf02567fb9a..1c72ba12280cb0a06c477301cfc6aec2c947bace 100644 (file)
@@ -160,6 +160,15 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
         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);
 
index 857a40e6c8dad1458d92cd8e27d2792c434023b3..ffb51647826fd077e12fbc30715b925a0b21792a 100644 (file)
@@ -667,8 +667,8 @@ ScalarExprEmitter::VisitSizeOfAlignOfExpr(const SizeOfAlignOfExpr *E) {
         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);