@@ -3277,6 +3277,7 @@ class AssociatedTypeDecl : public AbstractTypeParamDecl {
32773277};
32783278
32793279class MemberLookupTable ;
3280+ class ObjCMethodLookupTable ;
32803281class ConformanceLookupTable ;
32813282
32823283// Kinds of pointer types.
@@ -3382,6 +3383,12 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33823383 getSatisfiedProtocolRequirementsForMember (const ValueDecl *Member,
33833384 bool Sorted) const ;
33843385
3386+ ObjCMethodLookupTable *ObjCMethodLookup = nullptr ;
3387+
3388+ // / Create the Objective-C method lookup table, or return \c false if this
3389+ // / kind of type cannot have Objective-C methods.
3390+ bool createObjCMethodLookup ();
3391+
33853392 friend class ASTContext ;
33863393 friend class MemberLookupTable ;
33873394 friend class ConformanceLookupTable ;
@@ -3531,6 +3538,24 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
35313538
35323539 void setConformanceLoader (LazyMemberLoader *resolver, uint64_t contextData);
35333540
3541+ // / Look in this type and its extensions (but not any of its protocols or
3542+ // / superclasses) for declarations with a given Objective-C selector.
3543+ // /
3544+ // / Note that this can find methods, initializers, deinitializers,
3545+ // / getters, and setters.
3546+ // /
3547+ // / \param selector The Objective-C selector of the method we're
3548+ // / looking for.
3549+ // /
3550+ // / \param isInstance Whether we are looking for an instance method
3551+ // / (vs. a class method).
3552+ TinyPtrVector<AbstractFunctionDecl *> lookupDirect (ObjCSelector selector,
3553+ bool isInstance);
3554+
3555+ // / Record the presence of an @objc method with the given selector. No-op if
3556+ // / the type is of a kind which cannot contain @objc methods.
3557+ void recordObjCMethod (AbstractFunctionDecl *method, ObjCSelector selector);
3558+
35343559 // / Is this the decl for Optional<T>?
35353560 bool isOptionalDecl () const ;
35363561
@@ -3954,13 +3979,7 @@ using AncestryOptions = OptionSet<AncestryFlags>;
39543979// / The type of the decl itself is a MetatypeType; use getDeclaredType()
39553980// / to get the declared type ("Complex" in the above example).
39563981class ClassDecl final : public NominalTypeDecl {
3957- class ObjCMethodLookupTable ;
3958-
39593982 SourceLoc ClassLoc;
3960- ObjCMethodLookupTable *ObjCMethodLookup = nullptr ;
3961-
3962- // / Create the Objective-C member lookup table.
3963- void createObjCMethodLookup ();
39643983
39653984 struct {
39663985 // / The superclass decl and a bit to indicate whether the
@@ -4225,25 +4244,6 @@ class ClassDecl final : public NominalTypeDecl {
42254244 // / the Objective-C runtime.
42264245 StringRef getObjCRuntimeName (llvm::SmallVectorImpl<char > &buffer) const ;
42274246
4228- using NominalTypeDecl::lookupDirect;
4229-
4230- // / Look in this class and its extensions (but not any of its protocols or
4231- // / superclasses) for declarations with a given Objective-C selector.
4232- // /
4233- // / Note that this can find methods, initializers, deinitializers,
4234- // / getters, and setters.
4235- // /
4236- // / \param selector The Objective-C selector of the method we're
4237- // / looking for.
4238- // /
4239- // / \param isInstance Whether we are looking for an instance method
4240- // / (vs. a class method).
4241- TinyPtrVector<AbstractFunctionDecl *> lookupDirect (ObjCSelector selector,
4242- bool isInstance);
4243-
4244- // / Record the presence of an @objc method with the given selector.
4245- void recordObjCMethod (AbstractFunctionDecl *method, ObjCSelector selector);
4246-
42474247 // Implement isa/cast/dyncast/etc.
42484248 static bool classof (const Decl *D) {
42494249 return D->getKind () == DeclKind::Class;
0 commit comments