diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-23 01:02:12 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-23 01:02:12 +0000 |
commit | 653f1b1bf293a9bd96fd4dd6372e779cc7af1597 (patch) | |
tree | 8f4f4bbb5f2d6fa627550d8d8c94d5ec5e059b39 /lib/CodeGen/CGObjCGNU.cpp | |
parent | 70e5a14c6076d63833c62d1d6d628c26309897c1 (diff) |
Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.
This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCGNU.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 2cf73b6483..98102ae9cd 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -671,8 +671,10 @@ void CGObjCGNU::GenerateCategory(const ObjCCategoryImplDecl *OCD) { // Collect information about instance methods llvm::SmallVector<Selector, 16> InstanceMethodSels; llvm::SmallVector<llvm::Constant*, 16> InstanceMethodTypes; - for (ObjCCategoryImplDecl::instmeth_iterator iter = OCD->instmeth_begin(), - endIter = OCD->instmeth_end() ; iter != endIter ; iter++) { + for (ObjCCategoryImplDecl::instmeth_iterator + iter = OCD->instmeth_begin(CGM.getContext()), + endIter = OCD->instmeth_end(CGM.getContext()); + iter != endIter ; iter++) { InstanceMethodSels.push_back((*iter)->getSelector()); std::string TypeStr; CGM.getContext().getObjCEncodingForMethodDecl(*iter,TypeStr); @@ -682,8 +684,10 @@ void CGObjCGNU::GenerateCategory(const ObjCCategoryImplDecl *OCD) { // Collect information about class methods llvm::SmallVector<Selector, 16> ClassMethodSels; llvm::SmallVector<llvm::Constant*, 16> ClassMethodTypes; - for (ObjCCategoryImplDecl::classmeth_iterator iter = OCD->classmeth_begin(), - endIter = OCD->classmeth_end() ; iter != endIter ; iter++) { + for (ObjCCategoryImplDecl::classmeth_iterator + iter = OCD->classmeth_begin(CGM.getContext()), + endIter = OCD->classmeth_end(CGM.getContext()); + iter != endIter ; iter++) { ClassMethodSels.push_back((*iter)->getSelector()); std::string TypeStr; CGM.getContext().getObjCEncodingForMethodDecl(*iter,TypeStr); @@ -761,8 +765,10 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) { // Collect information about instance methods llvm::SmallVector<Selector, 16> InstanceMethodSels; llvm::SmallVector<llvm::Constant*, 16> InstanceMethodTypes; - for (ObjCImplementationDecl::instmeth_iterator iter = OID->instmeth_begin(), - endIter = OID->instmeth_end() ; iter != endIter ; iter++) { + for (ObjCImplementationDecl::instmeth_iterator + iter = OID->instmeth_begin(CGM.getContext()), + endIter = OID->instmeth_end(CGM.getContext()); + iter != endIter ; iter++) { InstanceMethodSels.push_back((*iter)->getSelector()); std::string TypeStr; Context.getObjCEncodingForMethodDecl((*iter),TypeStr); @@ -772,8 +778,10 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) { // Collect information about class methods llvm::SmallVector<Selector, 16> ClassMethodSels; llvm::SmallVector<llvm::Constant*, 16> ClassMethodTypes; - for (ObjCImplementationDecl::classmeth_iterator iter = OID->classmeth_begin(), - endIter = OID->classmeth_end() ; iter != endIter ; iter++) { + for (ObjCImplementationDecl::classmeth_iterator + iter = OID->classmeth_begin(CGM.getContext()), + endIter = OID->classmeth_end(CGM.getContext()); + iter != endIter ; iter++) { ClassMethodSels.push_back((*iter)->getSelector()); std::string TypeStr; Context.getObjCEncodingForMethodDecl((*iter),TypeStr); |