003 File Manager
Current Path:
/usr/src/contrib/llvm-project/clang/include/clang/AST
usr
/
src
/
contrib
/
llvm-project
/
clang
/
include
/
clang
/
AST
/
📁
..
📄
APValue.h
(20.92 KB)
📄
AST.h
(907 B)
📄
ASTConcept.h
(7.02 KB)
📄
ASTConsumer.h
(5.99 KB)
📄
ASTContext.h
(122.68 KB)
📄
ASTContextAllocate.h
(1.33 KB)
📄
ASTDiagnostic.h
(1.34 KB)
📄
ASTDumper.h
(1.59 KB)
📄
ASTDumperUtils.h
(3.49 KB)
📄
ASTFwd.h
(1.01 KB)
📄
ASTImporter.h
(22.86 KB)
📄
ASTImporterLookupTable.h
(2.7 KB)
📄
ASTImporterSharedState.h
(2.51 KB)
📄
ASTLambda.h
(3.04 KB)
📄
ASTMutationListener.h
(5.84 KB)
📄
ASTNodeTraverser.h
(21.38 KB)
📄
ASTStructuralEquivalence.h
(5.08 KB)
📄
ASTTypeTraits.h
(19.65 KB)
📄
ASTUnresolvedSet.h
(3.37 KB)
📄
ASTVector.h
(11.75 KB)
📄
AbstractBasicReader.h
(8.82 KB)
📄
AbstractBasicWriter.h
(7.97 KB)
📄
AbstractTypeReader.h
(922 B)
📄
AbstractTypeWriter.h
(944 B)
📄
Attr.h
(11.87 KB)
📄
AttrIterator.h
(4.14 KB)
📄
AttrVisitor.h
(2.56 KB)
📄
Availability.h
(1.97 KB)
📄
BaseSubobject.h
(2.74 KB)
📄
BuiltinTypes.def
(9.91 KB)
📄
CXXInheritance.h
(14.87 KB)
📄
CXXRecordDeclDefinitionBits.def
(9.23 KB)
📄
CanonicalType.h
(24.86 KB)
📄
CharUnits.h
(8.02 KB)
📄
Comment.h
(31.03 KB)
📄
CommentBriefParser.h
(1.39 KB)
📄
CommentCommandTraits.h
(5.86 KB)
📄
CommentCommands.td
(9.27 KB)
📄
CommentDiagnostic.h
(509 B)
📄
CommentHTMLNamedCharacterReferences.td
(4.98 KB)
📄
CommentHTMLTags.td
(2.17 KB)
📄
CommentLexer.h
(9.96 KB)
📄
CommentParser.h
(3.24 KB)
📄
CommentSema.h
(9.87 KB)
📄
CommentVisitor.h
(2.38 KB)
📄
ComparisonCategories.h
(7.41 KB)
📄
ComputeDependence.h
(7.41 KB)
📄
CurrentSourceLocExprScope.h
(2.43 KB)
📄
DataCollection.h
(2.45 KB)
📄
Decl.h
(168.07 KB)
📄
DeclAccessPair.h
(1.77 KB)
📄
DeclBase.h
(93.13 KB)
📄
DeclCXX.h
(151.69 KB)
📄
DeclContextInternals.h
(8.22 KB)
📄
DeclFriend.h
(8.06 KB)
📄
DeclGroup.h
(4.11 KB)
📄
DeclLookups.h
(3.64 KB)
📄
DeclObjC.h
(101.2 KB)
📄
DeclObjCCommon.h
(1.72 KB)
📄
DeclOpenMP.h
(19.33 KB)
📄
DeclTemplate.h
(122.19 KB)
📄
DeclVisitor.h
(2.51 KB)
📄
DeclarationName.h
(33.77 KB)
📄
DependenceFlags.h
(10.99 KB)
📄
DependentDiagnostic.h
(5.4 KB)
📄
EvaluatedExprVisitor.h
(4.45 KB)
📄
Expr.h
(234.85 KB)
📄
ExprCXX.h
(169.78 KB)
📄
ExprConcepts.h
(19.62 KB)
📄
ExprObjC.h
(58.96 KB)
📄
ExprOpenMP.h
(15.48 KB)
📄
ExternalASTMerger.h
(8.11 KB)
📄
ExternalASTSource.h
(20.55 KB)
📄
FormatString.h
(22.81 KB)
📄
GlobalDecl.h
(7.16 KB)
📄
JSONNodeDumper.h
(17.53 KB)
📄
LambdaCapture.h
(4.71 KB)
📄
LexicallyOrderedRecursiveASTVisitor.h
(5.92 KB)
📄
LocInfoType.h
(1.84 KB)
📄
Mangle.h
(10.65 KB)
📄
MangleNumberingContext.h
(2 KB)
📄
NSAPI.h
(9.23 KB)
📄
NestedNameSpecifier.h
(18.53 KB)
📄
NonTrivialTypeVisitor.h
(4 KB)
📄
ODRHash.h
(3.42 KB)
📄
OSLog.h
(5.08 KB)
📄
OpenMPClause.h
(276.08 KB)
📄
OperationKinds.def
(14.91 KB)
📄
OperationKinds.h
(1.5 KB)
📄
OptionalDiagnostic.h
(2.39 KB)
📄
ParentMap.h
(1.89 KB)
📄
ParentMapContext.h
(4.74 KB)
📄
PrettyDeclStackTrace.h
(1.39 KB)
📄
PrettyPrinter.h
(8.47 KB)
📄
PropertiesBase.td
(17.03 KB)
📄
QualTypeNames.h
(3.15 KB)
📄
RawCommentList.h
(6.6 KB)
📄
RecordLayout.h
(11.49 KB)
📄
RecursiveASTVisitor.h
(124.41 KB)
📄
Redeclarable.h
(14.34 KB)
📄
SelectorLocationsKind.h
(3.28 KB)
📄
Stmt.h
(113 KB)
📄
StmtCXX.h
(17.59 KB)
📄
StmtDataCollectors.td
(5.64 KB)
📄
StmtGraphTraits.h
(2.18 KB)
📄
StmtIterator.h
(4.2 KB)
📄
StmtObjC.h
(12.86 KB)
📄
StmtOpenMP.h
(189.5 KB)
📄
StmtVisitor.h
(8.74 KB)
📄
TemplateArgumentVisitor.h
(3.38 KB)
📄
TemplateBase.h
(22.86 KB)
📄
TemplateName.h
(19.34 KB)
📄
TextNodeDumper.h
(15.7 KB)
📄
Type.h
(248.38 KB)
📄
TypeLoc.h
(73.03 KB)
📄
TypeLocNodes.def
(1.45 KB)
📄
TypeLocVisitor.h
(1.76 KB)
📄
TypeOrdering.h
(2.38 KB)
📄
TypeProperties.td
(25.87 KB)
📄
TypeVisitor.h
(3.32 KB)
📄
UnresolvedSet.h
(5.25 KB)
📄
VTTBuilder.h
(5.19 KB)
📄
VTableBuilder.h
(20.31 KB)
Editing: TypeProperties.td
//==--- TypeProperties.td - Type property definitions ---------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// include "clang/AST/PropertiesBase.td" include "clang/Basic/TypeNodes.td" let Class = ComplexType in { def : Property<"elementType", QualType> { let Read = [{ node->getElementType() }]; } def : Creator<[{ return ctx.getComplexType(elementType); }]>; } let Class = PointerType in { def : Property<"pointeeType", QualType> { let Read = [{ node->getPointeeType() }]; } def : Creator<[{ return ctx.getPointerType(pointeeType); }]>; } let Class = AdjustedType in { def : Property<"originalType", QualType> { let Read = [{ node->getOriginalType() }]; } def : Property<"adjustedType", QualType> { let Read = [{ node->getAdjustedType() }]; } def : Creator<[{ return ctx.getAdjustedType(originalType, adjustedType); }]>; } let Class = DecayedType in { def : Override { // We don't need to serialize the adjusted type because we can always // derive it by decaying the original type. let IgnoredProperties = [ "adjustedType" ]; } def : Creator<[{ return ctx.getAdjustedParameterType(originalType); }]>; } let Class = BlockPointerType in { def : Property<"pointeeType", QualType> { let Read = [{ node->getPointeeType() }]; } def : Creator<[{ return ctx.getBlockPointerType(pointeeType); }]>; } let Class = ReferenceType in { def : Property<"pointeeTypeAsWritten", QualType> { let Read = [{ node->getPointeeTypeAsWritten() }]; } } let Class = LValueReferenceType in { def : Property<"isSpelledAsLValue", Bool> { let Read = [{ node->isSpelledAsLValue() }]; } def : Creator<[{ return ctx.getLValueReferenceType(pointeeTypeAsWritten, isSpelledAsLValue); }]>; } let Class = RValueReferenceType in { def : Creator<[{ return ctx.getRValueReferenceType(pointeeTypeAsWritten); }]>; } let Class = MemberPointerType in { def : Property<"pointeeType", QualType> { let Read = [{ node->getPointeeType() }]; } def : Property<"baseType", QualType> { let Read = [{ QualType(node->getClass(), 0) }]; } def : Creator<[{ return ctx.getMemberPointerType(pointeeType, baseType.getTypePtr()); }]>; } let Class = ArrayType in { def : Property<"elementType", QualType> { let Read = [{ node->getElementType() }]; } def : Property<"sizeModifier", ArraySizeModifier> { let Read = [{ node->getSizeModifier() }]; } def : Property<"indexQualifiers", Qualifiers> { let Read = [{ Qualifiers::fromCVRMask(node->getIndexTypeCVRQualifiers()) }]; } } let Class = ConstantArrayType in { def : Property<"sizeValue", APInt> { let Read = [{ node->getSize() }]; } def : Property<"size", ExprRef> { let Read = [{ node->getSizeExpr() }]; } def : Creator<[{ return ctx.getConstantArrayType(elementType, sizeValue, size, sizeModifier, indexQualifiers.getCVRQualifiers()); }]>; } let Class = IncompleteArrayType in { def : Creator<[{ return ctx.getIncompleteArrayType(elementType, sizeModifier, indexQualifiers.getCVRQualifiers()); }]>; } let Class = VariableArrayType in { def : Property<"leftBracketLoc", SourceLocation> { let Read = [{ node->getLBracketLoc() }]; } def : Property<"rightBracketLoc", SourceLocation> { let Read = [{ node->getRBracketLoc() }]; } def : Property<"size", ExprRef> { let Read = [{ node->getSizeExpr() }]; } def : Creator<[{ return ctx.getVariableArrayType(elementType, size, sizeModifier, indexQualifiers.getCVRQualifiers(), SourceRange(leftBracketLoc, rightBracketLoc)); }]>; } let Class = DependentSizedArrayType in { def : Property<"size", ExprRef> { let Read = [{ node->getSizeExpr() }]; } def : Property<"leftBracketLoc", SourceLocation> { let Read = [{ node->getLBracketLoc() }]; } def : Property<"rightBracketLoc", SourceLocation> { let Read = [{ node->getRBracketLoc() }]; } def : Creator<[{ return ctx.getDependentSizedArrayType(elementType, size, sizeModifier, indexQualifiers.getCVRQualifiers(), SourceRange(leftBracketLoc, rightBracketLoc)); }]>; } let Class = VectorType in { def : Property<"elementType", QualType> { let Read = [{ node->getElementType() }]; } def : Property<"numElements", UInt32> { let Read = [{ node->getNumElements() }]; } def : Property<"vectorKind", VectorKind> { let Read = [{ node->getVectorKind() }]; } def : Creator<[{ return ctx.getVectorType(elementType, numElements, vectorKind); }]>; } let Class = DependentVectorType in { def : Property<"elementType", QualType> { let Read = [{ node->getElementType() }]; } def : Property<"size", ExprRef> { let Read = [{ node->getSizeExpr() }]; } def : Property<"attributeLoc", SourceLocation> { let Read = [{ node->getAttributeLoc() }]; } def : Property<"vectorKind", VectorKind> { let Read = [{ node->getVectorKind() }]; } def : Creator<[{ return ctx.getDependentVectorType(elementType, size, attributeLoc, vectorKind); }]>; } let Class = ExtVectorType in { def : Override { let IgnoredProperties = [ "vectorKind" ]; } def : Creator<[{ return ctx.getExtVectorType(elementType, numElements); }]>; } let Class = DependentSizedExtVectorType in { def : Property<"elementType", QualType> { let Read = [{ node->getElementType() }]; } def : Property<"size", ExprRef> { let Read = [{ node->getSizeExpr() }]; } def : Property<"attributeLoc", SourceLocation> { let Read = [{ node->getAttributeLoc() }]; } def : Creator<[{ return ctx.getDependentSizedExtVectorType(elementType, size, attributeLoc); }]>; } let Class = MatrixType in { def : Property<"elementType", QualType> { let Read = [{ node->getElementType() }]; } } let Class = ConstantMatrixType in { def : Property<"numRows", UInt32> { let Read = [{ node->getNumRows() }]; } def : Property<"numColumns", UInt32> { let Read = [{ node->getNumColumns() }]; } def : Creator<[{ return ctx.getConstantMatrixType(elementType, numRows, numColumns); }]>; } let Class = DependentSizedMatrixType in { def : Property<"rows", ExprRef> { let Read = [{ node->getRowExpr() }]; } def : Property<"columns", ExprRef> { let Read = [{ node->getColumnExpr() }]; } def : Property<"attributeLoc", SourceLocation> { let Read = [{ node->getAttributeLoc() }]; } def : Creator<[{ return ctx.getDependentSizedMatrixType(elementType, rows, columns, attributeLoc); }]>; } let Class = FunctionType in { def : Property<"returnType", QualType> { let Read = [{ node->getReturnType() }]; } def : Property<"noReturn", Bool> { let Read = [{ node->getExtInfo().getNoReturn() }]; } def : Property<"hasRegParm", Bool> { let Read = [{ node->getExtInfo().getHasRegParm() }]; } def : Property<"regParm", UInt32> { let Read = [{ node->getExtInfo().getRegParm() }]; } def : Property<"callingConvention", CallingConv> { let Read = [{ node->getExtInfo().getCC() }]; } def : Property<"producesResult", Bool> { let Read = [{ node->getExtInfo().getProducesResult() }]; } def : Property<"noCallerSavedRegs", Bool> { let Read = [{ node->getExtInfo().getNoCallerSavedRegs() }]; } def : Property<"noCfCheck", Bool> { let Read = [{ node->getExtInfo().getNoCfCheck() }]; } def : Property<"cmseNSCall", Bool> { let Read = [{ node->getExtInfo().getCmseNSCall() }]; } } let Class = FunctionNoProtoType in { def : Creator<[{ auto extInfo = FunctionType::ExtInfo(noReturn, hasRegParm, regParm, callingConvention, producesResult, noCallerSavedRegs, noCfCheck, cmseNSCall); return ctx.getFunctionNoProtoType(returnType, extInfo); }]>; } let Class = FunctionProtoType in { def : Property<"variadic", Bool> { let Read = [{ node->isVariadic() }]; } def : Property<"trailingReturn", Bool> { let Read = [{ node->hasTrailingReturn() }]; } def : Property<"methodQualifiers", Qualifiers> { let Read = [{ node->getMethodQuals() }]; } def : Property<"refQualifier", RefQualifierKind> { let Read = [{ node->getRefQualifier() }]; } def : Property<"exceptionSpecifier", ExceptionSpecInfo> { let Read = [{ node->getExceptionSpecInfo() }]; } def : Property<"parameters", Array<QualType>> { let Read = [{ node->getParamTypes() }]; } def : Property<"extParameterInfo", Array<ExtParameterInfo>> { let Read = [{ node->hasExtParameterInfos() ? node->getExtParameterInfos() : llvm::ArrayRef<FunctionProtoType::ExtParameterInfo>() }]; } def : Creator<[{ auto extInfo = FunctionType::ExtInfo(noReturn, hasRegParm, regParm, callingConvention, producesResult, noCallerSavedRegs, noCfCheck, cmseNSCall); FunctionProtoType::ExtProtoInfo epi; epi.ExtInfo = extInfo; epi.Variadic = variadic; epi.HasTrailingReturn = trailingReturn; epi.TypeQuals = methodQualifiers; epi.RefQualifier = refQualifier; epi.ExceptionSpec = exceptionSpecifier; epi.ExtParameterInfos = extParameterInfo.empty() ? nullptr : extParameterInfo.data(); return ctx.getFunctionType(returnType, parameters, epi); }]>; } let Class = AtomicType in { def : Property<"valueType", QualType> { let Read = [{ node->getValueType() }]; } def : Creator<[{ return ctx.getAtomicType(valueType); }]>; } let Class = UnresolvedUsingType in { def : Property<"declaration", DeclRef> { let Read = [{ node->getDecl() }]; } def : Creator<[{ return ctx.getTypeDeclType(cast<UnresolvedUsingTypenameDecl>(declaration)); }]>; } let Class = TypedefType in { def : Property<"declaration", DeclRef> { let Read = [{ node->getDecl() }]; } def : Property<"canonicalType", Optional<QualType>> { let Read = [{ makeOptionalFromNullable(node->getCanonicalTypeInternal()) }]; } def : Creator<[{ QualType finalCanonicalType = canonicalType ? ctx.getCanonicalType(*canonicalType) : QualType(); return ctx.getTypedefType(cast<TypedefNameDecl>(declaration), finalCanonicalType); }]>; } let Class = TypeOfExprType in { def : Property<"expression", ExprRef> { let Read = [{ node->getUnderlyingExpr() }]; } def : Creator<[{ return ctx.getTypeOfExprType(expression); }]>; } let Class = TypeOfType in { def : Property<"underlyingType", QualType> { let Read = [{ node->getUnderlyingType() }]; } def : Creator<[{ return ctx.getTypeOfType(underlyingType); }]>; } let Class = DecltypeType in { def : Property<"underlyingType", QualType> { let Read = [{ node->getUnderlyingType() }]; } def : Property<"expression", ExprRef> { let Read = [{ node->getUnderlyingExpr() }]; } def : Creator<[{ return ctx.getDecltypeType(expression, underlyingType); }]>; } let Class = UnaryTransformType in { def : Property<"baseType", QualType> { let Read = [{ node->getBaseType() }]; } def : Property<"underlyingType", QualType> { let Read = [{ node->getUnderlyingType() }]; } def : Property<"transform", UnaryTypeTransformKind> { let Read = [{ node->getUTTKind() }]; } def : Creator<[{ return ctx.getUnaryTransformType(baseType, underlyingType, transform); }]>; } let Class = AutoType in { def : Property<"deducedType", Optional<QualType>> { let Read = [{ makeOptionalFromNullable(node->getDeducedType()) }]; } def : Property<"keyword", AutoTypeKeyword> { let Read = [{ node->getKeyword() }]; } def : Property<"typeConstraintConcept", Optional<ConceptDeclRef>> { let Read = [{ makeOptionalFromPointer( const_cast<const ConceptDecl*>(node->getTypeConstraintConcept())) }]; } def : Property<"typeConstraintArguments", Array<TemplateArgument>> { let Read = [{ node->getTypeConstraintArguments() }]; } // FIXME: better enumerated value // Only really required when the deduced type is null def : Property<"dependence", UInt32> { let Read = [{ !node->getDeducedType().isNull() ? 0 : node->containsUnexpandedParameterPack() ? 2 : node->isDependentType() ? 1 : 0 }]; } def : Creator<[{ return ctx.getAutoType(makeNullableFromOptional(deducedType), keyword, /*isDependentWithoutDeducedType*/ dependence > 0, /*isPackWithoutDeducedType*/ dependence > 1, makePointerFromOptional(typeConstraintConcept), typeConstraintArguments); }]>; } let Class = DeducedTemplateSpecializationType in { def : Property<"templateName", Optional<TemplateName>> { let Read = [{ makeOptionalFromNullable(node->getTemplateName()) }]; } def : Property<"deducedType", QualType> { let Read = [{ node->getDeducedType() }]; } // Only really required when the deduced type is null def : Property<"dependent", Bool> { let Read = [{ !node->getDeducedType().isNull() ? false : node->isDependentType() }]; } def : Creator<[{ return ctx.getDeducedTemplateSpecializationType( makeNullableFromOptional(templateName), deducedType, dependent); }]>; } let Class = TagType in { def : Property<"dependent", Bool> { let Read = [{ node->isDependentType() }]; } def : Property<"declaration", DeclRef> { // Serializing a reference to the canonical declaration is apparently // necessary to make module-merging work. let Read = [{ node->getDecl()->getCanonicalDecl() }]; } } let Class = EnumType in { def : Creator<[{ QualType result = ctx.getEnumType(cast<EnumDecl>(declaration)); if (dependent) const_cast<Type *>(result.getTypePtr()) ->addDependence(TypeDependence::DependentInstantiation); return result; }]>; } let Class = RecordType in { def : Creator<[{ auto record = cast<RecordDecl>(declaration); QualType result = ctx.getRecordType(record); if (dependent) const_cast<Type *>(result.getTypePtr()) ->addDependence(TypeDependence::DependentInstantiation); return result; }]>; } let Class = ElaboratedType in { def : Property<"keyword", ElaboratedTypeKeyword> { let Read = [{ node->getKeyword() }]; } def : Property<"qualifier", NestedNameSpecifier> { let Read = [{ node->getQualifier() }]; } def : Property<"namedType", QualType> { let Read = [{ node->getNamedType() }]; } def : Property<"ownedTag", Optional<TagDeclRef>> { let Read = [{ makeOptionalFromPointer( const_cast<const TagDecl *>(node->getOwnedTagDecl())) }]; } def : Creator<[{ return ctx.getElaboratedType(keyword, qualifier, namedType, makePointerFromOptional(ownedTag)); }]>; } let Class = InjectedClassNameType in { def : Property<"declaration", DeclRef> { // FIXME: drilling down to the canonical declaration is what the // existing serialization code was doing, but it's not clear why. let Read = [{ node->getDecl()->getCanonicalDecl() }]; } def : Property<"injectedSpecializationType", QualType> { let Read = [{ node->getInjectedSpecializationType() }]; } def : Creator<[{ // FIXME: ASTContext::getInjectedClassNameType is not currently suitable // for AST reading, too much interdependencies. const Type *T = nullptr; auto typeDecl = cast<CXXRecordDecl>(declaration); for (auto *DI = typeDecl; DI; DI = DI->getPreviousDecl()) { if (const Type *existing = DI->getTypeForDecl()) { T = existing; break; } } if (!T) { T = new (ctx, TypeAlignment) InjectedClassNameType(typeDecl, injectedSpecializationType); for (auto *DI = typeDecl; DI; DI = DI->getPreviousDecl()) DI->setTypeForDecl(T); } return QualType(T, 0); }]>; } let Class = ParenType in { def : Property<"innerType", QualType> { let Read = [{ node->getInnerType() }]; } def : Creator<[{ return ctx.getParenType(innerType); }]>; } let Class = MacroQualifiedType in { def : Property<"underlyingType", QualType> { let Read = [{ node->getUnderlyingType() }]; } def : Property<"macroIdentifier", Identifier> { let Read = [{ node->getMacroIdentifier() }]; } def : Creator<[{ return ctx.getMacroQualifiedType(underlyingType, macroIdentifier); }]>; } let Class = AttributedType in { def : Property<"modifiedType", QualType> { let Read = [{ node->getModifiedType() }]; } def : Property<"equivalentType", QualType> { let Read = [{ node->getEquivalentType() }]; } def : Property<"attribute", AttrKind> { let Read = [{ node->getAttrKind() }]; } def : Creator<[{ return ctx.getAttributedType(attribute, modifiedType, equivalentType); }]>; } let Class = DependentAddressSpaceType in { def : Property<"pointeeType", QualType> { let Read = [{ node->getPointeeType() }]; } def : Property<"addressSpace", ExprRef> { let Read = [{ node->getAddrSpaceExpr() }]; } def : Property<"attributeLoc", SourceLocation> { let Read = [{ node->getAttributeLoc() }]; } def : Creator<[{ return ctx.getDependentAddressSpaceType(pointeeType, addressSpace, attributeLoc); }]>; } let Class = TemplateSpecializationType in { def : Property<"dependent", Bool> { let Read = [{ node->isDependentType() }]; } def : Property<"templateName", TemplateName> { let Read = [{ node->getTemplateName() }]; } def : Property<"templateArguments", Array<TemplateArgument>> { let Read = [{ node->template_arguments() }]; } def : Property<"underlyingType", Optional<QualType>> { let Read = [{ node->isTypeAlias() ? llvm::Optional<QualType>(node->getAliasedType()) : node->isCanonicalUnqualified() ? llvm::None : llvm::Optional<QualType>(node->getCanonicalTypeInternal()) }]; } def : Creator<[{ QualType result; if (!underlyingType.hasValue()) { result = ctx.getCanonicalTemplateSpecializationType(templateName, templateArguments); } else { result = ctx.getTemplateSpecializationType(templateName, templateArguments, *underlyingType); } if (dependent) const_cast<Type *>(result.getTypePtr()) ->addDependence(TypeDependence::DependentInstantiation); return result; }]>; } let Class = DependentTemplateSpecializationType in { def : Property<"keyword", ElaboratedTypeKeyword> { let Read = [{ node->getKeyword() }]; } def : Property<"qualifier", NestedNameSpecifier> { let Read = [{ node->getQualifier() }]; } def : Property<"name", Identifier> { let Read = [{ node->getIdentifier() }]; } def : Property<"templateArguments", Array<TemplateArgument>> { let Read = [{ node->template_arguments() }]; } def : Creator<[{ return ctx.getDependentTemplateSpecializationType(keyword, qualifier, name, templateArguments); }]>; } let Class = TemplateTypeParmType in { def : Property<"depth", UInt32> { let Read = [{ node->getDepth() }]; } def : Property<"index", UInt32> { let Read = [{ node->getIndex() }]; } def : Property<"isParameterPack", Bool> { let Read = [{ node->isParameterPack() }]; } def : Property<"declaration", Optional<TemplateTypeParmDeclRef>> { let Read = [{ makeOptionalFromPointer( const_cast<const TemplateTypeParmDecl*>(node->getDecl())) }]; } def : Creator<[{ return ctx.getTemplateTypeParmType(depth, index, isParameterPack, makePointerFromOptional(declaration)); }]>; } let Class = SubstTemplateTypeParmType in { def : Property<"replacedParameter", QualType> { let Read = [{ QualType(node->getReplacedParameter(), 0) }]; } def : Property<"replacementType", QualType> { let Read = [{ node->getReplacementType() }]; } def : Creator<[{ // The call to getCanonicalType here existed in ASTReader.cpp, too. return ctx.getSubstTemplateTypeParmType( cast<TemplateTypeParmType>(replacedParameter), ctx.getCanonicalType(replacementType)); }]>; } let Class = PackExpansionType in { def : Property<"pattern", QualType> { let Read = [{ node->getPattern() }]; } def : Property<"numExpansions", Optional<UInt32>> { let Read = [{ node->getNumExpansions() }]; } def : Creator<[{ return ctx.getPackExpansionType(pattern, numExpansions, /*ExpectPackInType*/false); }]>; } let Class = SubstTemplateTypeParmPackType in { def : Property<"replacedParameter", QualType> { let Read = [{ QualType(node->getReplacedParameter(), 0) }]; } def : Property<"replacementPack", TemplateArgument> { let Read = [{ node->getArgumentPack() }]; } def : Creator<[{ return ctx.getSubstTemplateTypeParmPackType( cast<TemplateTypeParmType>(replacedParameter), replacementPack); }]>; } let Class = BuiltinType in { def : Property<"kind", BuiltinTypeKind> { let Read = [{ node->getKind() }]; } def : Creator<[{ switch (kind) { #define IMAGE_TYPE(IMGTYPE, ID, SINGLETON_ID, ACCESS, SUFFIX) \ case BuiltinType::ID: return ctx.SINGLETON_ID; #include "clang/Basic/OpenCLImageTypes.def" #define EXT_OPAQUE_TYPE(EXTTYPE, ID, EXT) \ case BuiltinType::ID: return ctx.ID##Ty; #include "clang/Basic/OpenCLExtensionTypes.def" #define SVE_TYPE(NAME, ID, SINGLETON_ID) \ case BuiltinType::ID: return ctx.SINGLETON_ID; #include "clang/Basic/AArch64SVEACLETypes.def" #define BUILTIN_TYPE(ID, SINGLETON_ID) \ case BuiltinType::ID: return ctx.SINGLETON_ID; #include "clang/AST/BuiltinTypes.def" } llvm_unreachable("unreachable builtin case"); }]>; } let Class = DependentNameType in { def : Property<"keyword", ElaboratedTypeKeyword> { let Read = [{ node->getKeyword() }]; } def : Property<"qualifier", NestedNameSpecifier> { let Read = [{ node->getQualifier() }]; } def : Property<"name", Identifier> { let Read = [{ node->getIdentifier() }]; } def : Property<"underlyingType", Optional<QualType>> { let Read = [{ node->isCanonicalUnqualified() ? llvm::None : llvm::Optional<QualType>(node->getCanonicalTypeInternal()) }]; } def : Creator<[{ QualType canon = (underlyingType ? ctx.getCanonicalType(*underlyingType) : QualType()); return ctx.getDependentNameType(keyword, qualifier, name, canon); }]>; } let Class = ObjCObjectType in { def : Property<"baseType", QualType> { let Read = [{ node->getBaseType() }]; } def : Property<"typeArgsAsWritten", Array<QualType>> { let Read = [{ node->getTypeArgsAsWritten() }]; } def : Property<"qualifiers", Array<ObjCProtocolDeclRef>> { let Read = [{ node->getProtocols() }]; } def : Property<"isKindOfTypeAsWritten", Bool> { let Read = [{ node->isKindOfTypeAsWritten() }]; } def : Creator<[{ return ctx.getObjCObjectType(baseType, typeArgsAsWritten, qualifiers, isKindOfTypeAsWritten); }]>; } let Class = ObjCInterfaceType in { // We don't actually want any of the properties of the superclass. def : Override { let IgnoredProperties = [ "baseType", "typeArgsAsWritten", "qualifiers", "isKindOfTypeAsWritten" ]; } def : Property<"declaration", DeclRef> { // FIXME: drilling down to the canonical declaration is what the // existing serialization code was doing, but it's not clear why. let Read = [{ node->getDecl()->getCanonicalDecl() }]; } def : Creator<[{ return ctx.getObjCInterfaceType( cast<ObjCInterfaceDecl>(declaration->getCanonicalDecl())); }]>; } let Class = ObjCTypeParamType in { def : Property<"declaration", ObjCTypeParamDeclRef> { let Read = [{ node->getDecl() }]; } def : Property<"qualifiers", Array<ObjCProtocolDeclRef>> { let Read = [{ node->getProtocols() }]; } def : Creator<[{ return ctx.getObjCTypeParamType(declaration, qualifiers); }]>; } let Class = ObjCObjectPointerType in { def : Property<"pointeeType", QualType> { let Read = [{ node->getPointeeType() }]; } def : Creator<[{ return ctx.getObjCObjectPointerType(pointeeType); }]>; } let Class = PipeType in { def : Property<"elementType", QualType> { let Read = [{ node->getElementType() }]; } def : Property<"isReadOnly", Bool> { let Read = [{ node->isReadOnly() }]; } def : Creator<[{ return ctx.getPipeType(elementType, isReadOnly); }]>; } let Class = ExtIntType in { def : Property<"isUnsigned", Bool> { let Read = [{ node->isUnsigned() }]; } def : Property <"numBits", UInt32> { let Read = [{ node->getNumBits() }]; } def : Creator<[{ return ctx.getExtIntType(isUnsigned, numBits); }]>; } let Class = DependentExtIntType in { def : Property<"isUnsigned", Bool> { let Read = [{ node->isUnsigned() }]; } def : Property <"numBitsExpr", ExprRef> { let Read = [{ node->getNumBitsExpr() }]; } def : Creator<[{ return ctx.getDependentExtIntType(isUnsigned, numBitsExpr); }]>; }
Upload File
Create Folder