From f0dc11ad7f5ca007636a3e6fdc69adf878768bc3 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 4 Jun 2013 16:04:37 +0000 Subject: Objective-C encoding. Fixes up encodeing for arrays of empty structs. // rdar://14053082 (also pr13062). llvm-svn: 183234 --- clang/lib/AST/ASTContext.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 333e80be306..1f89e3f1f69 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5242,12 +5242,9 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, } else { S += '['; - if (const ConstantArrayType *CAT = dyn_cast(AT)) { - if (getTypeSize(CAT->getElementType()) == 0) - S += '0'; - else - S += llvm::utostr(CAT->getSize().getZExtValue()); - } else { + if (const ConstantArrayType *CAT = dyn_cast(AT)) + S += llvm::utostr(CAT->getSize().getZExtValue()); + else { //Variable length arrays are encoded as a regular array with 0 elements. assert((isa(AT) || isa(AT)) && "Unknown array type!"); -- cgit v1.2.3