summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-04-27 17:18:58 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-04-27 17:18:58 +0000
commit38b77a9d8e0745ec0c948450916688a5456e9d67 (patch)
treebc6e2bf284db1a65567f8016a3df179d1644d8cc /clang/lib/AST/ASTContext.cpp
parent2e3197e60bb195fed535561bbdc1b26a3b57709a (diff)
downloadbcm5719-llvm-38b77a9d8e0745ec0c948450916688a5456e9d67.tar.gz
bcm5719-llvm-38b77a9d8e0745ec0c948450916688a5456e9d67.zip
Move CollectIvarsToConstructOrDestruct to Sema
from AST, consider ivar array of objects (per Doug's comment). llvm-svn: 102446
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 0a39575c431..91fafbabc2a 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -807,55 +807,6 @@ void ASTContext::CollectInheritedProtocols(const Decl *CDecl,
}
}
-/// CollectIvarsToConstructOrDestruct - Collect those ivars which require
-/// construction (construct=true) or destruction (construct=false)
-///
-void ASTContext::CollectIvarsToConstructOrDestruct(const ObjCInterfaceDecl *OI,
- llvm::SmallVectorImpl<ObjCIvarDecl*> &Ivars,
- bool construct) {
- if (!getLangOptions().CPlusPlus)
- return;
- for (ObjCInterfaceDecl::ivar_iterator I = OI->ivar_begin(),
- E = OI->ivar_end(); I != E; ++I) {
- ObjCIvarDecl *Iv = (*I);
- if (const RecordType *RT = Iv->getType()->getAs<RecordType>()) {
- if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(RT->getDecl()))
- if (construct && !RD->hasTrivialConstructor() ||
- !construct && !RD->hasTrivialDestructor())
- Ivars.push_back(*I);
- }
- }
-
- // Find ivars to construct/destruct in class extension.
- if (const ObjCCategoryDecl *CDecl = OI->getClassExtension()) {
- for (ObjCCategoryDecl::ivar_iterator I = CDecl->ivar_begin(),
- E = CDecl->ivar_end(); I != E; ++I) {
- ObjCIvarDecl *Iv = (*I);
- if (const RecordType *RT = Iv->getType()->getAs<RecordType>()) {
- if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(RT->getDecl()))
- if (construct && !RD->hasTrivialConstructor() ||
- !construct && !RD->hasTrivialDestructor())
- Ivars.push_back(*I);
- }
- }
- }
-
- // Also add any ivar defined in this class's implementation. This
- // includes synthesized ivars.
- if (ObjCImplementationDecl *ImplDecl = OI->getImplementation()) {
- for (ObjCImplementationDecl::ivar_iterator I = ImplDecl->ivar_begin(),
- E = ImplDecl->ivar_end(); I != E; ++I) {
- ObjCIvarDecl *Iv = (*I);
- if (const RecordType *RT = Iv->getType()->getAs<RecordType>()) {
- if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(RT->getDecl()))
- if (construct && !RD->hasTrivialConstructor() ||
- !construct && !RD->hasTrivialDestructor())
- Ivars.push_back(*I);
- }
- }
- }
-}
-
unsigned ASTContext::CountNonClassIvars(const ObjCInterfaceDecl *OI) {
unsigned count = 0;
// Count ivars declared in class extension.
OpenPOWER on IntegriCloud