diff --git a/clang/Sema/Sema.h b/clang/Sema/Sema.h index c4ad75be86c8..70997b0ae42d 100644 --- a/clang/Sema/Sema.h +++ b/clang/Sema/Sema.h @@ -220,7 +220,7 @@ private: /// Declared in protocol, and those referenced by it. void CheckProtocolMethodDefs(ObjcProtocolDecl *PDecl, bool& IncompleteImpl, - const llvm::DenseSet& InsMap, + const llvm::DenseSet &InsMap, const llvm::DenseSet &ClsMap); /// CheckImplementationIvars - This routine checks if the instance variables diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp index 574f1f616674..3eb50ff08f3e 100644 --- a/clang/Sema/SemaDecl.cpp +++ b/clang/Sema/SemaDecl.cpp @@ -1240,13 +1240,12 @@ void Sema::CheckImplementationIvars(ObjcImplementationDecl *ImpDecl, /// Declared in protocol, and those referenced by it. void Sema::CheckProtocolMethodDefs(ObjcProtocolDecl *PDecl, bool& IncompleteImpl, - const llvm::DenseSet& InsMap, + const llvm::DenseSet &InsMap, const llvm::DenseSet &ClsMap) { // check unimplemented instance methods. ObjcMethodDecl** methods = PDecl->getInstanceMethods(); for (int j = 0; j < PDecl->getNumInstanceMethods(); j++) { - void * cpv = methods[j]->getSelector().getAsOpaquePtr(); - if (!InsMap.count(cpv)) { + if (!InsMap.count(methods[j]->getSelector())) { Diag(methods[j]->getLocation(), diag::warn_undef_method_impl, methods[j]->getSelector().getName()); IncompleteImpl = true; @@ -1269,17 +1268,17 @@ void Sema::CheckProtocolMethodDefs(ObjcProtocolDecl *PDecl, void Sema::ImplMethodsVsClassMethods(ObjcImplementationDecl* IMPDecl, ObjcInterfaceDecl* IDecl) { - llvm::DenseSet InsMap; + llvm::DenseSet InsMap; // Check and see if instance methods in class interface have been // implemented in the implementation class. ObjcMethodDecl **methods = IMPDecl->getInstanceMethods(); for (int i=0; i < IMPDecl->getNumInstanceMethods(); i++) - InsMap.insert(methods[i]->getSelector().getAsOpaquePtr()); + InsMap.insert(methods[i]->getSelector()); bool IncompleteImpl = false; methods = IDecl->getInstanceMethods(); for (int j = 0; j < IDecl->getNumInstanceMethods(); j++) - if (!InsMap.count(methods[j]->getSelector().getAsOpaquePtr())) { + if (!InsMap.count(methods[j]->getSelector())) { Diag(methods[j]->getLocation(), diag::warn_undef_method_impl, methods[j]->getSelector().getName()); IncompleteImpl = true; @@ -1314,17 +1313,17 @@ void Sema::ImplMethodsVsClassMethods(ObjcImplementationDecl* IMPDecl, /// category interface is implemented in the category @implementation. void Sema::ImplCategoryMethodsVsIntfMethods(ObjcCategoryImplDecl *CatImplDecl, ObjcCategoryDecl *CatClassDecl) { - llvm::DenseSet InsMap; + llvm::DenseSet InsMap; // Check and see if instance methods in category interface have been // implemented in its implementation class. ObjcMethodDecl **methods = CatImplDecl->getInstanceMethods(); for (int i=0; i < CatImplDecl->getNumInstanceMethods(); i++) - InsMap.insert(methods[i]->getSelector().getAsOpaquePtr()); + InsMap.insert(methods[i]->getSelector()); bool IncompleteImpl = false; methods = CatClassDecl->getInstanceMethods(); for (int j = 0; j < CatClassDecl->getNumInstanceMethods(); j++) - if (!InsMap.count(methods[j]->getSelector().getAsOpaquePtr())) { + if (!InsMap.count(methods[j]->getSelector())) { Diag(methods[j]->getLocation(), diag::warn_undef_method_impl, methods[j]->getSelector().getName()); IncompleteImpl = true; @@ -1725,8 +1724,8 @@ void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl, llvm::SmallVector insMethods; llvm::SmallVector clsMethods; - llvm::DenseMap InsMap; - llvm::DenseMap ClsMap; + llvm::DenseMap InsMap; + llvm::DenseMap ClsMap; bool isClassDeclaration = (isa(ClassDecl) || isa(ClassDecl)); @@ -1738,8 +1737,7 @@ void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl, if (Method->isInstance()) { if (isClassDeclaration) { /// Check for instance method of the same name with incompatible types - const ObjcMethodDecl *&PrevMethod = - InsMap[Method->getSelector().getAsOpaquePtr()]; + const ObjcMethodDecl *&PrevMethod = InsMap[Method->getSelector()]; if (PrevMethod && !MatchTwoMethodDeclarations(Method, PrevMethod)) { Diag(Method->getLocation(), diag::error_duplicate_method_decl, Method->getSelector().getName()); @@ -1747,7 +1745,7 @@ void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl, } else { insMethods.push_back(Method); - InsMap[Method->getSelector().getAsOpaquePtr()] = Method; + InsMap[Method->getSelector()] = Method; } } else @@ -1756,8 +1754,7 @@ void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl, else { if (isClassDeclaration) { /// Check for class method of the same name with incompatible types - const ObjcMethodDecl *&PrevMethod = - ClsMap[Method->getSelector().getAsOpaquePtr()]; + const ObjcMethodDecl *&PrevMethod = ClsMap[Method->getSelector()]; if (PrevMethod && !MatchTwoMethodDeclarations(Method, PrevMethod)) { Diag(Method->getLocation(), diag::error_duplicate_method_decl, Method->getSelector().getName()); @@ -1765,7 +1762,7 @@ void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl, } else { clsMethods.push_back(Method); - ClsMap[Method->getSelector().getAsOpaquePtr()] = Method; + ClsMap[Method->getSelector()] = Method; } } else diff --git a/clang/clang.xcodeproj/project.pbxproj b/clang/clang.xcodeproj/project.pbxproj index 8ef2cff31309..c8f45dacb1b7 100644 --- a/clang/clang.xcodeproj/project.pbxproj +++ b/clang/clang.xcodeproj/project.pbxproj @@ -237,7 +237,7 @@ 84AF36A00CB17A3B00C820A5 /* DeclObjC.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DeclObjC.h; path = clang/AST/DeclObjC.h; sourceTree = ""; }; 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AttributeList.cpp; path = Parse/AttributeList.cpp; sourceTree = ""; }; 84D9A88B0C1A581300AC7ABC /* AttributeList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AttributeList.h; path = clang/Parse/AttributeList.h; sourceTree = ""; }; - 8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clang; sourceTree = BUILT_PRODUCTS_DIR; }; + 8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = clang; sourceTree = BUILT_PRODUCTS_DIR; }; DE01DA480B12ADA300AC22CE /* PPCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCallbacks.h; sourceTree = ""; }; DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExprCXX.cpp; path = Parse/ParseExprCXX.cpp; sourceTree = ""; }; DE06B73D0A8307640050E87E /* LangOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LangOptions.h; sourceTree = ""; }; @@ -739,7 +739,6 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; - compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* clang */; projectDirPath = "";