]> granicus.if.org Git - clang/commitdiff
Revert the hack Chris Lattner added in r97981 to work around
authorDouglas Gregor <dgregor@apple.com>
Fri, 8 Oct 2010 20:56:19 +0000 (20:56 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 8 Oct 2010 20:56:19 +0000 (20:56 +0000)
brokenness in the designated-initializer ASTs. The ASTs were fixed by
Alp Toker's patch (r116098) for PR6955. Fixes PR6537.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116101 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprAgg.cpp

index bd773f2dad6bd3e51557af941072424a36bb7985..31ba3373f08d0b53e3b96873a9dabddab8d85e72 100644 (file)
@@ -562,16 +562,6 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
   unsigned NumInitElements = E->getNumInits();
   RecordDecl *SD = E->getType()->getAs<RecordType>()->getDecl();
   
-  // If we're initializing the whole aggregate, just do it in place.
-  // FIXME: This is a hack around an AST bug (PR6537).
-  if (NumInitElements == 1 && E->getType() == E->getInit(0)->getType()) {
-    EmitInitializationToLValue(E->getInit(0),
-                               CGF.MakeAddrLValue(DestPtr, E->getType()),
-                               E->getType());
-    return;
-  }
-  
-  
   if (E->getType()->isUnionType()) {
     // Only initialize one field of a union. The field itself is
     // specified by the initializer list.