/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* A CRTP writer for Clang Type nodes *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ template class AbstractTypeWriter { public: PropertyWriter &W; AbstractTypeWriter(PropertyWriter &W) : W(W) {} void write(const Type *node) { switch (node->getTypeClass()) { case Type::Adjusted: return writeAdjustedType(static_cast(node)); case Type::Decayed: return writeDecayedType(static_cast(node)); case Type::ConstantArray: return writeConstantArrayType(static_cast(node)); case Type::DependentSizedArray: return writeDependentSizedArrayType(static_cast(node)); case Type::IncompleteArray: return writeIncompleteArrayType(static_cast(node)); case Type::VariableArray: return writeVariableArrayType(static_cast(node)); case Type::Atomic: return writeAtomicType(static_cast(node)); case Type::Attributed: return writeAttributedType(static_cast(node)); case Type::BlockPointer: return writeBlockPointerType(static_cast(node)); case Type::Builtin: return writeBuiltinType(static_cast(node)); case Type::Complex: return writeComplexType(static_cast(node)); case Type::Decltype: return writeDecltypeType(static_cast(node)); case Type::Auto: return writeAutoType(static_cast(node)); case Type::DeducedTemplateSpecialization: return writeDeducedTemplateSpecializationType(static_cast(node)); case Type::DependentAddressSpace: return writeDependentAddressSpaceType(static_cast(node)); case Type::DependentName: return writeDependentNameType(static_cast(node)); case Type::DependentSizedExtVector: return writeDependentSizedExtVectorType(static_cast(node)); case Type::DependentTemplateSpecialization: return writeDependentTemplateSpecializationType(static_cast(node)); case Type::DependentVector: return writeDependentVectorType(static_cast(node)); case Type::Elaborated: return writeElaboratedType(static_cast(node)); case Type::FunctionNoProto: return writeFunctionNoProtoType(static_cast(node)); case Type::FunctionProto: return writeFunctionProtoType(static_cast(node)); case Type::InjectedClassName: return writeInjectedClassNameType(static_cast(node)); case Type::MacroQualified: return writeMacroQualifiedType(static_cast(node)); case Type::MemberPointer: return writeMemberPointerType(static_cast(node)); case Type::ObjCObjectPointer: return writeObjCObjectPointerType(static_cast(node)); case Type::ObjCObject: return writeObjCObjectType(static_cast(node)); case Type::ObjCInterface: return writeObjCInterfaceType(static_cast(node)); case Type::ObjCTypeParam: return writeObjCTypeParamType(static_cast(node)); case Type::PackExpansion: return writePackExpansionType(static_cast(node)); case Type::Paren: return writeParenType(static_cast(node)); case Type::Pipe: return writePipeType(static_cast(node)); case Type::Pointer: return writePointerType(static_cast(node)); case Type::LValueReference: return writeLValueReferenceType(static_cast(node)); case Type::RValueReference: return writeRValueReferenceType(static_cast(node)); case Type::SubstTemplateTypeParmPack: return writeSubstTemplateTypeParmPackType(static_cast(node)); case Type::SubstTemplateTypeParm: return writeSubstTemplateTypeParmType(static_cast(node)); case Type::Enum: return writeEnumType(static_cast(node)); case Type::Record: return writeRecordType(static_cast(node)); case Type::TemplateSpecialization: return writeTemplateSpecializationType(static_cast(node)); case Type::TemplateTypeParm: return writeTemplateTypeParmType(static_cast(node)); case Type::TypeOfExpr: return writeTypeOfExprType(static_cast(node)); case Type::TypeOf: return writeTypeOfType(static_cast(node)); case Type::Typedef: return writeTypedefType(static_cast(node)); case Type::UnaryTransform: return writeUnaryTransformType(static_cast(node)); case Type::UnresolvedUsing: return writeUnresolvedUsingType(static_cast(node)); case Type::Vector: return writeVectorType(static_cast(node)); case Type::ExtVector: return writeExtVectorType(static_cast(node)); } llvm_unreachable("bad kind"); } void writeAdjustedType(const AdjustedType *node) { QualType originalType = ( node->getOriginalType() ); W.find("originalType").writeQualType(originalType); QualType adjustedType = ( node->getAdjustedType() ); W.find("adjustedType").writeQualType(adjustedType); } void writeDecayedType(const DecayedType *node) { QualType originalType = ( node->getOriginalType() ); W.find("originalType").writeQualType(originalType); } void writeConstantArrayType(const ConstantArrayType *node) { llvm::APInt sizeValue = ( node->getSize() ); W.find("sizeValue").writeAPInt(sizeValue); const Expr* size = ( node->getSizeExpr() ); W.find("size").writeExprRef(size); QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); ArrayType::ArraySizeModifier sizeModifier = ( node->getSizeModifier() ); W.find("sizeModifier").writeArraySizeModifier(sizeModifier); Qualifiers indexQualifiers = ( Qualifiers::fromCVRMask(node->getIndexTypeCVRQualifiers()) ); W.find("indexQualifiers").writeQualifiers(indexQualifiers); } void writeDependentSizedArrayType(const DependentSizedArrayType *node) { const Expr* size = ( node->getSizeExpr() ); W.find("size").writeExprRef(size); SourceLocation leftBracketLoc = ( node->getLBracketLoc() ); W.find("leftBracketLoc").writeSourceLocation(leftBracketLoc); SourceLocation rightBracketLoc = ( node->getRBracketLoc() ); W.find("rightBracketLoc").writeSourceLocation(rightBracketLoc); QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); ArrayType::ArraySizeModifier sizeModifier = ( node->getSizeModifier() ); W.find("sizeModifier").writeArraySizeModifier(sizeModifier); Qualifiers indexQualifiers = ( Qualifiers::fromCVRMask(node->getIndexTypeCVRQualifiers()) ); W.find("indexQualifiers").writeQualifiers(indexQualifiers); } void writeIncompleteArrayType(const IncompleteArrayType *node) { QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); ArrayType::ArraySizeModifier sizeModifier = ( node->getSizeModifier() ); W.find("sizeModifier").writeArraySizeModifier(sizeModifier); Qualifiers indexQualifiers = ( Qualifiers::fromCVRMask(node->getIndexTypeCVRQualifiers()) ); W.find("indexQualifiers").writeQualifiers(indexQualifiers); } void writeVariableArrayType(const VariableArrayType *node) { SourceLocation leftBracketLoc = ( node->getLBracketLoc() ); W.find("leftBracketLoc").writeSourceLocation(leftBracketLoc); SourceLocation rightBracketLoc = ( node->getRBracketLoc() ); W.find("rightBracketLoc").writeSourceLocation(rightBracketLoc); const Expr* size = ( node->getSizeExpr() ); W.find("size").writeExprRef(size); QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); ArrayType::ArraySizeModifier sizeModifier = ( node->getSizeModifier() ); W.find("sizeModifier").writeArraySizeModifier(sizeModifier); Qualifiers indexQualifiers = ( Qualifiers::fromCVRMask(node->getIndexTypeCVRQualifiers()) ); W.find("indexQualifiers").writeQualifiers(indexQualifiers); } void writeAtomicType(const AtomicType *node) { QualType valueType = ( node->getValueType() ); W.find("valueType").writeQualType(valueType); } void writeAttributedType(const AttributedType *node) { QualType modifiedType = ( node->getModifiedType() ); W.find("modifiedType").writeQualType(modifiedType); QualType equivalentType = ( node->getEquivalentType() ); W.find("equivalentType").writeQualType(equivalentType); attr::Kind attribute = ( node->getAttrKind() ); W.find("attribute").writeAttrKind(attribute); } void writeBlockPointerType(const BlockPointerType *node) { QualType pointeeType = ( node->getPointeeType() ); W.find("pointeeType").writeQualType(pointeeType); } void writeBuiltinType(const BuiltinType *node) { BuiltinType::Kind kind = ( node->getKind() ); W.find("kind").writeBuiltinTypeKind(kind); } void writeComplexType(const ComplexType *node) { QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); } void writeDecltypeType(const DecltypeType *node) { QualType underlyingType = ( node->getUnderlyingType() ); W.find("underlyingType").writeQualType(underlyingType); const Expr* expression = ( node->getUnderlyingExpr() ); W.find("expression").writeExprRef(expression); } void writeAutoType(const AutoType *node) { llvm::Optional deducedType = ( makeOptionalFromNullable(node->getDeducedType()) ); W.find("deducedType").writeOptional(deducedType); AutoTypeKeyword keyword = ( node->getKeyword() ); W.find("keyword").writeAutoTypeKeyword(keyword); llvm::Optional typeConstraintConcept = ( makeOptionalFromPointer( const_cast(node->getTypeConstraintConcept())) ); W.find("typeConstraintConcept").writeOptional(typeConstraintConcept); llvm::ArrayRef typeConstraintArguments = ( node->getTypeConstraintArguments() ); W.find("typeConstraintArguments").writeArray(typeConstraintArguments); uint32_t dependence = ( !node->getDeducedType().isNull() ? 0 : node->containsUnexpandedParameterPack() ? 2 : node->isDependentType() ? 1 : 0 ); W.find("dependence").writeUInt32(dependence); } void writeDeducedTemplateSpecializationType(const DeducedTemplateSpecializationType *node) { llvm::Optional templateName = ( makeOptionalFromNullable(node->getTemplateName()) ); W.find("templateName").writeOptional(templateName); QualType deducedType = ( node->getDeducedType() ); W.find("deducedType").writeQualType(deducedType); bool dependent = ( !node->getDeducedType().isNull() ? false : node->isDependentType() ); W.find("dependent").writeBool(dependent); } void writeDependentAddressSpaceType(const DependentAddressSpaceType *node) { QualType pointeeType = ( node->getPointeeType() ); W.find("pointeeType").writeQualType(pointeeType); const Expr* addressSpace = ( node->getAddrSpaceExpr() ); W.find("addressSpace").writeExprRef(addressSpace); SourceLocation attributeLoc = ( node->getAttributeLoc() ); W.find("attributeLoc").writeSourceLocation(attributeLoc); } void writeDependentNameType(const DependentNameType *node) { ElaboratedTypeKeyword keyword = ( node->getKeyword() ); W.find("keyword").writeElaboratedTypeKeyword(keyword); NestedNameSpecifier * qualifier = ( node->getQualifier() ); W.find("qualifier").writeNestedNameSpecifier(qualifier); const IdentifierInfo* name = ( node->getIdentifier() ); W.find("name").writeIdentifier(name); llvm::Optional underlyingType = ( node->isCanonicalUnqualified() ? llvm::None : llvm::Optional(node->getCanonicalTypeInternal()) ); W.find("underlyingType").writeOptional(underlyingType); } void writeDependentSizedExtVectorType(const DependentSizedExtVectorType *node) { QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); const Expr* size = ( node->getSizeExpr() ); W.find("size").writeExprRef(size); SourceLocation attributeLoc = ( node->getAttributeLoc() ); W.find("attributeLoc").writeSourceLocation(attributeLoc); } void writeDependentTemplateSpecializationType(const DependentTemplateSpecializationType *node) { ElaboratedTypeKeyword keyword = ( node->getKeyword() ); W.find("keyword").writeElaboratedTypeKeyword(keyword); NestedNameSpecifier * qualifier = ( node->getQualifier() ); W.find("qualifier").writeNestedNameSpecifier(qualifier); const IdentifierInfo* name = ( node->getIdentifier() ); W.find("name").writeIdentifier(name); llvm::ArrayRef templateArguments = ( node->template_arguments() ); W.find("templateArguments").writeArray(templateArguments); } void writeDependentVectorType(const DependentVectorType *node) { QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); const Expr* size = ( node->getSizeExpr() ); W.find("size").writeExprRef(size); SourceLocation attributeLoc = ( node->getAttributeLoc() ); W.find("attributeLoc").writeSourceLocation(attributeLoc); VectorType::VectorKind vectorKind = ( node->getVectorKind() ); W.find("vectorKind").writeVectorKind(vectorKind); } void writeElaboratedType(const ElaboratedType *node) { ElaboratedTypeKeyword keyword = ( node->getKeyword() ); W.find("keyword").writeElaboratedTypeKeyword(keyword); NestedNameSpecifier * qualifier = ( node->getQualifier() ); W.find("qualifier").writeNestedNameSpecifier(qualifier); QualType namedType = ( node->getNamedType() ); W.find("namedType").writeQualType(namedType); llvm::Optional ownedTag = ( makeOptionalFromPointer( const_cast(node->getOwnedTagDecl())) ); W.find("ownedTag").writeOptional(ownedTag); } void writeFunctionNoProtoType(const FunctionNoProtoType *node) { QualType returnType = ( node->getReturnType() ); W.find("returnType").writeQualType(returnType); bool noReturn = ( node->getExtInfo().getNoReturn() ); W.find("noReturn").writeBool(noReturn); bool hasRegParm = ( node->getExtInfo().getHasRegParm() ); W.find("hasRegParm").writeBool(hasRegParm); uint32_t regParm = ( node->getExtInfo().getRegParm() ); W.find("regParm").writeUInt32(regParm); CallingConv callingConvention = ( node->getExtInfo().getCC() ); W.find("callingConvention").writeCallingConv(callingConvention); bool producesResult = ( node->getExtInfo().getProducesResult() ); W.find("producesResult").writeBool(producesResult); bool noCallerSavedRegs = ( node->getExtInfo().getNoCallerSavedRegs() ); W.find("noCallerSavedRegs").writeBool(noCallerSavedRegs); bool noCfCheck = ( node->getExtInfo().getNoCfCheck() ); W.find("noCfCheck").writeBool(noCfCheck); } void writeFunctionProtoType(const FunctionProtoType *node) { bool variadic = ( node->isVariadic() ); W.find("variadic").writeBool(variadic); bool trailingReturn = ( node->hasTrailingReturn() ); W.find("trailingReturn").writeBool(trailingReturn); Qualifiers methodQualifiers = ( node->getMethodQuals() ); W.find("methodQualifiers").writeQualifiers(methodQualifiers); RefQualifierKind refQualifier = ( node->getRefQualifier() ); W.find("refQualifier").writeRefQualifierKind(refQualifier); FunctionProtoType::ExceptionSpecInfo exceptionSpecifier = ( node->getExceptionSpecInfo() ); W.find("exceptionSpecifier").writeExceptionSpecInfo(exceptionSpecifier); llvm::ArrayRef parameters = ( node->getParamTypes() ); W.find("parameters").writeArray(parameters); llvm::ArrayRef extParameterInfo = ( node->hasExtParameterInfos() ? node->getExtParameterInfos() : llvm::ArrayRef() ); W.find("extParameterInfo").writeArray(extParameterInfo); QualType returnType = ( node->getReturnType() ); W.find("returnType").writeQualType(returnType); bool noReturn = ( node->getExtInfo().getNoReturn() ); W.find("noReturn").writeBool(noReturn); bool hasRegParm = ( node->getExtInfo().getHasRegParm() ); W.find("hasRegParm").writeBool(hasRegParm); uint32_t regParm = ( node->getExtInfo().getRegParm() ); W.find("regParm").writeUInt32(regParm); CallingConv callingConvention = ( node->getExtInfo().getCC() ); W.find("callingConvention").writeCallingConv(callingConvention); bool producesResult = ( node->getExtInfo().getProducesResult() ); W.find("producesResult").writeBool(producesResult); bool noCallerSavedRegs = ( node->getExtInfo().getNoCallerSavedRegs() ); W.find("noCallerSavedRegs").writeBool(noCallerSavedRegs); bool noCfCheck = ( node->getExtInfo().getNoCfCheck() ); W.find("noCfCheck").writeBool(noCfCheck); } void writeInjectedClassNameType(const InjectedClassNameType *node) { const Decl* declaration = ( node->getDecl()->getCanonicalDecl() ); W.find("declaration").writeDeclRef(declaration); QualType injectedSpecializationType = ( node->getInjectedSpecializationType() ); W.find("injectedSpecializationType").writeQualType(injectedSpecializationType); } void writeMacroQualifiedType(const MacroQualifiedType *node) { QualType underlyingType = ( node->getUnderlyingType() ); W.find("underlyingType").writeQualType(underlyingType); const IdentifierInfo* macroIdentifier = ( node->getMacroIdentifier() ); W.find("macroIdentifier").writeIdentifier(macroIdentifier); } void writeMemberPointerType(const MemberPointerType *node) { QualType pointeeType = ( node->getPointeeType() ); W.find("pointeeType").writeQualType(pointeeType); QualType baseType = ( QualType(node->getClass(), 0) ); W.find("baseType").writeQualType(baseType); } void writeObjCObjectPointerType(const ObjCObjectPointerType *node) { QualType pointeeType = ( node->getPointeeType() ); W.find("pointeeType").writeQualType(pointeeType); } void writeObjCObjectType(const ObjCObjectType *node) { QualType baseType = ( node->getBaseType() ); W.find("baseType").writeQualType(baseType); llvm::ArrayRef typeArgsAsWritten = ( node->getTypeArgsAsWritten() ); W.find("typeArgsAsWritten").writeArray(typeArgsAsWritten); llvm::ArrayRef qualifiers = ( node->getProtocols() ); W.find("qualifiers").writeArray(qualifiers); bool isKindOfTypeAsWritten = ( node->isKindOfTypeAsWritten() ); W.find("isKindOfTypeAsWritten").writeBool(isKindOfTypeAsWritten); } void writeObjCInterfaceType(const ObjCInterfaceType *node) { const Decl* declaration = ( node->getDecl()->getCanonicalDecl() ); W.find("declaration").writeDeclRef(declaration); } void writeObjCTypeParamType(const ObjCTypeParamType *node) { const ObjCTypeParamDecl* declaration = ( node->getDecl() ); W.find("declaration").writeObjCTypeParamDeclRef(declaration); llvm::ArrayRef qualifiers = ( node->getProtocols() ); W.find("qualifiers").writeArray(qualifiers); } void writePackExpansionType(const PackExpansionType *node) { QualType pattern = ( node->getPattern() ); W.find("pattern").writeQualType(pattern); llvm::Optional numExpansions = ( node->getNumExpansions() ); W.find("numExpansions").writeOptional(numExpansions); } void writeParenType(const ParenType *node) { QualType innerType = ( node->getInnerType() ); W.find("innerType").writeQualType(innerType); } void writePipeType(const PipeType *node) { QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); bool isReadOnly = ( node->isReadOnly() ); W.find("isReadOnly").writeBool(isReadOnly); } void writePointerType(const PointerType *node) { QualType pointeeType = ( node->getPointeeType() ); W.find("pointeeType").writeQualType(pointeeType); } void writeLValueReferenceType(const LValueReferenceType *node) { bool isSpelledAsLValue = ( node->isSpelledAsLValue() ); W.find("isSpelledAsLValue").writeBool(isSpelledAsLValue); QualType pointeeTypeAsWritten = ( node->getPointeeTypeAsWritten() ); W.find("pointeeTypeAsWritten").writeQualType(pointeeTypeAsWritten); } void writeRValueReferenceType(const RValueReferenceType *node) { QualType pointeeTypeAsWritten = ( node->getPointeeTypeAsWritten() ); W.find("pointeeTypeAsWritten").writeQualType(pointeeTypeAsWritten); } void writeSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *node) { QualType replacedParameter = ( QualType(node->getReplacedParameter(), 0) ); W.find("replacedParameter").writeQualType(replacedParameter); TemplateArgument replacementPack = ( node->getArgumentPack() ); W.find("replacementPack").writeTemplateArgument(replacementPack); } void writeSubstTemplateTypeParmType(const SubstTemplateTypeParmType *node) { QualType replacedParameter = ( QualType(node->getReplacedParameter(), 0) ); W.find("replacedParameter").writeQualType(replacedParameter); QualType replacementType = ( node->getReplacementType() ); W.find("replacementType").writeQualType(replacementType); } void writeEnumType(const EnumType *node) { bool dependent = ( node->isDependentType() ); W.find("dependent").writeBool(dependent); const Decl* declaration = ( node->getDecl()->getCanonicalDecl() ); W.find("declaration").writeDeclRef(declaration); } void writeRecordType(const RecordType *node) { bool dependent = ( node->isDependentType() ); W.find("dependent").writeBool(dependent); const Decl* declaration = ( node->getDecl()->getCanonicalDecl() ); W.find("declaration").writeDeclRef(declaration); } void writeTemplateSpecializationType(const TemplateSpecializationType *node) { bool dependent = ( node->isDependentType() ); W.find("dependent").writeBool(dependent); TemplateName templateName = ( node->getTemplateName() ); W.find("templateName").writeTemplateName(templateName); llvm::ArrayRef templateArguments = ( node->template_arguments() ); W.find("templateArguments").writeArray(templateArguments); llvm::Optional underlyingType = ( node->isTypeAlias() ? llvm::Optional(node->getAliasedType()) : node->isCanonicalUnqualified() ? llvm::None : llvm::Optional(node->getCanonicalTypeInternal()) ); W.find("underlyingType").writeOptional(underlyingType); } void writeTemplateTypeParmType(const TemplateTypeParmType *node) { uint32_t depth = ( node->getDepth() ); W.find("depth").writeUInt32(depth); uint32_t index = ( node->getIndex() ); W.find("index").writeUInt32(index); bool isParameterPack = ( node->isParameterPack() ); W.find("isParameterPack").writeBool(isParameterPack); llvm::Optional declaration = ( makeOptionalFromPointer( const_cast(node->getDecl())) ); W.find("declaration").writeOptional(declaration); } void writeTypeOfExprType(const TypeOfExprType *node) { const Expr* expression = ( node->getUnderlyingExpr() ); W.find("expression").writeExprRef(expression); } void writeTypeOfType(const TypeOfType *node) { QualType underlyingType = ( node->getUnderlyingType() ); W.find("underlyingType").writeQualType(underlyingType); } void writeTypedefType(const TypedefType *node) { const Decl* declaration = ( node->getDecl() ); W.find("declaration").writeDeclRef(declaration); llvm::Optional canonicalType = ( makeOptionalFromNullable(node->getCanonicalTypeInternal()) ); W.find("canonicalType").writeOptional(canonicalType); } void writeUnaryTransformType(const UnaryTransformType *node) { QualType baseType = ( node->getBaseType() ); W.find("baseType").writeQualType(baseType); QualType underlyingType = ( node->getUnderlyingType() ); W.find("underlyingType").writeQualType(underlyingType); UnaryTransformType::UTTKind transform = ( node->getUTTKind() ); W.find("transform").writeUnaryTypeTransformKind(transform); } void writeUnresolvedUsingType(const UnresolvedUsingType *node) { const Decl* declaration = ( node->getDecl() ); W.find("declaration").writeDeclRef(declaration); } void writeVectorType(const VectorType *node) { QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); uint32_t numElements = ( node->getNumElements() ); W.find("numElements").writeUInt32(numElements); VectorType::VectorKind vectorKind = ( node->getVectorKind() ); W.find("vectorKind").writeVectorKind(vectorKind); } void writeExtVectorType(const ExtVectorType *node) { QualType elementType = ( node->getElementType() ); W.find("elementType").writeQualType(elementType); uint32_t numElements = ( node->getNumElements() ); W.find("numElements").writeUInt32(numElements); } };