From 71e38c48609b3502d24a47d39a21f1e73402a0e1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 13 Dec 2008 18:58:59 +0000 Subject: [PATCH] disable Anders' recent VLA patch, this fixes PR3209. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60989 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDecl.cpp | 9 +++++++++ lib/CodeGen/CGExprScalar.cpp | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 62684bae49..1c72ba1228 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -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); diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 857a40e6c8..ffb5164782 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -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 Info = CGF.getContext().getTypeInfo(TypeToSize); -- 2.50.1