From c61eaa5920161789f273256a718b9d47a97d00cd Mon Sep 17 00:00:00 2001 From: Anastasia Stulova Date: Mon, 28 Jan 2019 11:37:49 +0000 Subject: [PATCH] Rename getTypeQualifiers to getMethodQualifiers. Use more descriptive name for the method qualifiers getter. Differential Revision: https://reviews.llvm.org/D56792 llvm-svn: 352349 --- clang/include/clang/AST/CanonicalType.h | 2 +- clang/include/clang/AST/DeclCXX.h | 4 ++-- clang/include/clang/AST/Type.h | 4 ++-- clang/lib/AST/ASTContext.cpp | 2 +- clang/lib/AST/ASTStructuralEquivalence.cpp | 2 +- clang/lib/AST/DeclCXX.cpp | 2 +- clang/lib/AST/ItaniumMangle.cpp | 4 ++-- clang/lib/AST/MicrosoftMangle.cpp | 4 ++-- clang/lib/AST/TypePrinter.cpp | 4 ++-- clang/lib/AST/VTableBuilder.cpp | 2 +- clang/lib/CodeGen/CGCall.cpp | 2 +- clang/lib/Index/USRGeneration.cpp | 2 +- clang/lib/Parse/ParseCXXInlineMethods.cpp | 2 +- clang/lib/Sema/SemaCodeComplete.cpp | 10 +++++----- clang/lib/Sema/SemaDecl.cpp | 2 +- clang/lib/Sema/SemaDeclCXX.cpp | 8 ++++---- clang/lib/Sema/SemaOverload.cpp | 18 +++++++++--------- clang/lib/Sema/SemaTemplateDeduction.cpp | 8 ++++---- clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 2 +- clang/lib/Sema/SemaType.cpp | 6 +++--- clang/lib/Serialization/ASTWriter.cpp | 4 ++-- clang/tools/libclang/CIndex.cpp | 2 +- 22 files changed, 48 insertions(+), 48 deletions(-) diff --git a/clang/include/clang/AST/CanonicalType.h b/clang/include/clang/AST/CanonicalType.h index 9ff02a8..2e00d34 100644 --- a/clang/include/clang/AST/CanonicalType.h +++ b/clang/include/clang/AST/CanonicalType.h @@ -509,7 +509,7 @@ struct CanProxyAdaptor } LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVariadic) - LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getTypeQuals) + LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getMethodQuals) using param_type_iterator = CanTypeIterator; diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index c889741..d6cad4e 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -2184,8 +2184,8 @@ public: static QualType getThisType(const FunctionProtoType *FPT, const CXXRecordDecl *Decl); - Qualifiers getTypeQualifiers() const { - return getType()->getAs()->getTypeQuals(); + Qualifiers getMethodQualifiers() const { + return getType()->getAs()->getMethodQuals(); } /// Retrieve the ref-qualifier associated with this method. diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 50271aa8..d9f7e3e 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -3901,7 +3901,7 @@ public: EPI.Variadic = isVariadic(); EPI.HasTrailingReturn = hasTrailingReturn(); EPI.ExceptionSpec.Type = getExceptionSpecType(); - EPI.TypeQuals = getTypeQuals(); + EPI.TypeQuals = getMethodQuals(); EPI.RefQualifier = getRefQualifier(); if (EPI.ExceptionSpec.Type == EST_Dynamic) { EPI.ExceptionSpec.Exceptions = exceptions(); @@ -4011,7 +4011,7 @@ public: /// Whether this function prototype has a trailing return type. bool hasTrailingReturn() const { return FunctionTypeBits.HasTrailingReturn; } - Qualifiers getTypeQuals() const { + Qualifiers getMethodQuals() const { if (hasExtQualifiers()) return *getTrailingObjects(); else diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 22927a4..59b9184 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -8580,7 +8580,7 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, if (lproto->isVariadic() != rproto->isVariadic()) return {}; - if (lproto->getTypeQuals() != rproto->getTypeQuals()) + if (lproto->getMethodQuals() != rproto->getMethodQuals()) return {}; SmallVector newParamInfos; diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp index 7b62eb8..9f83c51 100644 --- a/clang/lib/AST/ASTStructuralEquivalence.cpp +++ b/clang/lib/AST/ASTStructuralEquivalence.cpp @@ -528,7 +528,7 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, if (Proto1->isVariadic() != Proto2->isVariadic()) return false; - if (Proto1->getTypeQuals() != Proto2->getTypeQuals()) + if (Proto1->getMethodQuals() != Proto2->getMethodQuals()) return false; // Check exceptions, this information is lost in canonical type. diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 4c5b23c..76e1cf5 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -2176,7 +2176,7 @@ QualType CXXMethodDecl::getThisType(const FunctionProtoType *FPT, const CXXRecordDecl *Decl) { ASTContext &C = Decl->getASTContext(); QualType ClassTy = C.getTypeDeclType(Decl); - ClassTy = C.getQualifiedType(ClassTy, FPT->getTypeQuals()); + ClassTy = C.getQualifiedType(ClassTy, FPT->getMethodQuals()); return C.getPointerType(ClassTy); } diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index 9f2979d..34a6181 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/lib/AST/ItaniumMangle.cpp @@ -1502,7 +1502,7 @@ void CXXNameMangler::mangleNestedName(const NamedDecl *ND, Out << 'N'; if (const CXXMethodDecl *Method = dyn_cast(ND)) { - Qualifiers MethodQuals = Method->getTypeQualifiers(); + Qualifiers MethodQuals = Method->getMethodQualifiers(); // We do not consider restrict a distinguishing attribute for overloading // purposes so we must not mangle it. MethodQuals.removeRestrict(); @@ -2734,7 +2734,7 @@ void CXXNameMangler::mangleType(const FunctionProtoType *T) { // Mangle CV-qualifiers, if present. These are 'this' qualifiers, // e.g. "const" in "int (A::*)() const". - mangleQualifiers(T->getTypeQuals()); + mangleQualifiers(T->getMethodQuals()); // Mangle instantiation-dependent exception-specification, if present, // per cxx-abi-dev proposal on 2016-10-11. diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 62d9b91..471e738 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -2111,7 +2111,7 @@ void MicrosoftCXXNameMangler::mangleType(const FunctionProtoType *T, Qualifiers, // Structors only appear in decls, so at this point we know it's not a // structor type. // FIXME: This may not be lambda-friendly. - if (T->getTypeQuals() || T->getRefQualifier() != RQ_None) { + if (T->getMethodQuals() || T->getRefQualifier() != RQ_None) { Out << "$$A8@@"; mangleFunctionType(T, /*D=*/nullptr, /*ForceThisQuals=*/true); } else { @@ -2160,7 +2160,7 @@ void MicrosoftCXXNameMangler::mangleFunctionType(const FunctionType *T, // If this is a C++ instance method, mangle the CVR qualifiers for the // this pointer. if (HasThisQuals) { - Qualifiers Quals = Proto->getTypeQuals(); + Qualifiers Quals = Proto->getMethodQuals(); manglePointerExtQualifiers(Quals, /*PointeeType=*/QualType()); mangleRefQualifier(Proto->getRefQualifier()); mangleQualifiers(Quals, /*IsMember=*/false); diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index a98b45b..ebcc01a 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -815,8 +815,8 @@ void TypePrinter::printFunctionProtoAfter(const FunctionProtoType *T, printFunctionAfter(Info, OS); - if (!T->getTypeQuals().empty()) - OS << " " << T->getTypeQuals().getAsString(); + if (!T->getMethodQuals().empty()) + OS << " " << T->getMethodQuals().getAsString(); switch (T->getRefQualifier()) { case RQ_None: diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index 85c4fca..527ee8e 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -479,7 +479,7 @@ static bool HasSameVirtualSignature(const CXXMethodDecl *LHS, // Force the signatures to match. We can't rely on the overrides // list here because there isn't necessarily an inheritance // relationship between the two methods. - if (LT->getTypeQuals() != RT->getTypeQuals()) + if (LT->getMethodQuals() != RT->getMethodQuals()) return false; return LT->getParamTypes() == RT->getParamTypes(); } diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index a650493..395efb2 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -73,7 +73,7 @@ static CanQualType GetThisType(ASTContext &Context, const CXXRecordDecl *RD, const CXXMethodDecl *MD) { QualType RecTy = Context.getTagDeclType(RD)->getCanonicalTypeInternal(); if (MD) - RecTy = Context.getAddrSpaceQualType(RecTy, MD->getTypeQualifiers().getAddressSpace()); + RecTy = Context.getAddrSpaceQualType(RecTy, MD->getMethodQualifiers().getAddressSpace()); return Context.getPointerType(CanQualType::CreateUnsafe(RecTy)); } diff --git a/clang/lib/Index/USRGeneration.cpp b/clang/lib/Index/USRGeneration.cpp index e409096..0e2439c 100644 --- a/clang/lib/Index/USRGeneration.cpp +++ b/clang/lib/Index/USRGeneration.cpp @@ -270,7 +270,7 @@ void USRGenerator::VisitFunctionDecl(const FunctionDecl *D) { if (MD->isStatic()) Out << 'S'; // FIXME: OpenCL: Need to consider address spaces - if (unsigned quals = MD->getTypeQualifiers().getCVRUQualifiers()) + if (unsigned quals = MD->getMethodQualifiers().getCVRUQualifiers()) Out << (char)('0' + quals); switch (MD->getRefQualifier()) { case RQ_None: break; diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp index e3e8464..5598058 100644 --- a/clang/lib/Parse/ParseCXXInlineMethods.cpp +++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp @@ -415,7 +415,7 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) { Method = cast(LM.Method); Sema::CXXThisScopeRAII ThisScope(Actions, Method->getParent(), - Method->getTypeQualifiers(), + Method->getMethodQualifiers(), getLangOpts().CPlusPlus11); // Parse the exception-specification. diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 9bed545..a88e15c 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -1028,7 +1028,7 @@ void ResultBuilder::AddResult(Result R, DeclContext *CurContext, if (HasObjectTypeQualifiers) if (const auto *Method = dyn_cast(R.Declaration)) if (Method->isInstance()) { - Qualifiers MethodQuals = Method->getTypeQualifiers(); + Qualifiers MethodQuals = Method->getMethodQualifiers(); if (ObjectTypeQualifiers == MethodQuals) R.Priority += CCD_ObjectQualifierMatch; else if (ObjectTypeQualifiers - MethodQuals) { @@ -2736,23 +2736,23 @@ static void AddFunctionTypeQualsToCompletionString(CodeCompletionBuilder &Result, const FunctionDecl *Function) { const auto *Proto = Function->getType()->getAs(); - if (!Proto || !Proto->getTypeQuals()) + if (!Proto || !Proto->getMethodQuals()) return; // FIXME: Add ref-qualifier! // Handle single qualifiers without copying - if (Proto->getTypeQuals().hasOnlyConst()) { + if (Proto->getMethodQuals().hasOnlyConst()) { Result.AddInformativeChunk(" const"); return; } - if (Proto->getTypeQuals().hasOnlyVolatile()) { + if (Proto->getMethodQuals().hasOnlyVolatile()) { Result.AddInformativeChunk(" volatile"); return; } - if (Proto->getTypeQuals().hasOnlyRestrict()) { + if (Proto->getMethodQuals().hasOnlyRestrict()) { Result.AddInformativeChunk(" restrict"); return; } diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 4894b9e..38a7330 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -10026,7 +10026,7 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, CXXMethodDecl *MD = dyn_cast(NewFD); if (!getLangOpts().CPlusPlus14 && MD && MD->isConstexpr() && !MD->isStatic() && !isa(MD) && - !MD->getTypeQualifiers().hasConst()) { + !MD->getMethodQualifiers().hasConst()) { CXXMethodDecl *OldMD = nullptr; if (OldDecl) OldMD = dyn_cast_or_null(OldDecl->getAsFunction()); diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 9ca2e87..031e062 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -6556,7 +6556,7 @@ void Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD) { ReturnType = Type->getReturnType(); QualType DeclType = Context.getTypeDeclType(RD); - DeclType = Context.getAddrSpaceQualType(DeclType, MD->getTypeQualifiers().getAddressSpace()); + DeclType = Context.getAddrSpaceQualType(DeclType, MD->getMethodQualifiers().getAddressSpace()); QualType ExpectedReturnType = Context.getLValueReferenceType(DeclType); if (!Context.hasSameType(ReturnType, ExpectedReturnType)) { @@ -6566,7 +6566,7 @@ void Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD) { } // A defaulted special member cannot have cv-qualifiers. - if (Type->getTypeQuals().hasConst() || Type->getTypeQuals().hasVolatile()) { + if (Type->getMethodQuals().hasConst() || Type->getMethodQuals().hasVolatile()) { if (DeleteOnTypeMismatch) ShouldDeleteForTypeMismatch = true; else { @@ -12012,7 +12012,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, DerefBuilder DerefThis(This); CastBuilder To(DerefThis, Context.getQualifiedType( - BaseType, CopyAssignOperator->getTypeQualifiers()), + BaseType, CopyAssignOperator->getMethodQualifiers()), VK_LValue, BasePath); // Build the copy. @@ -12377,7 +12377,7 @@ void Sema::DefineImplicitMoveAssignment(SourceLocation CurrentLocation, // Implicitly cast "this" to the appropriately-qualified base type. CastBuilder To(DerefThis, Context.getQualifiedType( - BaseType, MoveAssignOperator->getTypeQualifiers()), + BaseType, MoveAssignOperator->getMethodQualifiers()), VK_LValue, BasePath); // Build the move. diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 6593b37..ad56994 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -1171,8 +1171,8 @@ bool Sema::IsOverload(FunctionDecl *New, FunctionDecl *Old, // function yet (because we haven't yet resolved whether this is a static // or non-static member function). Add it now, on the assumption that this // is a redeclaration of OldMethod. - auto OldQuals = OldMethod->getTypeQualifiers(); - auto NewQuals = NewMethod->getTypeQualifiers(); + auto OldQuals = OldMethod->getMethodQualifiers(); + auto NewQuals = NewMethod->getMethodQualifiers(); if (!getLangOpts().CPlusPlus14 && NewMethod->isConstexpr() && !isa(NewMethod)) NewQuals.addConst(); @@ -2544,7 +2544,7 @@ bool Sema::isObjCPointerConversion(QualType FromType, QualType ToType, // function types are obviously different. if (FromFunctionType->getNumParams() != ToFunctionType->getNumParams() || FromFunctionType->isVariadic() != ToFunctionType->isVariadic() || - FromFunctionType->getTypeQuals() != ToFunctionType->getTypeQuals()) + FromFunctionType->getMethodQuals() != ToFunctionType->getMethodQuals()) return false; bool HasObjCConversion = false; @@ -2851,9 +2851,9 @@ void Sema::HandleFunctionTypeMismatch(PartialDiagnostic &PDiag, return; } - if (FromFunction->getTypeQuals() != ToFunction->getTypeQuals()) { - PDiag << ft_qualifer_mismatch << ToFunction->getTypeQuals() - << FromFunction->getTypeQuals(); + if (FromFunction->getMethodQuals() != ToFunction->getMethodQuals()) { + PDiag << ft_qualifer_mismatch << ToFunction->getMethodQuals() + << FromFunction->getMethodQuals(); return; } @@ -5100,7 +5100,7 @@ TryObjectArgumentInitialization(Sema &S, SourceLocation Loc, QualType FromType, Quals.addConst(); Quals.addVolatile(); } else { - Quals = Method->getTypeQualifiers(); + Quals = Method->getMethodQualifiers(); } QualType ImplicitParamType = S.Context.getQualifiedType(ClassType, Quals); @@ -7957,7 +7957,7 @@ public: continue; if (const FunctionProtoType *Proto =PointeeTy->getAs()) - if (Proto->getTypeQuals() || Proto->getRefQualifier()) + if (Proto->getMethodQuals() || Proto->getRefQualifier()) continue; S.AddBuiltinCandidate(&ParamTy, Args, CandidateSet); @@ -12880,7 +12880,7 @@ Sema::BuildCallToMemberFunction(Scope *S, Expr *MemExprE, // Check that the object type isn't more qualified than the // member function we're calling. - Qualifiers funcQuals = proto->getTypeQuals(); + Qualifiers funcQuals = proto->getMethodQuals(); QualType objectType = op->getLHS()->getType(); if (op->getOpcode() == BO_PtrMemI) diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index c191ee0..4dccf2f 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -1670,8 +1670,8 @@ DeduceTemplateArgumentsByTypeMatch(Sema &S, const FunctionProtoType *FunctionProtoParam = cast(Param); - if (FunctionProtoParam->getTypeQuals() - != FunctionProtoArg->getTypeQuals() || + if (FunctionProtoParam->getMethodQuals() + != FunctionProtoArg->getMethodQuals() || FunctionProtoParam->getRefQualifier() != FunctionProtoArg->getRefQualifier() || FunctionProtoParam->isVariadic() != FunctionProtoArg->isVariadic()) @@ -3081,7 +3081,7 @@ Sema::SubstituteExplicitTemplateArguments( CXXRecordDecl *ThisContext = nullptr; if (CXXMethodDecl *Method = dyn_cast(Function)) { ThisContext = Method->getParent(); - ThisTypeQuals = Method->getTypeQualifiers(); + ThisTypeQuals = Method->getMethodQualifiers(); } CXXThisScopeRAII ThisScope(*this, ThisContext, ThisTypeQuals, @@ -4660,7 +4660,7 @@ AddImplicitObjectParameterType(ASTContext &Context, // The standard doesn't say explicitly, but we pick the appropriate kind of // reference type based on [over.match.funcs]p4. QualType ArgTy = Context.getTypeDeclType(Method->getParent()); - ArgTy = Context.getQualifiedType(ArgTy, Method->getTypeQualifiers()); + ArgTy = Context.getQualifiedType(ArgTy, Method->getMethodQualifiers()); if (Method->getRefQualifier() == RQ_RValue) ArgTy = Context.getRValueReferenceType(ArgTy); else diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 58d1d20..883a73f2 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -3505,7 +3505,7 @@ TemplateDeclInstantiator::SubstFunctionType(FunctionDecl *D, Qualifiers ThisTypeQuals; if (CXXMethodDecl *Method = dyn_cast(D)) { ThisContext = cast(Owner); - ThisTypeQuals = Method->getTypeQualifiers(); + ThisTypeQuals = Method->getMethodQualifiers(); } TypeSourceInfo *NewTInfo diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index ba7cbdd..321bed6 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -1872,7 +1872,7 @@ static QualType inferARCLifetimeForPointee(Sema &S, QualType type, } static std::string getFunctionQualifiersAsString(const FunctionProtoType *FnTy){ - std::string Quals = FnTy->getTypeQuals().getAsString(); + std::string Quals = FnTy->getMethodQuals().getAsString(); switch (FnTy->getRefQualifier()) { case RQ_None: @@ -1914,7 +1914,7 @@ static bool checkQualifiedFunction(Sema &S, QualType T, SourceLocation Loc, QualifiedFunctionKind QFK) { // Does T refer to a function type with a cv-qualifier or a ref-qualifier? const FunctionProtoType *FPT = T->getAs(); - if (!FPT || (FPT->getTypeQuals().empty() && FPT->getRefQualifier() == RQ_None)) + if (!FPT || (FPT->getMethodQuals().empty() && FPT->getRefQualifier() == RQ_None)) return false; S.Diag(Loc, diag::err_compound_qualified_function_type) @@ -3967,7 +3967,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // Does T refer to a function type with a cv-qualifier or a ref-qualifier? bool IsQualifiedFunction = T->isFunctionProtoType() && - (!T->castAs()->getTypeQuals().empty() || + (!T->castAs()->getMethodQuals().empty() || T->castAs()->getRefQualifier() != RQ_None); // If T is 'decltype(auto)', the only declarators we can have are parens diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index c69ff44..ff01155 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -309,7 +309,7 @@ void ASTTypeWriter::VisitFunctionProtoType(const FunctionProtoType *T) { Record.push_back(T->isVariadic()); Record.push_back(T->hasTrailingReturn()); - Record.push_back(T->getTypeQuals().getAsOpaqueValue()); + Record.push_back(T->getMethodQuals().getAsOpaqueValue()); Record.push_back(static_cast(T->getRefQualifier())); addExceptionSpec(T, Record); @@ -322,7 +322,7 @@ void ASTTypeWriter::VisitFunctionProtoType(const FunctionProtoType *T) { Record.push_back(T->getExtParameterInfo(I).getOpaqueValue()); } - if (T->isVariadic() || T->hasTrailingReturn() || T->getTypeQuals() || + if (T->isVariadic() || T->hasTrailingReturn() || T->getMethodQuals() || T->getRefQualifier() || T->getExceptionSpecType() != EST_None || T->hasExtParameterInfos()) AbbrevToUse = 0; diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index efda529..f4782c2 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -8360,7 +8360,7 @@ unsigned clang_CXXMethod_isConst(CXCursor C) { const Decl *D = cxcursor::getCursorDecl(C); const CXXMethodDecl *Method = D ? dyn_cast_or_null(D->getAsFunction()) : nullptr; - return (Method && Method->getTypeQualifiers().hasConst()) ? 1 : 0; + return (Method && Method->getMethodQualifiers().hasConst()) ? 1 : 0; } unsigned clang_CXXMethod_isDefaulted(CXCursor C) { -- 2.7.4