diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-08 16:37:44 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-08 16:37:44 +0000 |
| commit | 8e0d04249d4aff89324a4d2d009401dfd262f7e1 (patch) | |
| tree | cd66a3107af8be73aa0be3aee136e265b7dae65a | |
| parent | 26670dcba1609574cba5942aff78ff97b567c5f3 (diff) | |
| download | bcm5719-llvm-8e0d04249d4aff89324a4d2d009401dfd262f7e1.tar.gz bcm5719-llvm-8e0d04249d4aff89324a4d2d009401dfd262f7e1.zip | |
Patch adds test to my previous patch for assigning to
gc'able structs in the Next runtime and adds missing
PCH info.
llvm-svn: 75014
| -rw-r--r-- | clang/lib/Frontend/PCHReaderDecl.cpp | 1 | ||||
| -rw-r--r-- | clang/lib/Frontend/PCHWriterDecl.cpp | 1 | ||||
| -rw-r--r-- | clang/test/CodeGenObjC/objc-gc-aggr-assign.m | 42 |
3 files changed, 44 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp index 94e46acac34..308d73febf8 100644 --- a/clang/lib/Frontend/PCHReaderDecl.cpp +++ b/clang/lib/Frontend/PCHReaderDecl.cpp @@ -128,6 +128,7 @@ void PCHDeclReader::VisitRecordDecl(RecordDecl *RD) { VisitTagDecl(RD); RD->setHasFlexibleArrayMember(Record[Idx++]); RD->setAnonymousStructOrUnion(Record[Idx++]); + RD->setHasObjectMember(Record[Idx++]); } void PCHDeclReader::VisitValueDecl(ValueDecl *VD) { diff --git a/clang/lib/Frontend/PCHWriterDecl.cpp b/clang/lib/Frontend/PCHWriterDecl.cpp index a6843e1b9ef..c588a181dca 100644 --- a/clang/lib/Frontend/PCHWriterDecl.cpp +++ b/clang/lib/Frontend/PCHWriterDecl.cpp @@ -125,6 +125,7 @@ void PCHDeclWriter::VisitRecordDecl(RecordDecl *D) { VisitTagDecl(D); Record.push_back(D->hasFlexibleArrayMember()); Record.push_back(D->isAnonymousStructOrUnion()); + Record.push_back(D->hasObjectMember()); Code = pch::DECL_RECORD; } diff --git a/clang/test/CodeGenObjC/objc-gc-aggr-assign.m b/clang/test/CodeGenObjC/objc-gc-aggr-assign.m new file mode 100644 index 00000000000..b6b08ffefdb --- /dev/null +++ b/clang/test/CodeGenObjC/objc-gc-aggr-assign.m @@ -0,0 +1,42 @@ +// RUN: clang-cc -fnext-runtime -fobjc-gc -emit-llvm -o %t %s && +// RUN: grep objc_memmove_collectable %t | grep call | count 2 + +static int count; + +typedef struct S { + int ii; +} SS; + +struct type_s { + SS may_recurse; + id id_val; +}; + +@interface NamedObject +{ + struct type_s type_s_ivar; +} +- (void) setSome : (struct type_s) arg; +- (struct type_s) getSome; +@property(assign) struct type_s aggre_prop; +@end + +@implementation NamedObject +- (void) setSome : (struct type_s) arg + { + type_s_ivar = arg; + } +- (struct type_s) getSome + { + return type_s_ivar; + } +@synthesize aggre_prop = type_s_ivar; +@end + +struct type_s some = {{1234}, (id)0}; + +struct type_s get(void) +{ + return some; +} + |

