[cfe-commits] r47439 - /cfe/trunk/CodeGen/CGExprConstant.cpp
Lauro Ramos Venancio
lauro.venancio at gmail.com
Thu Feb 21 10:09:59 PST 2008
I think, it would be better to fix it in Sema.
Lauro
2008/2/21, Eli Friedman <eli.friedman at gmail.com>:
> Author: efriedma
> Date: Thu Feb 21 11:45:41 2008
> New Revision: 47439
>
> URL: http://llvm.org/viewvc/llvm-project?rev=47439&view=rev
> Log:
> Fix brace-enclosed string initializers for char arrays. From pr2079,
> ahtough I had the fix in my tree previously.
>
>
> Modified:
> cfe/trunk/CodeGen/CGExprConstant.cpp
>
> Modified: cfe/trunk/CodeGen/CGExprConstant.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprConstant.cpp?rev=47439&r1=47438&r2=47439&view=diff
>
> ==============================================================================
> --- cfe/trunk/CodeGen/CGExprConstant.cpp (original)
> +++ cfe/trunk/CodeGen/CGExprConstant.cpp Thu Feb 21 11:45:41 2008
> @@ -69,9 +69,12 @@
>
> llvm::Constant *EmitArrayInitialization(InitListExpr *ILE,
> const llvm::ArrayType *AType) {
> -
> - std::vector<llvm::Constant*> Elts;
> - unsigned NumInitElements = ILE->getNumInits();
> + std::vector<llvm::Constant*> Elts;
> + unsigned NumInitElements = ILE->getNumInits();
> + // FIXME: Check for wide strings
> + if (NumInitElements > 0 && isa<StringLiteral>(ILE->getInit(0)) &&
> + ILE->getType()->getAsArrayType()->getElementType()->isCharType())
> + return Visit(ILE->getInit(0));
> const llvm::Type *ElemTy = AType->getElementType();
> unsigned NumElements = AType->getNumElements();
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list