aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2010-04-16 23:19:41 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2010-04-16 23:19:41 +0000
commit6784704d4715664adfa41277efc09f3ce46e7750 (patch)
treeb8e5a35709939b02c55fc418f84cbd40772dcb30 /lib/CodeGen/CGExprConstant.cpp
parent575c63a83e1ed5439643e10d55c26931ca043993 (diff)
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
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--lib/CodeGen/CGExprConstant.cpp11
1 files changed, 5 insertions, 6 deletions
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<llvm::Constant*> Elts;
- const llvm::ArrayType *AType =
- cast<llvm::ArrayType>(ConvertType(ILE->getType()));
unsigned NumInitElements = ILE->getNumInits();
- // FIXME: Check for wide strings
// FIXME: Check for NumInitElements exactly equal to 1??
if (NumInitElements > 0 &&
(isa<StringLiteral>(ILE->getInit(0)) ||
- isa<ObjCEncodeExpr>(ILE->getInit(0))) &&
- ILE->getType()->getArrayElementTypeNoTypeQual()->isCharType())
+ isa<ObjCEncodeExpr>(ILE->getInit(0))))
return Visit(ILE->getInit(0));
+
+ std::vector<llvm::Constant*> Elts;
+ const llvm::ArrayType *AType =
+ cast<llvm::ArrayType>(ConvertType(ILE->getType()));
const llvm::Type *ElemTy = AType->getElementType();
unsigned NumElements = AType->getNumElements();