diff options
author | dim <dim@FreeBSD.org> | 2012-05-03 16:53:59 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-05-03 16:53:59 +0000 |
commit | 822bde9df508e0b9afac5e581b0d6ab403417a28 (patch) | |
tree | 2e51705e103e92c7be1b21e8bd8ffd5b5d0e4d52 /lib/CodeGen/CGExprConstant.cpp | |
parent | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (diff) | |
download | FreeBSD-src-822bde9df508e0b9afac5e581b0d6ab403417a28.zip FreeBSD-src-822bde9df508e0b9afac5e581b0d6ab403417a28.tar.gz |
Vendor import of clang release_31 branch r155985:
http://llvm.org/svn/llvm-project/cfe/branches/release_31@155985
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index d528e0c..bc9f9ef 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -758,17 +758,13 @@ public: } llvm::Constant *EmitArrayInitialization(InitListExpr *ILE) { - unsigned NumInitElements = ILE->getNumInits(); - if (NumInitElements == 1 && - CGM.getContext().hasSameUnqualifiedType(ILE->getType(), - ILE->getInit(0)->getType()) && - (isa<StringLiteral>(ILE->getInit(0)) || - isa<ObjCEncodeExpr>(ILE->getInit(0)))) + if (ILE->isStringLiteralInit()) return Visit(ILE->getInit(0)); llvm::ArrayType *AType = cast<llvm::ArrayType>(ConvertType(ILE->getType())); llvm::Type *ElemTy = AType->getElementType(); + unsigned NumInitElements = ILE->getNumInits(); unsigned NumElements = AType->getNumElements(); // Initialising an array requires us to automatically |