[cfe-commits] r104837 - in /cfe/trunk: lib/AST/ASTContext.cpp test/CodeGenObjCXX/foreach-statement.mm
Fariborz Jahanian
fjahanian at apple.com
Thu May 27 09:05:06 PDT 2010
Author: fjahanian
Date: Thu May 27 11:05:06 2010
New Revision: 104837
URL: http://llvm.org/viewvc/llvm-project?rev=104837&view=rev
Log:
Objective-c++ IR gen.
Flag synthesized struct decl. as non-empty so
CXX side of ir gen does not skip its Null initialization.
Fixes radar 8027844 for objc++'s collection statement.
Added:
cfe/trunk/test/CodeGenObjCXX/foreach-statement.mm
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=104837&r1=104836&r2=104837&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu May 27 11:05:06 2010
@@ -2856,6 +2856,9 @@
Field->setAccess(AS_public);
ObjCFastEnumerationStateTypeDecl->addDecl(Field);
}
+ if (getLangOptions().CPlusPlus)
+ if (CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(ObjCFastEnumerationStateTypeDecl))
+ CXXRD->setEmpty(false);
ObjCFastEnumerationStateTypeDecl->completeDefinition();
}
Added: cfe/trunk/test/CodeGenObjCXX/foreach-statement.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/foreach-statement.mm?rev=104837&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/foreach-statement.mm (added)
+++ cfe/trunk/test/CodeGenObjCXX/foreach-statement.mm Thu May 27 11:05:06 2010
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// rdar: // 8027844
+
+// CHECK: call void @llvm.memset
+
+int main() {
+ id foo;
+ for (id a in foo) {
+ }
+}
More information about the cfe-commits
mailing list