From 6784704d4715664adfa41277efc09f3ce46e7750 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Fri, 16 Apr 2010 23:19:41 +0000 Subject: fix PR6766: codegen of var initialized with wide char git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101568 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprConstant.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/CGExprConstant.cpp') diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 82156f7260..6612070c64 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -615,17 +615,16 @@ public: } llvm::Constant *EmitArrayInitialization(InitListExpr *ILE) { - std::vector Elts; - const llvm::ArrayType *AType = - cast(ConvertType(ILE->getType())); unsigned NumInitElements = ILE->getNumInits(); - // FIXME: Check for wide strings // FIXME: Check for NumInitElements exactly equal to 1?? if (NumInitElements > 0 && (isa(ILE->getInit(0)) || - isa(ILE->getInit(0))) && - ILE->getType()->getArrayElementTypeNoTypeQual()->isCharType()) + isa(ILE->getInit(0)))) return Visit(ILE->getInit(0)); + + std::vector Elts; + const llvm::ArrayType *AType = + cast(ConvertType(ILE->getType())); const llvm::Type *ElemTy = AType->getElementType(); unsigned NumElements = AType->getNumElements(); -- cgit v1.2.3