mutable llvm::FoldingSet<DeducedTemplateSpecializationType>
DeducedTemplateSpecializationTypes;
mutable llvm::FoldingSet<AtomicType> AtomicTypes;
- llvm::FoldingSet<AttributedType> AttributedTypes;
+ mutable llvm::FoldingSet<AttributedType> AttributedTypes;
mutable llvm::FoldingSet<PipeType> PipeTypes;
mutable llvm::FoldingSet<BitIntType> BitIntTypes;
mutable llvm::FoldingSet<DependentBitIntType> DependentBitIntTypes;
/// declaration of a function with an exception specification is permitted
/// and preserved. Other type sugar (for instance, typedefs) is not.
QualType getFunctionTypeWithExceptionSpec(
- QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI);
+ QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI) const;
/// Determine whether two function types are the same, ignoring
/// exception specifications in cases where they're part of the type.
- bool hasSameFunctionTypeIgnoringExceptionSpec(QualType T, QualType U);
+ bool hasSameFunctionTypeIgnoringExceptionSpec(QualType T, QualType U) const;
/// Change the exception specification on a function once it is
/// delay-parsed, instantiated, or computed.
QualType getInjectedClassNameType(CXXRecordDecl *Decl, QualType TST) const;
- QualType getAttributedType(attr::Kind attrKind,
- QualType modifiedType,
- QualType equivalentType);
+ QualType getAttributedType(attr::Kind attrKind, QualType modifiedType,
+ QualType equivalentType) const;
QualType getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr,
QualType Wrapped);
bool hasSameTemplateName(const TemplateName &X, const TemplateName &Y) const;
/// Determine whether the two declarations refer to the same entity.
- ///
- /// FIXME: isSameEntity is not const due to its implementation calls
- /// hasSameFunctionTypeIgnoringExceptionSpec which may alter this.
- bool isSameEntity(const NamedDecl *X, const NamedDecl *Y);
+ bool isSameEntity(const NamedDecl *X, const NamedDecl *Y) const;
/// Determine whether two template parameter lists are similar enough
/// that they may be used in declarations of the same template.
- ///
- /// FIXME: isSameTemplateParameterList is not const since it calls
- /// isSameTemplateParameter.
bool isSameTemplateParameterList(const TemplateParameterList *X,
- const TemplateParameterList *Y);
+ const TemplateParameterList *Y) const;
/// Determine whether two template parameters are similar enough
/// that they may be used in declarations of the same template.
- ///
- /// FIXME: isSameTemplateParameterList is not const since it calls
- /// isSameEntity.
- bool isSameTemplateParameter(const NamedDecl *X, const NamedDecl *Y);
+ bool isSameTemplateParameter(const NamedDecl *X, const NamedDecl *Y) const;
/// Retrieve the "canonical" template argument.
///
/// declaration of a function with an exception specification is permitted
/// and preserved. Other type sugar (for instance, typedefs) is not.
QualType ASTContext::getFunctionTypeWithExceptionSpec(
- QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI) {
+ QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI) const {
// Might have some parens.
if (const auto *PT = dyn_cast<ParenType>(Orig))
return getParenType(
}
bool ASTContext::hasSameFunctionTypeIgnoringExceptionSpec(QualType T,
- QualType U) {
+ QualType U) const {
return hasSameType(T, U) ||
(getLangOpts().CPlusPlus17 &&
hasSameType(getFunctionTypeWithExceptionSpec(T, EST_None),
QualType ASTContext::getAttributedType(attr::Kind attrKind,
QualType modifiedType,
- QualType equivalentType) {
+ QualType equivalentType) const {
llvm::FoldingSetNodeID id;
AttributedType::Profile(id, attrKind, modifiedType, equivalentType);
}
bool ASTContext::isSameTemplateParameter(const NamedDecl *X,
- const NamedDecl *Y) {
+ const NamedDecl *Y) const {
if (X->getKind() != Y->getKind())
return false;
TY->getTemplateParameters());
}
-bool ASTContext::isSameTemplateParameterList(const TemplateParameterList *X,
- const TemplateParameterList *Y) {
+bool ASTContext::isSameTemplateParameterList(
+ const TemplateParameterList *X, const TemplateParameterList *Y) const {
if (X->size() != Y->size())
return false;
return true;
}
-bool ASTContext::isSameEntity(const NamedDecl *X, const NamedDecl *Y) {
+bool ASTContext::isSameEntity(const NamedDecl *X, const NamedDecl *Y) const {
if (X == Y)
return true;
if (getLangOpts().CPlusPlus17 && XFPT && YFPT &&
(isUnresolvedExceptionSpec(XFPT->getExceptionSpecType()) ||
isUnresolvedExceptionSpec(YFPT->getExceptionSpecType())) &&
- // FIXME: We could make isSameEntity const after we make
- // hasSameFunctionTypeIgnoringExceptionSpec const.
hasSameFunctionTypeIgnoringExceptionSpec(XT, YT))
return true;
return false;