From c63a1f276f7b324fd9a4be82098b1c8f7bf30733 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 4 Aug 2008 07:31:14 +0000 Subject: Finally fix PR2189. This makes a fairly invasive but important change to move getAsArrayType into ASTContext instead of being a method on type. This is required because getAsArrayType(const AT), where AT is a typedef for "int[10]" needs to return ArrayType(const int, 10). Fixing this greatly simplifies getArrayDecayedType, which is a good sign. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 1fd616c648..ca52b070dd 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -429,7 +429,8 @@ LValue CodeGenFunction::EmitStringLiteralLValue(const StringLiteral *E) { std::string StringLiteral(StrData, StrData+Len); // Resize the string to the right size - const ConstantArrayType *CAT = E->getType()->getAsConstantArrayType(); + const ConstantArrayType *CAT = + getContext().getAsConstantArrayType(E->getType()); uint64_t RealLen = CAT->getSize().getZExtValue(); StringLiteral.resize(RealLen, '\0'); -- cgit v1.2.3