diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-11 00:26:36 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-11 00:26:36 +0000 |
commit | 737061fc2948776f941e1854a9bc6ebd070d9151 (patch) | |
tree | 3a235b0ddada6ae5aa21426940674f208a666acd /lib | |
parent | 23b7217c24891020e48cea9188cc6b512bdaa84d (diff) |
Patch to fix a crash trying to access a category name in
objective-c++ mode and also removed dead-code in this area.
(fixes radar 7456710).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91081 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/DeclBase.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/Sema.h | 6 | ||||
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 15 |
3 files changed, 3 insertions, 22 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 2022b4a28c..3afb4e44f3 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -198,7 +198,6 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) { case NonTypeTemplateParm: case ObjCMethod: case ObjCContainer: - case ObjCCategory: case ObjCInterface: case ObjCProperty: case ObjCCompatibleAlias: @@ -220,8 +219,9 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) { case ObjCImplementation: return IDNS_ObjCImplementation; + case ObjCCategory: case ObjCCategoryImpl: - return IDNS_ObjCCategoryImpl; + return IDNS_ObjCCategoryName; case Field: case ObjCAtDefsField: diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 7b030cbe93..88de8da2b3 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -1136,9 +1136,7 @@ public: /// Look up the name of an Objective-C protocol. LookupObjCProtocolName, /// Look up the name of an Objective-C implementation - LookupObjCImplementationName, - /// Look up the name of an Objective-C category implementation - LookupObjCCategoryImplName + LookupObjCImplementationName }; enum RedeclarationKind { @@ -1162,7 +1160,6 @@ public: case Sema::LookupUsingDeclName: case Sema::LookupObjCProtocolName: case Sema::LookupObjCImplementationName: - case Sema::LookupObjCCategoryImplName: return D->isInIdentifierNamespace(IDNS); case Sema::LookupOperatorName: @@ -1198,7 +1195,6 @@ public: bool EnteringContext = false); ObjCProtocolDecl *LookupProtocol(IdentifierInfo *II); - ObjCCategoryImplDecl *LookupObjCCategoryImpl(IdentifierInfo *II); void LookupOverloadedOperatorName(OverloadedOperatorKind Op, Scope *S, QualType T1, QualType T2, diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 66c846b078..7428e941d5 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -234,10 +234,6 @@ getIdentifierNamespacesFromLookupNameKind(Sema::LookupNameKind NameKind, case Sema::LookupObjCImplementationName: IDNS = Decl::IDNS_ObjCImplementation; break; - - case Sema::LookupObjCCategoryImplName: - IDNS = Decl::IDNS_ObjCCategoryImpl; - break; } return IDNS; } @@ -640,9 +636,6 @@ bool Sema::LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation) { IDNS = Decl::IDNS_ObjCImplementation; break; - case Sema::LookupObjCCategoryImplName: - IDNS = Decl::IDNS_ObjCCategoryImpl; - break; } // Scan up the scope chain looking for a decl that matches this @@ -942,7 +935,6 @@ bool Sema::LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx) { case LookupNamespaceName: case LookupObjCProtocolName: case LookupObjCImplementationName: - case LookupObjCCategoryImplName: // These lookups will never find a member in a C++ class (or base class). return false; @@ -1592,13 +1584,6 @@ ObjCProtocolDecl *Sema::LookupProtocol(IdentifierInfo *II) { return cast_or_null<ObjCProtocolDecl>(D); } -/// \brief Find the Objective-C category implementation with the given -/// name, if any. -ObjCCategoryImplDecl *Sema::LookupObjCCategoryImpl(IdentifierInfo *II) { - Decl *D = LookupSingleName(TUScope, II, LookupObjCCategoryImplName); - return cast_or_null<ObjCCategoryImplDecl>(D); -} - void Sema::LookupOverloadedOperatorName(OverloadedOperatorKind Op, Scope *S, QualType T1, QualType T2, FunctionSet &Functions) { |