diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index cacf039e53743..c153ceae7b140 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -2946,7 +2946,7 @@ class AnyFunctionType : public TypeBase { friend ExtInfo; friend class AnyFunctionType; friend class FunctionType; - friend class SILUncommonInfo; + friend class SILCallingConvUncommonInfo; // We preserve a full clang::Type *, not a clang::FunctionType * as: // 1. We need to keep sugar in case we need to present an error to the user. // 2. The actual type being stored is [ignoring sugar] either a @@ -3917,7 +3917,7 @@ namespace Lowering { class TypeConverter; }; -class SILUncommonInfo { +class SILCallingConvUncommonInfo { friend class SILFunctionType; // Invariant: The FunctionType is canonical. @@ -3926,8 +3926,9 @@ class SILUncommonInfo { const clang::Type *ClangFunctionType; bool empty() const { return !ClangFunctionType; } - SILUncommonInfo(const clang::Type *type) : ClangFunctionType(type) {} - SILUncommonInfo(AnyFunctionType::ExtInfo::Uncommon uncommon); + SILCallingConvUncommonInfo(const clang::Type *type) + : ClangFunctionType(type) {} + SILCallingConvUncommonInfo(AnyFunctionType::ExtInfo::Uncommon uncommon); public: /// Analog of AnyFunctionType::ExtInfo::Uncommon::printClangFunctionType. @@ -3944,7 +3945,7 @@ class SILUncommonInfo { class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode, private llvm::TrailingObjects { + SILCallingConvUncommonInfo> { friend TrailingObjects; size_t numTrailingObjects(OverloadToken) const { @@ -3963,7 +3964,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode, return hasResultCache() ? 2 : 0; } - size_t numTrailingObjects(OverloadToken) const { + size_t numTrailingObjects(OverloadToken) const { return Bits.SILFunctionType.HasUncommonInfo ? 1 : 0; } @@ -3992,7 +3993,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode, unsigned Bits; // Naturally sized for speed. // For symmetry with AnyFunctionType::Uncommon - using Uncommon = SILUncommonInfo; + using Uncommon = SILCallingConvUncommonInfo; Uncommon Other; diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index f7ad4fb5792da..75c7459d9ca6c 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3158,13 +3158,14 @@ ArrayRef GenericFunctionType::getRequirements() const { return Signature->getRequirements(); } -SILUncommonInfo::SILUncommonInfo(AnyFunctionType::ExtInfo::Uncommon uncommon) { +SILCallingConvUncommonInfo::SILCallingConvUncommonInfo( + AnyFunctionType::ExtInfo::Uncommon uncommon) { auto *ty = uncommon.ClangFunctionType; ClangFunctionType = ty ? ty->getCanonicalTypeInternal().getTypePtr() : nullptr; } -void SILUncommonInfo::printClangFunctionType( +void SILCallingConvUncommonInfo::printClangFunctionType( ClangModuleLoader *cml, llvm::raw_ostream &os) const { cml->printClangType(ClangFunctionType, os); }