This class formalizes the common case of the "trailing allocation" idiom we use
frequently. I didn't spot any true bugs while making this change, but I did see
places where we were using the wrong pointer type or casting through void* for
no good reason. This will keep us honest.
I'll get to the other libraries soon.
TypeAlignments.h predates this whole mess; it was used for types with
stronger alignment in PointerLikeTypeTraits than the old default of
"2 by fiat and assumption". All remaining forward-declared types are
AST types, so fold them into TypeAlignments.h.
(The one exception is SILTypeList.h, but that's already gone on master.)
To avoid future ODR issues, explicitly include TypeAlignments.h into
every header that defines a type it forward-declares.
I wish we could use partial specialization to provide PointerLikeTypeTraits
for all derived classes of Decl, TypeBase, etc, but that's not something
you can do in C++ if you don't control the traits class.
Tweak the AST representation and type-checking of default arguments to preserve a full ConcreteDeclRef with substitutions to the owner of the default arguments. In SILGen, emit default argument generators with the same genericity as the original function.
Swift SVN r18760
The need to hide Self from AllArchetypes of a GenericParamList is (almost) defined away by @cc(witness_method); IRGen now knows how to do the right thing for witnesses regardless of their generic signature. Eliminating this special case from the AST allows us to clear up a bunch of ugly hacks that piled up elsewhere to try to accommodate that special case, and makes the prospect of moving IRGen's PolymorphicConvention to interface types more manageable.
We do need an unfortunate hack to suppress emitting associated archetypes of Self when considering an archetype as the polymorphic source for a witness, since we can't actually pass those through the witness CC without breaking ABI compatibility between generic signatures.
Swift SVN r13663
This matches what SIL expects for generic function applications. Add a 'getPrimarySubstitutions' convenience method to ConcreteDeclRef.
Swift SVN r11579
Replace DeclRefExpr's stored ValueDecl* with a ConcreteDeclRef,
allowing it to store the complete set of substitutions applied to
the declaration. Start storing those substitutions (without using them
yet).
Swift SVN r9535
The new ConcreteDeclRef class provides a possibly-speciaized reference
to a declaration, which allows DynamicMemberRefExpr to refer to both
generic and non-generic members. without having to split the AST node.
Swift SVN r7839