Lines Matching defs:ASTContext

1 //===--- ASTContext.cpp - Context to hold long-lived AST nodes ------------===//
10 // This file implements the ASTContext interface.
14 #include "clang/AST/ASTContext.h"
46 unsigned ASTContext::NumImplicitDefaultConstructors;
47 unsigned ASTContext::NumImplicitDefaultConstructorsDeclared;
48 unsigned ASTContext::NumImplicitCopyConstructors;
49 unsigned ASTContext::NumImplicitCopyConstructorsDeclared;
50 unsigned ASTContext::NumImplicitMoveConstructors;
51 unsigned ASTContext::NumImplicitMoveConstructorsDeclared;
52 unsigned ASTContext::NumImplicitCopyAssignmentOperators;
53 unsigned ASTContext::NumImplicitCopyAssignmentOperatorsDeclared;
54 unsigned ASTContext::NumImplicitMoveAssignmentOperators;
55 unsigned ASTContext::NumImplicitMoveAssignmentOperatorsDeclared;
56 unsigned ASTContext::NumImplicitDestructors;
57 unsigned ASTContext::NumImplicitDestructorsDeclared;
63 RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
332 const RawComment *ASTContext::getRawCommentForAnyRedecl(
418 comments::FullComment *ASTContext::cloneFullComment(comments::FullComment *FC,
434 comments::FullComment *ASTContext::getLocalCommentForDeclUncached(const Decl *D) const {
439 comments::FullComment *ASTContext::getCommentForDecl(
547 ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID,
587 ASTContext::getCanonicalTemplateTemplateParmDecl(
677 CXXABI *ASTContext::createCXXABI(const TargetInfo &T) {
725 ASTContext::ASTContext(LangOptions& LOpts, SourceManager &SM,
757 ASTContext::~ASTContext() {
794 void ASTContext::ReleaseParentMapEntries() {
806 void ASTContext::AddDeallocation(void (*Callback)(void*), void *Data) {
811 ASTContext::setExternalSource(IntrusiveRefCntPtr<ExternalASTSource> Source) {
815 void ASTContext::PrintStats() const {
874 RecordDecl *ASTContext::buildImplicitRecord(StringRef Name,
888 TypedefDecl *ASTContext::buildImplicitTypedef(QualType T,
892 const_cast<ASTContext &>(*this), getTranslationUnitDecl(),
898 TypedefDecl *ASTContext::getInt128Decl() const {
904 TypedefDecl *ASTContext::getUInt128Decl() const {
910 TypeDecl *ASTContext::getFloat128StubType() const {
918 void ASTContext::InitBuiltinType(CanQualType &R, BuiltinType::Kind K) {
924 void ASTContext::InitBuiltinTypes(const TargetInfo &Target) {
1060 DiagnosticsEngine &ASTContext::getDiagnostics() const {
1064 AttrVec& ASTContext::getDeclAttrs(const Decl *D) {
1075 void ASTContext::eraseDeclAttrs(const Decl *D) {
1085 ASTContext::getInstantiatedFromStaticDataMember(const VarDecl *Var) {
1091 ASTContext::TemplateOrSpecializationInfo
1092 ASTContext::getTemplateOrSpecializationInfo(const VarDecl *Var) {
1102 ASTContext::setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl,
1112 ASTContext::setTemplateOrSpecializationInfo(VarDecl *Inst,
1119 FunctionDecl *ASTContext::getClassScopeSpecializationPattern(
1130 void ASTContext::setClassScopeSpecializationPattern(FunctionDecl *FD,
1138 ASTContext::getInstantiatedFromUsingDecl(UsingDecl *UUD) {
1148 ASTContext::setInstantiatedFromUsingDecl(UsingDecl *Inst, NamedDecl *Pattern) {
1158 ASTContext::getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst) {
1168 ASTContext::setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst,
1174 FieldDecl *ASTContext::getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field) {
1183 void ASTContext::setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst,
1193 ASTContext::overridden_cxx_method_iterator
1194 ASTContext::overridden_methods_begin(const CXXMethodDecl *Method) const {
1203 ASTContext::overridden_cxx_method_iterator
1204 ASTContext::overridden_methods_end(const CXXMethodDecl *Method) const {
1214 ASTContext::overridden_methods_size(const CXXMethodDecl *Method) const {
1223 void ASTContext::addOverriddenMethod(const CXXMethodDecl *Method,
1229 void ASTContext::getOverriddenMethods(
1249 void ASTContext::addedLocalImportDecl(ImportDecl *Import) {
1268 const llvm::fltSemantics &ASTContext::getFloatTypeSemantics(QualType T) const {
1280 CharUnits ASTContext::getDeclAlign(const Decl *D, bool ForAlignof) const {
1376 ASTContext::getTypeInfoDataSizeInChars(QualType T) const {
1395 static getConstantArrayInfoInChars(const ASTContext &Context,
1413 ASTContext::getTypeInfoInChars(const Type *T) const {
1422 ASTContext::getTypeInfoInChars(QualType T) const {
1426 std::pair<uint64_t, unsigned> ASTContext::getTypeInfo(const Type *T) const {
1443 ASTContext::getTypeInfoImpl(const Type *T) const {
1742 CharUnits ASTContext::toCharUnitsFromBits(int64_t BitSize) const {
1747 int64_t ASTContext::toBits(CharUnits CharSize) const {
1753 CharUnits ASTContext::getTypeSizeInChars(QualType T) const {
1756 CharUnits ASTContext::getTypeSizeInChars(const Type *T) const {
1762 CharUnits ASTContext::getTypeAlignInChars(QualType T) const {
1765 CharUnits ASTContext::getTypeAlignInChars(const Type *T) const {
1773 unsigned ASTContext::getPreferredTypeAlign(const Type *T) const {
1798 unsigned ASTContext::getAlignOfGlobalVar(QualType T) const {
1804 CharUnits ASTContext::getAlignOfGlobalVarInChars(QualType T) const {
1814 void ASTContext::DeepCollectObjCIvars(const ObjCInterfaceDecl *OI,
1832 void ASTContext::CollectInheritedProtocols(const Decl *CDecl,
1869 unsigned ASTContext::CountNonClassIvars(const ObjCInterfaceDecl *OI) const {
1883 bool ASTContext::isSentinelNullExpr(const Expr *E) {
1902 ObjCImplementationDecl *ASTContext::getObjCImplementation(ObjCInterfaceDecl *D) {
1910 ObjCCategoryImplDecl *ASTContext::getObjCImplementation(ObjCCategoryDecl *D) {
1919 void ASTContext::setObjCImplementation(ObjCInterfaceDecl *IFaceD,
1925 void ASTContext::setObjCImplementation(ObjCCategoryDecl *CatD,
1931 const ObjCInterfaceDecl *ASTContext::getObjContainingInterface(
1948 Expr *ASTContext::getBlockVarCopyInits(const VarDecl*VD) {
1958 void ASTContext::setBlockVarCopyInits(VarDecl*VD, Expr* Init) {
1965 TypeSourceInfo *ASTContext::CreateTypeSourceInfo(QualType T,
1979 TypeSourceInfo *ASTContext::getTrivialTypeSourceInfo(QualType T,
1982 DI->getTypeLoc().initialize(const_cast<ASTContext &>(*this), L);
1987 ASTContext::getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) const {
1992 ASTContext::getASTObjCImplementationLayout(
2002 ASTContext::getExtQualType(const Type *baseType, Qualifiers quals) const {
2032 ASTContext::getAddrSpaceQualType(QualType T, unsigned AddressSpace) const {
2051 QualType ASTContext::getObjCGCQualType(QualType T,
2079 const FunctionType *ASTContext::adjustFunctionType(const FunctionType *T,
2097 void ASTContext::adjustDeducedFunctionResultType(FunctionDecl *FD,
2115 QualType ASTContext::getComplexType(QualType T) const {
2143 QualType ASTContext::getPointerType(QualType T) const {
2169 QualType ASTContext::getAdjustedType(QualType Orig, QualType New) const {
2190 QualType ASTContext::getDecayedType(QualType T) const {
2231 QualType ASTContext::getBlockPointerType(QualType T) const {
2264 ASTContext::getLValueReferenceType(QualType T, bool SpelledAsLValue) const {
2304 QualType ASTContext::getRValueReferenceType(QualType T) const {
2339 QualType ASTContext::getMemberPointerType(QualType T, const Type *Cls) const {
2370 QualType ASTContext::getConstantArrayType(QualType EltTy,
2417 QualType ASTContext::getVariableArrayDecayedType(QualType type) const {
2548 QualType ASTContext::getVariableArrayType(QualType EltTy,
2576 QualType ASTContext::getDependentSizedArrayType(QualType elementType,
2643 QualType ASTContext::getIncompleteArrayType(QualType elementType,
2681 QualType ASTContext::getVectorType(QualType vecType, unsigned NumElts,
2713 ASTContext::getExtVectorType(QualType vecType, unsigned NumElts) const {
2742 ASTContext::getDependentSizedExtVectorType(QualType vecType,
2786 ASTContext::getFunctionNoProtoType(QualType ResultTy,
2826 ASTContext::getFunctionType(QualType ResultTy, ArrayRef<QualType> ArgArray,
2924 QualType ASTContext::getInjectedClassNameType(CXXRecordDecl *Decl,
2944 QualType ASTContext::getTypeDeclTypeSlow(const TypeDecl *Decl) const {
2975 ASTContext::getTypedefType(const TypedefNameDecl *Decl,
2988 QualType ASTContext::getRecordType(const RecordDecl *Decl) const {
3001 QualType ASTContext::getEnumType(const EnumDecl *Decl) const {
3014 QualType ASTContext::getAttributedType(AttributedType::Kind attrKind,
3037 ASTContext::getSubstTemplateTypeParmType(const TemplateTypeParmType *Parm,
3059 QualType ASTContext::getSubstTemplateTypeParmPackType(
3097 QualType ASTContext::getTemplateTypeParmType(unsigned Depth, unsigned Index,
3128 ASTContext::getTemplateSpecializationTypeInfo(TemplateName Name,
3149 ASTContext::getTemplateSpecializationType(TemplateName Template,
3178 ASTContext::getTemplateSpecializationType(TemplateName Template,
3220 ASTContext::getCanonicalTemplateSpecializationType(TemplateName Template,
3265 ASTContext::getElaboratedType(ElaboratedTypeKeyword Keyword,
3291 ASTContext::getParenType(QualType InnerType) const {
3314 QualType ASTContext::getDependentNameType(ElaboratedTypeKeyword Keyword,
3344 ASTContext::getDependentTemplateSpecializationType(
3359 ASTContext::getDependentTemplateSpecializationType(
3411 QualType ASTContext::getPackExpansionType(QualType Pattern,
3482 QualType ASTContext::getObjCObjectType(QualType BaseType,
3533 bool ASTContext::ObjCObjectAdoptsQTypeProtocols(QualType QT,
3552 bool ASTContext::QIdProtocolsAdoptObjCObjectProtocols(QualType QT,
3598 QualType ASTContext::getObjCObjectPointerType(QualType ObjectT) const {
3628 QualType ASTContext::getObjCInterfaceType(const ObjCInterfaceDecl *Decl,
3655 QualType ASTContext::getTypeOfExprType(Expr *tofExpr) const {
3689 QualType ASTContext::getTypeOfType(QualType tofType) const {
3701 QualType ASTContext::getDecltypeType(Expr *e, QualType UnderlyingType) const {
3732 QualType ASTContext::getUnaryTransformType(QualType BaseType,
3748 QualType ASTContext::getAutoType(QualType DeducedType, bool IsDecltypeAuto,
3771 QualType ASTContext::getAtomicType(QualType T) const {
3798 QualType ASTContext::getAutoDeductType() const {
3808 QualType ASTContext::getAutoRRefDeductType() const {
3817 QualType ASTContext::getTagDeclType(const TagDecl *Decl) const {
3827 CanQualType ASTContext::getSizeType() const {
3832 CanQualType ASTContext::getIntMaxType() const {
3837 CanQualType ASTContext::getUIntMaxType() const {
3843 QualType ASTContext::getSignedWCharType() const {
3850 QualType ASTContext::getUnsignedWCharType() const {
3855 QualType ASTContext::getIntPtrType() const {
3859 QualType ASTContext::getUIntPtrType() const {
3865 QualType ASTContext::getPointerDiffType() const {
3871 QualType ASTContext::getProcessIDType() const {
3879 CanQualType ASTContext::getCanonicalParamType(QualType T) const {
3897 QualType ASTContext::getUnqualifiedArrayType(QualType type,
3961 bool ASTContext::UnwrapSimilarPointerTypes(QualType &T1, QualType &T2) {
3996 ASTContext::getNameForTemplate(TemplateName Name,
4045 TemplateName ASTContext::getCanonicalTemplateName(TemplateName Name) const {
4087 bool ASTContext::hasSameTemplateName(TemplateName X, TemplateName Y) {
4094 ASTContext::getCanonicalTemplateArgument(const TemplateArgument &Arg) const {
4146 ASTContext::getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const {
4201 const ArrayType *ASTContext::getAsArrayType(QualType T) const {
4259 QualType ASTContext::getAdjustedParameterType(QualType T) const {
4265 QualType ASTContext::getSignatureParameterType(QualType T) const {
4277 QualType ASTContext::getArrayDecayedType(QualType Ty) const {
4291 QualType ASTContext::getBaseElementType(const ArrayType *array) const {
4295 QualType ASTContext::getBaseElementType(QualType type) const {
4311 ASTContext::getConstantArrayElementCount(const ConstantArrayType *CA) const {
4341 QualType ASTContext::getFloatingTypeOfSizeWithinDomain(QualType Size,
4367 int ASTContext::getFloatingTypeOrder(QualType LHS, QualType RHS) const {
4381 unsigned ASTContext::getIntegerRank(const Type *T) const {
4416 QualType ASTContext::isPromotableBitField(Expr *E) const {
4447 QualType ASTContext::getPromotedIntegerType(QualType Promotable) const {
4490 Qualifiers::ObjCLifetime ASTContext::getInnerObjCOwnership(QualType T) const {
4518 int ASTContext::getIntegerTypeOrder(QualType LHS, QualType RHS) const {
4564 QualType ASTContext::getCFConstantStringType() const {
4599 QualType ASTContext::getObjCSuperType() const {
4608 void ASTContext::setCFConstantStringType(QualType T) {
4614 QualType ASTContext::getBlockDescriptorType() const {
4649 QualType ASTContext::getBlockDescriptorExtendedType() const {
4691 bool ASTContext::BlockRequiresCopying(QualType Ty,
4729 bool ASTContext::getByrefLifetime(QualType Ty,
4752 TypedefDecl *ASTContext::getObjCInstanceTypeDecl() {
4771 CharUnits ASTContext::getObjCEncodingTypeSize(QualType type) const {
4793 std::string ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr) const {
4849 bool ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl,
4890 void ASTContext::getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT,
4906 bool ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl,
4960 ASTContext::getObjCPropertyImplDeclForPropertyDecl(
5004 void ASTContext::getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
5076 void ASTContext::getLegacyIntegralTypeEncoding (QualType &PointeeTy) const {
5088 void ASTContext::getObjCEncodingForType(QualType T, std::string& S,
5098 void ASTContext::getObjCEncodingForPropertyType(QualType T,
5108 static char getObjCEncodingForPrimitiveKind(const ASTContext *C,
5166 static char ObjCEncodingForEnumType(const ASTContext *C, const EnumType *ET) {
5178 static void EncodeBitField(const ASTContext *Ctx, std::string& S,
5212 void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
5582 void ASTContext::getObjCEncodingForStructureImpl(RecordDecl *RDecl,
5723 void ASTContext::getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT,
5739 TypedefDecl *ASTContext::getObjCIdDecl() const {
5748 TypedefDecl *ASTContext::getObjCSelDecl() const {
5756 TypedefDecl *ASTContext::getObjCClassDecl() const {
5765 ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl() const {
5782 static TypedefDecl *CreateCharPtrBuiltinVaListDecl(const ASTContext *Context) {
5788 static TypedefDecl *CreateVoidPtrBuiltinVaListDecl(const ASTContext *Context) {
5795 CreateAArch64ABIBuiltinVaListDecl(const ASTContext *Context) {
5801 NS = NamespaceDecl::Create(const_cast<ASTContext &>(*Context),
5838 FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
5858 static TypedefDecl *CreatePowerABIBuiltinVaListDecl(const ASTContext *Context) {
5922 CreateX86_64ABIBuiltinVaListDecl(const ASTContext *Context) {
5950 FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
5981 static TypedefDecl *CreatePNaClABIBuiltinVaListDecl(const ASTContext *Context) {
5991 CreateAAPCSABIBuiltinVaListDecl(const ASTContext *Context) {
5997 NS = NamespaceDecl::Create(const_cast<ASTContext &>(*Context),
6009 FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
6031 CreateSystemZBuiltinVaListDecl(const ASTContext *Context) {
6059 FieldDecl *Field = FieldDecl::Create(const_cast<ASTContext &>(*Context),
6090 static TypedefDecl *CreateVaListDecl(const ASTContext *Context,
6114 TypedefDecl *ASTContext::getBuiltinVaListDecl() const {
6123 QualType ASTContext::getVaListTagType() const {
6132 void ASTContext::setObjCConstantStringInterface(ObjCInterfaceDecl *Decl) {
6142 ASTContext::getOverloadedTemplateName(UnresolvedSetIterator Begin,
6166 ASTContext::getQualifiedTemplateName(NestedNameSpecifier *NNS,
6190 ASTContext::getDependentTemplateName(NestedNameSpecifier *NNS,
6226 ASTContext::getDependentTemplateName(NestedNameSpecifier *NNS,
6261 ASTContext::getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param,
6279 ASTContext::getSubstTemplateTemplateParmPack(TemplateTemplateParmDecl *Param,
6281 ASTContext &Self = const_cast<ASTContext &>(*this);
6302 CanQualType ASTContext::getFromTargetType(unsigned Type) const {
6327 Qualifiers::GC ASTContext::getObjCGCAttrKind(QualType Ty) const {
6368 bool ASTContext::areCompatibleVectorTypes(QualType FirstVec,
6398 ASTContext::ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto,
6410 bool ASTContext::ObjCQualifiedClassTypesAreCompatible(QualType lhs,
6432 bool ASTContext::ObjCQualifiedIdTypesAreCompatible(QualType lhs, QualType rhs,
6553 bool ASTContext::canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT,
6584 bool ASTContext::canAssignObjCInterfacesInBlockPointer(
6620 void getIntersectionOfProtocols(ASTContext &Context,
6665 QualType ASTContext::areCommonBaseCompatible(
6692 bool ASTContext::canAssignObjCInterfaces(const ObjCObjectType *LHS,
6761 bool ASTContext::areComparableObjCPointerTypes(QualType LHS, QualType RHS) {
6773 bool ASTContext::canBindObjCObjectType(QualType To, QualType From) {
6783 bool ASTContext::typesAreCompatible(QualType LHS, QualType RHS,
6791 bool ASTContext::propertyTypesAreCompatible(QualType LHS, QualType RHS) {
6795 bool ASTContext::typesAreBlockPointerCompatible(QualType LHS, QualType RHS) {
6802 QualType ASTContext::mergeTransparentUnionType(QualType T, QualType SubType,
6822 QualType ASTContext::mergeFunctionParameterTypes(QualType lhs, QualType rhs,
6841 QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs,
7004 static QualType mergeEnumWithInteger(ASTContext &Context, const EnumType *ET,
7024 QualType ASTContext::mergeTypes(QualType LHS, QualType RHS,
7296 bool ASTContext::FunctionTypesMatchOnNSConsumedAttrs(
7317 QualType ASTContext::mergeObjCGCQualifiers(QualType LHS, QualType RHS) {
7393 unsigned ASTContext::getIntWidth(QualType T) const {
7402 QualType ASTContext::getCorrespondingUnsignedType(QualType T) const {
7452 static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context,
7453 ASTContext::GetBuiltinTypeError &Error,
7635 Error = ASTContext::GE_Missing_stdio;
7646 Error = ASTContext::GE_Missing_setjmp;
7655 Error = ASTContext::GE_Missing_ucontext;
7705 QualType ASTContext::GetBuiltinType(unsigned Id,
7757 static GVALinkage basicGVALinkageForFunction(const ASTContext &Context,
7825 GVALinkage ASTContext::GetGVALinkageForFunction(const FunctionDecl *FD) const {
7830 static GVALinkage basicGVALinkageForVariable(const ASTContext &Context,
7872 GVALinkage ASTContext::GetGVALinkageForVariable(const VarDecl *VD) {
7877 bool ASTContext::DeclMustBeEmitted(const Decl *D) {
7959 CallingConv ASTContext::getDefaultCallingConvention(bool IsVariadic,
7968 bool ASTContext::isNearlyEmpty(const CXXRecordDecl *RD) const {
7973 VTableContextBase *ASTContext::getVTableContext() {
7983 MangleContext *ASTContext::createMangleContext() {
7999 size_t ASTContext::getSideTableAllocatedMemory() const {
8020 QualType ASTContext::getIntTypeForBitwidth(unsigned DestWidth,
8032 QualType ASTContext::getRealTypeForBitwidth(unsigned DestWidth) const {
8048 void ASTContext::setManglingNumber(const NamedDecl *ND, unsigned Number) {
8053 unsigned ASTContext::getManglingNumber(const NamedDecl *ND) const {
8059 void ASTContext::setStaticLocalNumber(const VarDecl *VD, unsigned Number) {
8064 unsigned ASTContext::getStaticLocalNumber(const VarDecl *VD) const {
8071 ASTContext::getManglingNumberContext(const DeclContext *DC) {
8079 MangleNumberingContext *ASTContext::createMangleNumberingContext() const {
8083 void ASTContext::setParameterIndex(const ParmVarDecl *D, unsigned int index) {
8087 unsigned ASTContext::getParameterIndex(const ParmVarDecl *D) const {
8095 ASTContext::getMaterializedTemporaryValue(const MaterializeTemporaryExpr *E,
8107 bool ASTContext::AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const {
8141 static ASTContext::ParentMap *buildMap(TranslationUnitDecl &TU) {
8142 ParentMapASTVisitor Visitor(new ASTContext::ParentMap);
8150 ParentMapASTVisitor(ASTContext::ParentMap *Parents) : Parents(Parents) {
8187 auto *Vector = new ASTContext::ParentVector(1, *Node);
8191 assert(NodeOrVector.template is<ASTContext::ParentVector *>());
8194 NodeOrVector.template get<ASTContext::ParentVector *>();
8220 ASTContext::ParentMap *Parents;
8228 ASTContext::ParentVector
8229 ASTContext::getParents(const ast_type_traits::DynTypedNode &Node) {
8251 ASTContext::ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl,
8282 // doesn't include ASTContext.h
8288 const clang::ASTContext &Ctx, Decl *Value);