diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index 7b743edf94525..6f2c5b96554a9 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/include/clang/AST/DeclBase.h @@ -1428,6 +1428,8 @@ enum class OMPDeclareReductionInitKind { Copy // omp_priv = }; +enum class ObjCImplementationControl { None, Required, Optional }; + /// DeclContext - This is used only as base class of specific decl types that /// can act as declaration contexts. These decls are (only the top classes /// that directly derive from DeclContext are mentioned, not their subclasses): diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index ee8ec7a6a016b..2b205bee51de1 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -139,10 +139,6 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { // This class stores some data in DeclContext::ObjCMethodDeclBits // to save some space. Use the provided accessors to access it. -public: - enum ImplementationControl { None, Required, Optional }; - -private: /// Return type of this method. QualType MethodDeclType; @@ -168,14 +164,14 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { /// constructed by createImplicitParams. ImplicitParamDecl *CmdDecl = nullptr; - ObjCMethodDecl(SourceLocation beginLoc, SourceLocation endLoc, - Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, - DeclContext *contextDecl, bool isInstance = true, - bool isVariadic = false, bool isPropertyAccessor = false, - bool isSynthesizedAccessorStub = false, - bool isImplicitlyDeclared = false, bool isDefined = false, - ImplementationControl impControl = None, - bool HasRelatedResultType = false); + ObjCMethodDecl( + SourceLocation beginLoc, SourceLocation endLoc, Selector SelInfo, + QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, + bool isInstance = true, bool isVariadic = false, + bool isPropertyAccessor = false, bool isSynthesizedAccessorStub = false, + bool isImplicitlyDeclared = false, bool isDefined = false, + ObjCImplementationControl impControl = ObjCImplementationControl::None, + bool HasRelatedResultType = false); SelectorLocationsKind getSelLocsKind() const { return static_cast(ObjCMethodDeclBits.SelLocsKind); @@ -235,7 +231,7 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { bool isVariadic = false, bool isPropertyAccessor = false, bool isSynthesizedAccessorStub = false, bool isImplicitlyDeclared = false, bool isDefined = false, - ImplementationControl impControl = None, + ObjCImplementationControl impControl = ObjCImplementationControl::None, bool HasRelatedResultType = false); static ObjCMethodDecl *CreateDeserialized(ASTContext &C, unsigned ID); @@ -495,16 +491,17 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { const ObjCPropertyDecl *findPropertyDecl(bool CheckOverrides = true) const; // Related to protocols declared in \@protocol - void setDeclImplementation(ImplementationControl ic) { - ObjCMethodDeclBits.DeclImplementation = ic; + void setDeclImplementation(ObjCImplementationControl ic) { + ObjCMethodDeclBits.DeclImplementation = llvm::to_underlying(ic); } - ImplementationControl getImplementationControl() const { - return ImplementationControl(ObjCMethodDeclBits.DeclImplementation); + ObjCImplementationControl getImplementationControl() const { + return static_cast( + ObjCMethodDeclBits.DeclImplementation); } bool isOptional() const { - return getImplementationControl() == Optional; + return getImplementationControl() == ObjCImplementationControl::Optional; } /// Returns true if this specific method declaration is marked with the diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index 4fa4ab8d42b7d..5a25c88c65f64 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -636,7 +636,7 @@ ClassImplementsAllMethodsAndProperties(ASTContext &Ctx, for (const auto *MD : PDecl->methods()) { if (MD->isImplicit()) continue; - if (MD->getImplementationControl() == ObjCMethodDecl::Optional) + if (MD->getImplementationControl() == ObjCImplementationControl::Optional) continue; DeclContext::lookup_result R = ImpDecl->lookup(MD->getDeclName()); if (R.empty()) diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index e1eef2dbd9c3d..2c88d05dc07ea 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -825,7 +825,7 @@ ObjCMethodDecl::ObjCMethodDecl( QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance, bool isVariadic, bool isPropertyAccessor, bool isSynthesizedAccessorStub, bool isImplicitlyDeclared, bool isDefined, - ImplementationControl impControl, bool HasRelatedResultType) + ObjCImplementationControl impControl, bool HasRelatedResultType) : NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo), DeclContext(ObjCMethod), MethodDeclType(T), ReturnTInfo(ReturnTInfo), DeclEndLoc(endLoc) { @@ -855,8 +855,8 @@ ObjCMethodDecl *ObjCMethodDecl::Create( Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance, bool isVariadic, bool isPropertyAccessor, bool isSynthesizedAccessorStub, - bool isImplicitlyDeclared, bool isDefined, ImplementationControl impControl, - bool HasRelatedResultType) { + bool isImplicitlyDeclared, bool isDefined, + ObjCImplementationControl impControl, bool HasRelatedResultType) { return new (C, contextDecl) ObjCMethodDecl( beginLoc, endLoc, SelInfo, T, ReturnTInfo, contextDecl, isInstance, isVariadic, isPropertyAccessor, isSynthesizedAccessorStub, diff --git a/clang/lib/AST/ODRDiagsEmitter.cpp b/clang/lib/AST/ODRDiagsEmitter.cpp index 0189a5de625e0..9dcd2ed04f6f7 100644 --- a/clang/lib/AST/ODRDiagsEmitter.cpp +++ b/clang/lib/AST/ODRDiagsEmitter.cpp @@ -461,8 +461,10 @@ bool ODRDiagsEmitter::diagnoseSubMismatchObjCMethod( } if (FirstMethod->getImplementationControl() != SecondMethod->getImplementationControl()) { - DiagError(ControlLevel) << FirstMethod->getImplementationControl(); - DiagNote(ControlLevel) << SecondMethod->getImplementationControl(); + DiagError(ControlLevel) + << llvm::to_underlying(FirstMethod->getImplementationControl()); + DiagNote(ControlLevel) << llvm::to_underlying( + SecondMethod->getImplementationControl()); return true; } if (FirstMethod->isThisDeclarationADesignatedInitializer() != diff --git a/clang/lib/AST/ODRHash.cpp b/clang/lib/AST/ODRHash.cpp index e728c47ade788..f04dcef18a36e 100644 --- a/clang/lib/AST/ODRHash.cpp +++ b/clang/lib/AST/ODRHash.cpp @@ -380,7 +380,7 @@ class ODRDeclVisitor : public ConstDeclVisitor { Hash.AddBoolean(Method->isThisDeclarationADesignatedInitializer()); Hash.AddBoolean(Method->hasSkippedBody()); - ID.AddInteger(Method->getImplementationControl()); + ID.AddInteger(llvm::to_underlying(Method->getImplementationControl())); ID.AddInteger(Method->getMethodFamily()); ImplicitParamDecl *Cmd = Method->getCmdDecl(); Hash.AddBoolean(Cmd); diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 4203a6218aba6..5b80478d2265c 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -6485,7 +6485,7 @@ void CodeGenModule::EmitObjCIvarInitializations(ObjCImplementationDecl *D) { /*isInstance=*/true, /*isVariadic=*/false, /*isPropertyAccessor=*/true, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, - /*isDefined=*/false, ObjCMethodDecl::Required); + /*isDefined=*/false, ObjCImplementationControl::Required); D->addInstanceMethod(DTORMethod); CodeGenFunction(*this).GenerateObjCCtorDtorMethod(D, DTORMethod, false); D->setHasDestructors(true); @@ -6506,7 +6506,7 @@ void CodeGenModule::EmitObjCIvarInitializations(ObjCImplementationDecl *D) { /*isVariadic=*/false, /*isPropertyAccessor=*/true, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, - /*isDefined=*/false, ObjCMethodDecl::Required); + /*isDefined=*/false, ObjCImplementationControl::Required); D->addInstanceMethod(CTORMethod); CodeGenFunction(*this).GenerateObjCCtorDtorMethod(D, CTORMethod, true); D->setHasNonZeroConstructors(true); diff --git a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp index 4b961e036fcdd..c645355d5aecd 100644 --- a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -6855,7 +6855,7 @@ void RewriteModernObjC::RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl, std::vector InstanceMethods, ClassMethods; std::vector OptInstanceMethods, OptClassMethods; for (auto *MD : PDecl->instance_methods()) { - if (MD->getImplementationControl() == ObjCMethodDecl::Optional) { + if (MD->getImplementationControl() == ObjCImplementationControl::Optional) { OptInstanceMethods.push_back(MD); } else { InstanceMethods.push_back(MD); @@ -6863,7 +6863,7 @@ void RewriteModernObjC::RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl, } for (auto *MD : PDecl->class_methods()) { - if (MD->getImplementationControl() == ObjCMethodDecl::Optional) { + if (MD->getImplementationControl() == ObjCImplementationControl::Optional) { OptClassMethods.push_back(MD); } else { ClassMethods.push_back(MD); diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index fdfc6d312b387..8685838157b5c 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -2632,7 +2632,8 @@ void Sema::WarnExactTypedMethods(ObjCMethodDecl *ImpMethodDecl, // don't issue warning when protocol method is optional because primary // class is not required to implement it and it is safe for protocol // to implement it. - if (MethodDecl->getImplementationControl() == ObjCMethodDecl::Optional) + if (MethodDecl->getImplementationControl() == + ObjCImplementationControl::Optional) return; // don't issue warning when primary class's method is // deprecated/unavailable. @@ -2765,45 +2766,43 @@ static void CheckProtocolMethodDefs( // check unimplemented instance methods. if (!NSIDecl) for (auto *method : PDecl->instance_methods()) { - if (method->getImplementationControl() != ObjCMethodDecl::Optional && + if (method->getImplementationControl() != + ObjCImplementationControl::Optional && !method->isPropertyAccessor() && !InsMap.count(method->getSelector()) && - (!Super || !Super->lookupMethod(method->getSelector(), - true /* instance */, - false /* shallowCategory */, - true /* followsSuper */, - nullptr /* category */))) { - // If a method is not implemented in the category implementation but - // has been declared in its primary class, superclass, - // or in one of their protocols, no need to issue the warning. - // This is because method will be implemented in the primary class - // or one of its super class implementation. - - // Ugly, but necessary. Method declared in protocol might have - // have been synthesized due to a property declared in the class which - // uses the protocol. - if (ObjCMethodDecl *MethodInClass = - IDecl->lookupMethod(method->getSelector(), - true /* instance */, - true /* shallowCategoryLookup */, - false /* followSuper */)) - if (C || MethodInClass->isPropertyAccessor()) - continue; - unsigned DIAG = diag::warn_unimplemented_protocol_method; - if (!S.Diags.isIgnored(DIAG, Impl->getLocation())) { - WarnUndefinedMethod(S, Impl, method, IncompleteImpl, DIAG, PDecl); - } - } + (!Super || !Super->lookupMethod( + method->getSelector(), true /* instance */, + false /* shallowCategory */, true /* followsSuper */, + nullptr /* category */))) { + // If a method is not implemented in the category implementation but + // has been declared in its primary class, superclass, + // or in one of their protocols, no need to issue the warning. + // This is because method will be implemented in the primary class + // or one of its super class implementation. + + // Ugly, but necessary. Method declared in protocol might have + // have been synthesized due to a property declared in the class which + // uses the protocol. + if (ObjCMethodDecl *MethodInClass = IDecl->lookupMethod( + method->getSelector(), true /* instance */, + true /* shallowCategoryLookup */, false /* followSuper */)) + if (C || MethodInClass->isPropertyAccessor()) + continue; + unsigned DIAG = diag::warn_unimplemented_protocol_method; + if (!S.Diags.isIgnored(DIAG, Impl->getLocation())) { + WarnUndefinedMethod(S, Impl, method, IncompleteImpl, DIAG, PDecl); + } + } } // check unimplemented class methods for (auto *method : PDecl->class_methods()) { - if (method->getImplementationControl() != ObjCMethodDecl::Optional && + if (method->getImplementationControl() != + ObjCImplementationControl::Optional && !ClsMap.count(method->getSelector()) && - (!Super || !Super->lookupMethod(method->getSelector(), - false /* class method */, - false /* shallowCategoryLookup */, - true /* followSuper */, - nullptr /* category */))) { + (!Super || !Super->lookupMethod( + method->getSelector(), false /* class method */, + false /* shallowCategoryLookup */, + true /* followSuper */, nullptr /* category */))) { // See above comment for instance method lookups. if (C && IDecl->lookupMethod(method->getSelector(), false /* class */, @@ -4759,8 +4758,9 @@ Decl *Sema::ActOnMethodDeclaration( MethodType == tok::minus, isVariadic, /*isPropertyAccessor=*/false, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/false, /*isDefined=*/false, - MethodDeclKind == tok::objc_optional ? ObjCMethodDecl::Optional - : ObjCMethodDecl::Required, + MethodDeclKind == tok::objc_optional + ? ObjCImplementationControl::Optional + : ObjCImplementationControl::Required, HasRelatedResultType); SmallVector Params; diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 33e98bc2d6f71..172a3d7fee2fb 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -285,15 +285,15 @@ static ObjCMethodDecl *getNSNumberFactoryMethod(Sema &S, SourceLocation Loc, if (!Method && S.getLangOpts().DebuggerObjCLiteral) { // create a stub definition this NSNumber factory method. TypeSourceInfo *ReturnTInfo = nullptr; - Method = - ObjCMethodDecl::Create(CX, SourceLocation(), SourceLocation(), Sel, - S.NSNumberPointer, ReturnTInfo, S.NSNumberDecl, - /*isInstance=*/false, /*isVariadic=*/false, - /*isPropertyAccessor=*/false, - /*isSynthesizedAccessorStub=*/false, - /*isImplicitlyDeclared=*/true, - /*isDefined=*/false, ObjCMethodDecl::Required, - /*HasRelatedResultType=*/false); + Method = ObjCMethodDecl::Create( + CX, SourceLocation(), SourceLocation(), Sel, S.NSNumberPointer, + ReturnTInfo, S.NSNumberDecl, + /*isInstance=*/false, /*isVariadic=*/false, + /*isPropertyAccessor=*/false, + /*isSynthesizedAccessorStub=*/false, + /*isImplicitlyDeclared=*/true, + /*isDefined=*/false, ObjCImplementationControl::Required, + /*HasRelatedResultType=*/false); ParmVarDecl *value = ParmVarDecl::Create(S.Context, Method, SourceLocation(), SourceLocation(), &CX.Idents.get("value"), @@ -568,7 +568,7 @@ ExprResult Sema::BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr) { /*isPropertyAccessor=*/false, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, - /*isDefined=*/false, ObjCMethodDecl::Required, + /*isDefined=*/false, ObjCImplementationControl::Required, /*HasRelatedResultType=*/false); QualType ConstCharType = Context.CharTy.withConst(); ParmVarDecl *value = @@ -682,7 +682,7 @@ ExprResult Sema::BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr) { /*isPropertyAccessor=*/false, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, - /*isDefined=*/false, ObjCMethodDecl::Required, + /*isDefined=*/false, ObjCImplementationControl::Required, /*HasRelatedResultType=*/false); SmallVector Params; @@ -816,7 +816,7 @@ ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) { false /*isVariadic*/, /*isPropertyAccessor=*/false, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, /*isDefined=*/false, - ObjCMethodDecl::Required, false); + ObjCImplementationControl::Required, false); SmallVector Params; ParmVarDecl *objects = ParmVarDecl::Create(Context, Method, SourceLocation(), @@ -978,7 +978,7 @@ ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR, /*isPropertyAccessor=*/false, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, /*isDefined=*/false, - ObjCMethodDecl::Required, false); + ObjCImplementationControl::Required, false); SmallVector Params; ParmVarDecl *objects = ParmVarDecl::Create(Context, Method, SourceLocation(), @@ -1347,7 +1347,8 @@ ExprResult Sema::ParseObjCSelectorExpression(Selector Sel, } if (Method && - Method->getImplementationControl() != ObjCMethodDecl::Optional && + Method->getImplementationControl() != + ObjCImplementationControl::Optional && !getSourceManager().isInSystemHeader(Method->getLocation())) ReferencedSelectors.insert(std::make_pair(Sel, AtLoc)); diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 0381607f32bfe..22540af1cda8c 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -2488,8 +2488,8 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property) { /*isPropertyAccessor=*/true, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, /*isDefined=*/false, (property->getPropertyImplementation() == ObjCPropertyDecl::Optional) - ? ObjCMethodDecl::Optional - : ObjCMethodDecl::Required); + ? ObjCImplementationControl::Optional + : ObjCImplementationControl::Required); CD->addDecl(GetterMethod); AddPropertyAttrs(*this, GetterMethod, property); @@ -2530,19 +2530,17 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property) { // for this class. SourceLocation Loc = property->getLocation(); - SetterMethod = - ObjCMethodDecl::Create(Context, Loc, Loc, - property->getSetterName(), Context.VoidTy, - nullptr, CD, !IsClassProperty, - /*isVariadic=*/false, - /*isPropertyAccessor=*/true, - /*isSynthesizedAccessorStub=*/false, - /*isImplicitlyDeclared=*/true, - /*isDefined=*/false, - (property->getPropertyImplementation() == - ObjCPropertyDecl::Optional) ? - ObjCMethodDecl::Optional : - ObjCMethodDecl::Required); + SetterMethod = ObjCMethodDecl::Create( + Context, Loc, Loc, property->getSetterName(), Context.VoidTy, nullptr, + CD, !IsClassProperty, + /*isVariadic=*/false, + /*isPropertyAccessor=*/true, + /*isSynthesizedAccessorStub=*/false, + /*isImplicitlyDeclared=*/true, + /*isDefined=*/false, + (property->getPropertyImplementation() == ObjCPropertyDecl::Optional) + ? ObjCImplementationControl::Optional + : ObjCImplementationControl::Required); // Remove all qualifiers from the setter's parameter type. QualType paramTy = diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp index 1ac895e4eb1c8..528c261c4a297 100644 --- a/clang/lib/Sema/SemaPseudoObject.cpp +++ b/clang/lib/Sema/SemaPseudoObject.cpp @@ -1195,7 +1195,7 @@ bool ObjCSubscriptOpBuilder::findAtIndexGetter() { /*isPropertyAccessor=*/false, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, /*isDefined=*/false, - ObjCMethodDecl::Required, false); + ObjCImplementationControl::Required, false); ParmVarDecl *Argument = ParmVarDecl::Create(S.Context, AtIndexGetter, SourceLocation(), SourceLocation(), arrayRef ? &S.Context.Idents.get("index") @@ -1301,7 +1301,7 @@ bool ObjCSubscriptOpBuilder::findAtIndexSetter() { /*isPropertyAccessor=*/false, /*isSynthesizedAccessorStub=*/false, /*isImplicitlyDeclared=*/true, /*isDefined=*/false, - ObjCMethodDecl::Required, false); + ObjCImplementationControl::Required, false); SmallVector Params; ParmVarDecl *object = ParmVarDecl::Create(S.Context, AtIndexSetter, SourceLocation(), SourceLocation(), diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 94a678e0c4164..4b1d265d8250f 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -1151,7 +1151,8 @@ void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) { Reader.getContext().setObjCMethodRedeclaration(MD, readDeclAs()); - MD->setDeclImplementation((ObjCMethodDecl::ImplementationControl)Record.readInt()); + MD->setDeclImplementation( + static_cast(Record.readInt())); MD->setObjCDeclQualifier((Decl::ObjCDeclQualifier)Record.readInt()); MD->setRelatedResultType(Record.readInt()); MD->setReturnType(Record.readType()); diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index a91fde561d23a..9e1816e97b3fd 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -756,7 +756,7 @@ void ASTDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) { } // FIXME: stable encoding for @required/@optional - Record.push_back(D->getImplementationControl()); + Record.push_back(llvm::to_underlying(D->getImplementationControl())); // FIXME: stable encoding for in/out/inout/bycopy/byref/oneway/nullability Record.push_back(D->getObjCDeclQualifier()); Record.push_back(D->hasRelatedResultType()); diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 46226f4325b0a..169ce4f9b7c6a 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -8762,7 +8762,8 @@ unsigned clang_Cursor_isObjCOptional(CXCursor C) { if (const ObjCPropertyDecl *PD = dyn_cast(D)) return PD->getPropertyImplementation() == ObjCPropertyDecl::Optional; if (const ObjCMethodDecl *MD = dyn_cast(D)) - return MD->getImplementationControl() == ObjCMethodDecl::Optional; + return MD->getImplementationControl() == + ObjCImplementationControl::Optional; return 0; } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp index 2764a2aa39fa1..5d7c5f38d1805 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp @@ -311,8 +311,8 @@ class ObjCRuntimeMethodType { const bool isSynthesizedAccessorStub = false; const bool isImplicitlyDeclared = true; const bool isDefined = false; - const clang::ObjCMethodDecl::ImplementationControl impControl = - clang::ObjCMethodDecl::None; + const clang::ObjCImplementationControl impControl = + clang::ObjCImplementationControl::None; const bool HasRelatedResultType = false; const bool for_expression = true; diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index b2a5cb4eb99f4..5f64e0e4abaf9 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -8010,8 +8010,8 @@ bool TypeSystemClang::AddObjCClassProperty( const bool isSynthesizedAccessorStub = false; const bool isImplicitlyDeclared = true; const bool isDefined = false; - const clang::ObjCMethodDecl::ImplementationControl impControl = - clang::ObjCMethodDecl::None; + const clang::ObjCImplementationControl impControl = + clang::ObjCImplementationControl::None; const bool HasRelatedResultType = false; getter = clang::ObjCMethodDecl::CreateDeserialized(clang_ast, 0); @@ -8052,8 +8052,8 @@ bool TypeSystemClang::AddObjCClassProperty( const bool isSynthesizedAccessorStub = false; const bool isImplicitlyDeclared = true; const bool isDefined = false; - const clang::ObjCMethodDecl::ImplementationControl impControl = - clang::ObjCMethodDecl::None; + const clang::ObjCImplementationControl impControl = + clang::ObjCImplementationControl::None; const bool HasRelatedResultType = false; setter = clang::ObjCMethodDecl::CreateDeserialized(clang_ast, 0); @@ -8174,8 +8174,8 @@ clang::ObjCMethodDecl *TypeSystemClang::AddMethodToObjCObjectType( /// Force this to true because we don't have source locations. const bool isImplicitlyDeclared = true; const bool isDefined = false; - const clang::ObjCMethodDecl::ImplementationControl impControl = - clang::ObjCMethodDecl::None; + const clang::ObjCImplementationControl impControl = + clang::ObjCImplementationControl::None; const bool HasRelatedResultType = false; const unsigned num_args = method_function_prototype->getNumParams();