aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-07-08 01:18:33 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-07-08 01:18:33 +0000
commit082b02e8403d3ee9d2ded969fbe0e5d472f04cd8 (patch)
treeddcfcdd6538dff86a39f9298f38571711705bdb2 /lib/Sema/SemaDecl.cpp
parent9c10fcfc3b9d2076efe701b60644a9987a93c503 (diff)
Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into. Will provide a test case later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 290ab5d708..1a8cec11b7 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4238,6 +4238,8 @@ void Sema::ActOnFields(Scope* S,
}
}
}
+ if (Record && FDTTy->getDecl()->hasObjectMember())
+ Record->setHasObjectMember(true);
} else if (FDTy->isObjCInterfaceType()) {
/// A field cannot be an Objective-c object
Diag(FD->getLocation(), diag::err_statically_allocated_object);
@@ -4245,6 +4247,12 @@ void Sema::ActOnFields(Scope* S,
EnclosingDecl->setInvalidDecl();
continue;
}
+ else if (getLangOptions().ObjC1 &&
+ getLangOptions().getGCMode() != LangOptions::NonGC &&
+ Record &&
+ (Context.isObjCObjectPointerType(FD->getType()) ||
+ FD->getType().isObjCGCStrong()))
+ Record->setHasObjectMember(true);
// Keep track of the number of named members.
if (FD->getIdentifier())
++NumNamedMembers;