Give SILFunctionTypes parallel generic signature and interface types.

For now, derive the generic signature from the contextual generic parameter list, so we can incrementally move producers and consumers of SILFunctionTypes to the new model independently. We derive the generic signature, but we can't yet derive the interface parameter and result types in all cases due to bugs in how we lower nested generic SILFunctionTypes. NFC yet.

Swift SVN r11722
This commit is contained in:
Joe Groff
2013-12-29 19:03:43 +00:00
parent faab3ca3d8
commit f23a2130c7
6 changed files with 299 additions and 12 deletions

View File

@@ -52,6 +52,7 @@ namespace swift {
class FuncDecl;
class BraceStmt;
class DeclAttributes;
class GenericSignature;
class GenericTypeParamDecl;
class GenericTypeParamType;
class Module;
@@ -650,6 +651,11 @@ class GenericParamList {
MutableArrayRef<RequirementRepr> Requirements,
SourceLoc RAngleLoc);
void getAsGenericSignatureElements(ASTContext &C,
llvm::DenseMap<ArchetypeType*, Type> &archetypeMap,
SmallVectorImpl<GenericTypeParamType*> &genericParams,
SmallVectorImpl<Requirement> &requirements) const;
public:
/// create - Create a new generic parameter list within the given AST context.
///
@@ -806,6 +812,16 @@ public:
return depth;
}
/// Get the generic parameter list as a GenericSignature in which the generic
/// parameters have been canonicalized.
///
/// \param archetypeMap This DenseMap is populated with a mapping of
/// context primary archetypes to dependent generic
/// types.
GenericSignature *getAsCanonicalGenericSignature(
llvm::DenseMap<ArchetypeType*, Type> &archetypeMap,
ASTContext &C) const;
void print(raw_ostream &OS);
void dump();
};