From 4c67834407ca6ab344dcf44fc599ad4938cfa96d Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 28 Jan 2009 21:54:33 +0000 Subject: Code generation support for C99 designated initializers. The approach I've taken in this patch is relatively straightforward, although the code itself is non-trivial. Essentially, as we process an initializer list we build up a fully-explicit representation of the initializer list, where each of the subobject initializations occurs in order. Designators serve to "fill in" subobject initializations in a non-linear way. The fully-explicit representation makes initializer lists (both with and without designators) easy to grok for codegen and later semantic analyses. We keep the syntactic form of the initializer list linked into the AST for those clients interested in exactly what the user wrote. Known limitations: - Designating a member of a union that isn't the first member may result in bogus initialization (we warn about this) - GNU array-range designators are not supported (we warn about this) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprScalar.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib/CodeGen/CGExprScalar.cpp') diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 33c5a6124b..dd8b30041e 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -176,11 +176,6 @@ public: if (!VType) return Visit(E->getInit(0)); - if (E->hadDesignators()) { - CGF.ErrorUnsupported(E, "initializer list with designators"); - return llvm::UndefValue::get(CGF.ConvertType(E->getType())); - } - unsigned NumVectorElements = VType->getNumElements(); const llvm::Type *ElementType = VType->getElementType(); -- cgit v1.2.3