diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGObjCGNU.cpp | 24 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 50 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
3 files changed, 51 insertions, 32 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp index 2cf73b64832..98102ae9cd3 100644 --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/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); diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index d8ffbbe0de4..cf15d2e62c5 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -1764,13 +1764,15 @@ void CGObjCMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) { OCD->getNameAsString()); std::vector<llvm::Constant*> InstanceMethods, ClassMethods; - for (ObjCCategoryImplDecl::instmeth_iterator i = OCD->instmeth_begin(), - e = OCD->instmeth_end(); i != e; ++i) { + for (ObjCCategoryImplDecl::instmeth_iterator + i = OCD->instmeth_begin(CGM.getContext()), + e = OCD->instmeth_end(CGM.getContext()); i != e; ++i) { // Instance methods should always be defined. InstanceMethods.push_back(GetMethodConstant(*i)); } - for (ObjCCategoryImplDecl::classmeth_iterator i = OCD->classmeth_begin(), - e = OCD->classmeth_end(); i != e; ++i) { + for (ObjCCategoryImplDecl::classmeth_iterator + i = OCD->classmeth_begin(CGM.getContext()), + e = OCD->classmeth_end(CGM.getContext()); i != e; ++i) { // Class methods should always be defined. ClassMethods.push_back(GetMethodConstant(*i)); } @@ -1865,19 +1867,22 @@ void CGObjCMac::GenerateClass(const ObjCImplementationDecl *ID) { Flags |= eClassFlags_Hidden; std::vector<llvm::Constant*> InstanceMethods, ClassMethods; - for (ObjCImplementationDecl::instmeth_iterator i = ID->instmeth_begin(), - e = ID->instmeth_end(); i != e; ++i) { + for (ObjCImplementationDecl::instmeth_iterator + i = ID->instmeth_begin(CGM.getContext()), + e = ID->instmeth_end(CGM.getContext()); i != e; ++i) { // Instance methods should always be defined. InstanceMethods.push_back(GetMethodConstant(*i)); } - for (ObjCImplementationDecl::classmeth_iterator i = ID->classmeth_begin(), - e = ID->classmeth_end(); i != e; ++i) { + for (ObjCImplementationDecl::classmeth_iterator + i = ID->classmeth_begin(CGM.getContext()), + e = ID->classmeth_end(CGM.getContext()); i != e; ++i) { // Class methods should always be defined. ClassMethods.push_back(GetMethodConstant(*i)); } - for (ObjCImplementationDecl::propimpl_iterator i = ID->propimpl_begin(), - e = ID->propimpl_end(); i != e; ++i) { + for (ObjCImplementationDecl::propimpl_iterator + i = ID->propimpl_begin(CGM.getContext()), + e = ID->propimpl_end(CGM.getContext()); i != e; ++i) { ObjCPropertyImplDecl *PID = *i; if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize) { @@ -4169,20 +4174,23 @@ llvm::GlobalVariable * CGObjCNonFragileABIMac::BuildClassRoTInitializer( std::string MethodListName("\01l_OBJC_$_"); if (flags & CLS_META) { MethodListName += "CLASS_METHODS_" + ID->getNameAsString(); - for (ObjCImplementationDecl::classmeth_iterator i = ID->classmeth_begin(), - e = ID->classmeth_end(); i != e; ++i) { + for (ObjCImplementationDecl::classmeth_iterator + i = ID->classmeth_begin(CGM.getContext()), + e = ID->classmeth_end(CGM.getContext()); i != e; ++i) { // Class methods should always be defined. Methods.push_back(GetMethodConstant(*i)); } } else { MethodListName += "INSTANCE_METHODS_" + ID->getNameAsString(); - for (ObjCImplementationDecl::instmeth_iterator i = ID->instmeth_begin(), - e = ID->instmeth_end(); i != e; ++i) { + for (ObjCImplementationDecl::instmeth_iterator + i = ID->instmeth_begin(CGM.getContext()), + e = ID->instmeth_end(CGM.getContext()); i != e; ++i) { // Instance methods should always be defined. Methods.push_back(GetMethodConstant(*i)); } - for (ObjCImplementationDecl::propimpl_iterator i = ID->propimpl_begin(), - e = ID->propimpl_end(); i != e; ++i) { + for (ObjCImplementationDecl::propimpl_iterator + i = ID->propimpl_begin(CGM.getContext()), + e = ID->propimpl_end(CGM.getContext()); i != e; ++i) { ObjCPropertyImplDecl *PID = *i; if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize){ @@ -4466,8 +4474,9 @@ void CGObjCNonFragileABIMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) MethodListName += "INSTANCE_METHODS_" + Interface->getNameAsString() + "_$_" + OCD->getNameAsString(); - for (ObjCCategoryImplDecl::instmeth_iterator i = OCD->instmeth_begin(), - e = OCD->instmeth_end(); i != e; ++i) { + for (ObjCCategoryImplDecl::instmeth_iterator + i = OCD->instmeth_begin(CGM.getContext()), + e = OCD->instmeth_end(CGM.getContext()); i != e; ++i) { // Instance methods should always be defined. Methods.push_back(GetMethodConstant(*i)); } @@ -4480,8 +4489,9 @@ void CGObjCNonFragileABIMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) MethodListName += "CLASS_METHODS_" + Interface->getNameAsString() + "_$_" + OCD->getNameAsString(); Methods.clear(); - for (ObjCCategoryImplDecl::classmeth_iterator i = OCD->classmeth_begin(), - e = OCD->classmeth_end(); i != e; ++i) { + for (ObjCCategoryImplDecl::classmeth_iterator + i = OCD->classmeth_begin(CGM.getContext()), + e = OCD->classmeth_end(CGM.getContext()); i != e; ++i) { // Class methods should always be defined. Methods.push_back(GetMethodConstant(*i)); } 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<ObjCImplementationDecl *>(D), PID); if (!PD->isReadOnly() && - !D->getInstanceMethod(PD->getSetterName())) + !D->getInstanceMethod(getContext(), PD->getSetterName())) CodeGenFunction(*this).GenerateObjCSetter( const_cast<ObjCImplementationDecl *>(D), PID); } |