From 662174c82ef46b19a2329c7d37208e1d12dfb7b3 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 29 Aug 2008 17:28:43 +0000 Subject: Downgrade a number of FIXME asserts to ErrorUnsupported. - Notably VLAs git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55544 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprScalar.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/CGExprScalar.cpp') diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 7334dd7e81..229b05f93e 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -513,10 +513,14 @@ Value *ScalarExprEmitter::VisitImplicitCastExpr(const ImplicitCastExpr *E) { // will not true when we add support for VLAs. Value *V = EmitLValue(Op).getAddress(); // Bitfields can't be arrays. - assert(isa(V->getType()) && - isa(cast(V->getType()) - ->getElementType()) && - "Doesn't support VLAs yet!"); + if (!(isa(V->getType()) && + isa(cast(V->getType()) + ->getElementType()))) { + CGF.ErrorUnsupported(E, "variable-length array cast"); + if (E->getType()->isVoidType()) + return 0; + return llvm::UndefValue::get(CGF.ConvertType(E->getType())); + } V = Builder.CreateStructGEP(V, 0, "arraydecay"); // The resultant pointer type can be implicitly casted to other pointer -- cgit v1.2.3