mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Uncurry function types within the Swift type system.
Remove uncurry level as a property of SILType/SILFunctionTypeInfo. During SIL type lowering, map a (Type, UncurryLevel) pair to a Swift CanType with the uncurried arguments as a Swift tuple. For example, T -> (U, V) -> W at uncurry level 1 becomes ((U, V), T) -> W--in reverse order to match the low-level calling convention. Update SILGen and IRGen all over the place for this representation change. SILFunctionTypeInfo is still used in the SILType representation, but it's no longer load-bearing. Everything remaining in it can be derived from a Swift type. This is an ABI break. Be sure to rebuild clean! Swift SVN r5296
This commit is contained in:
@@ -120,12 +120,6 @@ void SILType::print(raw_ostream &OS) const {
|
||||
if (is<AnyFunctionType>()) {
|
||||
auto info = getFunctionTypeInfo();
|
||||
|
||||
if (info->getUncurryLevel()) {
|
||||
if (!Attributes.empty()) Attributes += ", ";
|
||||
Attributes += "sil_uncurry=";
|
||||
Attributes += llvm::utostr(info->getUncurryLevel());
|
||||
}
|
||||
|
||||
if (info->hasIndirectReturn()) {
|
||||
if (!Attributes.empty()) Attributes += ", ";
|
||||
Attributes += "sil_sret";
|
||||
@@ -677,15 +671,6 @@ void SILFunction::dump() const {
|
||||
|
||||
/// Pretty-print the SILFunction to the designated stream.
|
||||
void SILFunction::print(llvm::raw_ostream &OS) const {
|
||||
// FIXME: Temporary testing comment until we actually use uncurried function
|
||||
// types during SILGen.
|
||||
OS << "// uncurried type: ";
|
||||
getModule().Types.uncurryFunctionType(
|
||||
cast<AnyFunctionType>(getLoweredType().getSwiftRValueType()),
|
||||
getLoweredType().getUncurryLevel())
|
||||
->print(OS);
|
||||
OS << '\n';
|
||||
|
||||
OS << "sil ";
|
||||
switch (getLinkage()) {
|
||||
case SILLinkage::Internal:
|
||||
|
||||
Reference in New Issue
Block a user