From 29bd76fd040dea09fe65ee9eabd0fd7d5149e916 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 23 Apr 2009 01:02:12 +0000 Subject: 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). llvm-svn: 69849 --- clang/lib/CodeGen/CodeGenModule.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 0247b693faf..c07eac993be 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1292,8 +1292,9 @@ llvm::Constant *CodeGenModule::GetAddrOfConstantCString(const std::string &str, /// properties for an implementation. void CodeGenModule::EmitObjCPropertyImplementations(const ObjCImplementationDecl *D) { - for (ObjCImplementationDecl::propimpl_iterator i = D->propimpl_begin(), - e = D->propimpl_end(); i != e; ++i) { + for (ObjCImplementationDecl::propimpl_iterator + i = D->propimpl_begin(getContext()), + e = D->propimpl_end(getContext()); i != e; ++i) { ObjCPropertyImplDecl *PID = *i; // Dynamic is just for type-checking. @@ -1305,11 +1306,11 @@ void CodeGenModule::EmitObjCPropertyImplementations(const // we want, that just indicates if the decl came from a // property. What we want to know is if the method is defined in // this implementation. - if (!D->getInstanceMethod(PD->getGetterName())) + if (!D->getInstanceMethod(getContext(), PD->getGetterName())) CodeGenFunction(*this).GenerateObjCGetter( const_cast(D), PID); if (!PD->isReadOnly() && - !D->getInstanceMethod(PD->getSetterName())) + !D->getInstanceMethod(getContext(), PD->getSetterName())) CodeGenFunction(*this).GenerateObjCSetter( const_cast(D), PID); } -- cgit v1.2.3