mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This is yet another waypoint on the path towards the final generic-metadata design. The immediate goal is to make the pattern a private implementation detail and to give the runtime more visibility into the allocation and caching of generic types.
222 lines
6.0 KiB
C++
222 lines
6.0 KiB
C++
//===--- DemangleNodes.def - Demangling Tree Metaprogramming ----*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines macros useful for macro-metaprogramming with nodes in
|
|
// the demangling tree.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
/// NODE(ID)
|
|
/// The node's enumerator value is Node::Kind::ID.
|
|
|
|
/// CONTEXT_NODE(ID)
|
|
/// Nodes that can serve as contexts for other entities.
|
|
#ifndef CONTEXT_NODE
|
|
#define CONTEXT_NODE(ID) NODE(ID)
|
|
#endif
|
|
|
|
CONTEXT_NODE(Allocator)
|
|
CONTEXT_NODE(AnonymousContext)
|
|
NODE(ArgumentTuple)
|
|
NODE(AssociatedType)
|
|
NODE(AssociatedTypeRef)
|
|
NODE(AssociatedTypeMetadataAccessor)
|
|
NODE(AssociatedTypeWitnessTableAccessor)
|
|
NODE(AutoClosureType)
|
|
NODE(BoundGenericClass)
|
|
NODE(BoundGenericEnum)
|
|
NODE(BoundGenericStructure)
|
|
NODE(BoundGenericOtherNominalType)
|
|
NODE(BuiltinTypeName)
|
|
NODE(CFunctionPointer)
|
|
CONTEXT_NODE(Class)
|
|
NODE(ClassMetadataBaseOffset)
|
|
CONTEXT_NODE(Constructor)
|
|
NODE(CoroutineContinuationPrototype)
|
|
CONTEXT_NODE(Deallocator)
|
|
NODE(DeclContext)
|
|
CONTEXT_NODE(DefaultArgumentInitializer)
|
|
NODE(DependentAssociatedTypeRef)
|
|
NODE(DependentGenericConformanceRequirement)
|
|
NODE(DependentGenericParamCount)
|
|
NODE(DependentGenericParamType)
|
|
NODE(DependentGenericSameTypeRequirement)
|
|
NODE(DependentGenericLayoutRequirement)
|
|
NODE(DependentGenericSignature)
|
|
NODE(DependentGenericType)
|
|
NODE(DependentMemberType)
|
|
NODE(DependentPseudogenericSignature)
|
|
CONTEXT_NODE(Destructor)
|
|
CONTEXT_NODE(DidSet)
|
|
NODE(Directness)
|
|
NODE(DynamicAttribute)
|
|
NODE(DirectMethodReferenceAttribute)
|
|
NODE(DynamicSelf)
|
|
CONTEXT_NODE(Enum)
|
|
NODE(ErrorType)
|
|
NODE(EscapingAutoClosureType)
|
|
NODE(NoEscapeFunctionType)
|
|
NODE(ExistentialMetatype)
|
|
CONTEXT_NODE(ExplicitClosure)
|
|
CONTEXT_NODE(Extension)
|
|
NODE(FieldOffset)
|
|
NODE(FullTypeMetadata)
|
|
CONTEXT_NODE(Function)
|
|
NODE(FunctionSignatureSpecialization)
|
|
NODE(FunctionSignatureSpecializationParam)
|
|
NODE(FunctionSignatureSpecializationParamKind)
|
|
NODE(FunctionSignatureSpecializationParamPayload)
|
|
NODE(FunctionType)
|
|
NODE(GenericPartialSpecialization)
|
|
NODE(GenericPartialSpecializationNotReAbstracted)
|
|
NODE(GenericProtocolWitnessTable)
|
|
NODE(GenericProtocolWitnessTableInstantiationFunction)
|
|
NODE(GenericSpecialization)
|
|
NODE(GenericSpecializationNotReAbstracted)
|
|
NODE(GenericSpecializationParam)
|
|
NODE(GenericTypeMetadataPattern)
|
|
CONTEXT_NODE(Getter)
|
|
NODE(Global)
|
|
CONTEXT_NODE(GlobalGetter)
|
|
NODE(Identifier)
|
|
NODE(Index)
|
|
CONTEXT_NODE(IVarInitializer)
|
|
CONTEXT_NODE(IVarDestroyer)
|
|
NODE(ImplEscaping)
|
|
NODE(ImplConvention)
|
|
NODE(ImplFunctionAttribute)
|
|
NODE(ImplFunctionType)
|
|
CONTEXT_NODE(ImplicitClosure)
|
|
NODE(ImplParameter)
|
|
NODE(ImplResult)
|
|
NODE(ImplErrorResult)
|
|
NODE(InOut)
|
|
NODE(InfixOperator)
|
|
CONTEXT_NODE(Initializer)
|
|
NODE(KeyPathGetterThunkHelper)
|
|
NODE(KeyPathSetterThunkHelper)
|
|
NODE(KeyPathEqualsThunkHelper)
|
|
NODE(KeyPathHashThunkHelper)
|
|
NODE(LazyProtocolWitnessTableAccessor)
|
|
NODE(LazyProtocolWitnessTableCacheVariable)
|
|
NODE(LocalDeclName)
|
|
CONTEXT_NODE(MaterializeForSet)
|
|
NODE(MergedFunction)
|
|
NODE(Metatype)
|
|
NODE(MetatypeRepresentation)
|
|
NODE(Metaclass)
|
|
CONTEXT_NODE(Module)
|
|
CONTEXT_NODE(NativeOwningAddressor)
|
|
CONTEXT_NODE(NativeOwningMutableAddressor)
|
|
CONTEXT_NODE(NativePinningAddressor)
|
|
CONTEXT_NODE(NativePinningMutableAddressor)
|
|
NODE(NominalTypeDescriptor)
|
|
NODE(NonObjCAttribute)
|
|
NODE(Number)
|
|
NODE(ObjCAttribute)
|
|
NODE(ObjCBlock)
|
|
CONTEXT_NODE(OtherNominalType)
|
|
CONTEXT_NODE(OwningAddressor)
|
|
CONTEXT_NODE(OwningMutableAddressor)
|
|
NODE(PartialApplyForwarder)
|
|
NODE(PartialApplyObjCForwarder)
|
|
NODE(PostfixOperator)
|
|
NODE(PrefixOperator)
|
|
NODE(PrivateDeclName)
|
|
NODE(PropertyDescriptor)
|
|
CONTEXT_NODE(Protocol)
|
|
NODE(ProtocolConformance)
|
|
NODE(ProtocolDescriptor)
|
|
NODE(ProtocolConformanceDescriptor)
|
|
NODE(ProtocolList)
|
|
NODE(ProtocolListWithClass)
|
|
NODE(ProtocolListWithAnyObject)
|
|
NODE(ProtocolWitness)
|
|
NODE(ProtocolWitnessTable)
|
|
NODE(ProtocolWitnessTableAccessor)
|
|
NODE(QualifiedArchetype)
|
|
NODE(ReabstractionThunk)
|
|
NODE(ReabstractionThunkHelper)
|
|
NODE(RelatedEntityDeclName)
|
|
NODE(RetroactiveConformance)
|
|
NODE(ReturnType)
|
|
NODE(Shared)
|
|
NODE(SILBoxType)
|
|
NODE(SILBoxTypeWithLayout)
|
|
NODE(SILBoxLayout)
|
|
NODE(SILBoxMutableField)
|
|
NODE(SILBoxImmutableField)
|
|
CONTEXT_NODE(Setter)
|
|
NODE(SpecializationPassID)
|
|
NODE(SpecializationIsFragile)
|
|
CONTEXT_NODE(Static)
|
|
CONTEXT_NODE(Structure)
|
|
CONTEXT_NODE(Subscript)
|
|
CONTEXT_NODE(SymbolicReference)
|
|
NODE(Suffix)
|
|
NODE(ThinFunctionType)
|
|
NODE(Tuple)
|
|
NODE(TupleElement)
|
|
NODE(TupleElementName)
|
|
NODE(Type)
|
|
CONTEXT_NODE(TypeAlias)
|
|
NODE(TypeList)
|
|
NODE(TypeMangling)
|
|
NODE(TypeMetadata)
|
|
NODE(TypeMetadataAccessFunction)
|
|
NODE(TypeMetadataInstantiationCache)
|
|
NODE(TypeMetadataInstantiationFunction)
|
|
NODE(TypeMetadataLazyCache)
|
|
NODE(UncurriedFunctionType)
|
|
NODE(Unmanaged)
|
|
NODE(Unowned)
|
|
CONTEXT_NODE(UnresolvedSymbolicReference)
|
|
CONTEXT_NODE(UnsafeAddressor)
|
|
CONTEXT_NODE(UnsafeMutableAddressor)
|
|
NODE(ValueWitness)
|
|
NODE(ValueWitnessTable)
|
|
CONTEXT_NODE(Variable)
|
|
NODE(VTableThunk)
|
|
NODE(VTableAttribute) // note: old mangling only
|
|
NODE(Weak)
|
|
CONTEXT_NODE(WillSet)
|
|
NODE(ReflectionMetadataBuiltinDescriptor)
|
|
NODE(ReflectionMetadataFieldDescriptor)
|
|
NODE(ReflectionMetadataAssocTypeDescriptor)
|
|
NODE(ReflectionMetadataSuperclassDescriptor)
|
|
NODE(GenericTypeParamDecl)
|
|
CONTEXT_NODE(CurryThunk)
|
|
CONTEXT_NODE(DispatchThunk)
|
|
NODE(ThrowsAnnotation)
|
|
NODE(EmptyList)
|
|
NODE(FirstElementMarker)
|
|
NODE(VariadicMarker)
|
|
NODE(OutlinedBridgedMethod)
|
|
NODE(OutlinedCopy)
|
|
NODE(OutlinedConsume)
|
|
NODE(OutlinedRetain)
|
|
NODE(OutlinedRelease)
|
|
NODE(OutlinedInitializeWithTake)
|
|
NODE(OutlinedInitializeWithCopy)
|
|
NODE(OutlinedAssignWithTake)
|
|
NODE(OutlinedAssignWithCopy)
|
|
NODE(OutlinedDestroy)
|
|
NODE(OutlinedVariable)
|
|
NODE(AssocTypePath)
|
|
NODE(LabelList)
|
|
NODE(ModuleDescriptor)
|
|
NODE(ExtensionDescriptor)
|
|
NODE(AnonymousDescriptor)
|
|
NODE(AssociatedTypeGenericParamRef)
|
|
#undef CONTEXT_NODE
|
|
#undef NODE
|