mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Language features like erasing concrete metatype values are also left for the future. Still, baby steps. The singleton ordinary metatype for existential types is still potentially useful; we allow it to be written as P.Protocol. I've been somewhat cavalier in making code accept AnyMetatypeType instead of a more specific type, and it's likely that a number of these places can and should be more restrictive. When T is an existential type, parse T.Type as an ExistentialMetatypeType instead of a MetatypeType. An existential metatype is the formal type \exists t:P . (t.Type) whereas the ordinary metatype is the formal type (\exists t:P . t).Type which is singleton. Our inability to express that difference was leading to an ever-increasing cascade of hacks where information is shadily passed behind the scenes in order to make various operations with static members of protocols work correctly. This patch takes the first step towards fixing that by splitting out existential metatypes and giving them a pointer representation. Eventually, we will need them to be able to carry protocol witness tables Swift SVN r15716
127 lines
3.0 KiB
C++
127 lines
3.0 KiB
C++
//===-- DemangleNodes.def - Demangling Tree Metaprogramming -----*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See http://swift.org/LICENSE.txt for license information
|
|
// See http://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.
|
|
|
|
NODE(Failure)
|
|
NODE(Addressor)
|
|
NODE(Allocator)
|
|
NODE(ArchetypeAndProtocol)
|
|
NODE(ArchetypeRef)
|
|
NODE(ArgumentTuple)
|
|
NODE(ArrayType)
|
|
NODE(AssociatedTypeRef)
|
|
NODE(AutoClosureType)
|
|
NODE(BoundGenericClass)
|
|
NODE(BoundGenericEnum)
|
|
NODE(BoundGenericStructure)
|
|
NODE(BridgeToBlockFunction)
|
|
NODE(BuiltinTypeName)
|
|
NODE(Class)
|
|
NODE(Constructor)
|
|
NODE(Deallocator)
|
|
NODE(DeclContext)
|
|
NODE(DefaultArgumentInitializer)
|
|
NODE(DependentGenericSignature)
|
|
NODE(DependentGenericParamCount)
|
|
NODE(DependentGenericConformanceRequirement)
|
|
NODE(DependentGenericSameTypeRequirement)
|
|
NODE(DependentGenericType)
|
|
NODE(DependentMemberType)
|
|
NODE(DependentGenericParamType)
|
|
NODE(DependentProtocolWitnessTableGenerator)
|
|
NODE(DependentProtocolWitnessTableTemplate)
|
|
NODE(Destructor)
|
|
NODE(DidSet)
|
|
NODE(Directness)
|
|
NODE(DynamicSelf)
|
|
NODE(Enum)
|
|
NODE(ErrorType)
|
|
NODE(ExistentialMetatype)
|
|
NODE(ExplicitClosure)
|
|
NODE(FieldOffset)
|
|
NODE(Function)
|
|
NODE(FunctionType)
|
|
NODE(Generics)
|
|
NODE(GenericType)
|
|
NODE(GenericTypeMetadataPattern)
|
|
NODE(Getter)
|
|
NODE(Global)
|
|
NODE(Identifier)
|
|
NODE(IVarInitializer)
|
|
NODE(IVarDestroyer)
|
|
NODE(ImplConvention)
|
|
NODE(ImplFunctionAttribute)
|
|
NODE(ImplFunctionType)
|
|
NODE(ImplicitClosure)
|
|
NODE(ImplParameter)
|
|
NODE(ImplResult)
|
|
NODE(InOut)
|
|
NODE(InfixOperator)
|
|
NODE(Initializer)
|
|
NODE(LazyProtocolWitnessTableAccessor)
|
|
NODE(LazyProtocolWitnessTableTemplate)
|
|
NODE(LocalDeclName)
|
|
NODE(Metatype)
|
|
NODE(Metaclass)
|
|
NODE(Module)
|
|
NODE(NominalTypeDescriptor)
|
|
NODE(NonVariadicTuple)
|
|
NODE(Number)
|
|
NODE(ObjCAttribute)
|
|
NODE(ObjCBlock)
|
|
NODE(PartialApplyForwarder)
|
|
NODE(PartialApplyObjCForwarder)
|
|
NODE(PostfixOperator)
|
|
NODE(PrefixOperator)
|
|
NODE(Protocol)
|
|
NODE(ProtocolConformance)
|
|
NODE(ProtocolList)
|
|
NODE(ProtocolWitness)
|
|
NODE(ProtocolWitnessTable)
|
|
NODE(QualifiedArchetype)
|
|
NODE(ReabstractionThunk)
|
|
NODE(ReabstractionThunkHelper)
|
|
NODE(ReturnType)
|
|
NODE(SelfTypeRef)
|
|
NODE(Setter)
|
|
NODE(SpecializedAttribute)
|
|
NODE(SpecializationParam)
|
|
NODE(Structure)
|
|
NODE(Subscript)
|
|
NODE(Suffix)
|
|
NODE(TupleElement)
|
|
NODE(TupleElementName)
|
|
NODE(TupleElementType)
|
|
NODE(Type)
|
|
NODE(TypeAlias)
|
|
NODE(TypeList)
|
|
NODE(TypeMetadata)
|
|
NODE(UncurriedFunctionType)
|
|
NODE(Unknown)
|
|
NODE(Unowned)
|
|
NODE(ValueWitness)
|
|
NODE(ValueWitnessTable)
|
|
NODE(Variable)
|
|
NODE(VariadicTuple)
|
|
NODE(Weak)
|
|
NODE(WillSet)
|
|
NODE(WitnessTableOffset)
|
|
|
|
#undef NODE
|