Remove ImplicitlyUnwrappedOptionalType.

We haven't been creating these since
https://github.com/apple/swift/pull/14299 but there was more
groundwork before we could actually remove the type definition.
This commit is contained in:
Mark Lacey
2018-02-02 17:47:11 -08:00
parent 7f805ba2bc
commit fdd86fe069
9 changed files with 4 additions and 83 deletions

View File

@@ -293,7 +293,6 @@ FOR_KNOWN_FOUNDATION_TYPES(CACHE_FOUNDATION_DECL)
llvm::DenseMap<Type, ArraySliceType*> ArraySliceTypes;
llvm::DenseMap<std::pair<Type, Type>, DictionaryType *> DictionaryTypes;
llvm::DenseMap<Type, OptionalType*> OptionalTypes;
llvm::DenseMap<Type, ImplicitlyUnwrappedOptionalType*> ImplicitlyUnwrappedOptionalTypes;
llvm::DenseMap<std::pair<Type, unsigned>, ParenType*> ParenTypes;
llvm::DenseMap<uintptr_t, ReferenceStorageType*> ReferenceStorageTypes;
llvm::DenseMap<Type, LValueType*> LValueTypes;
@@ -2120,7 +2119,6 @@ size_t ASTContext::Implementation::Arena::getTotalMemory() const {
llvm::capacity_in_bytes(ArraySliceTypes) +
llvm::capacity_in_bytes(DictionaryTypes) +
llvm::capacity_in_bytes(OptionalTypes) +
llvm::capacity_in_bytes(ImplicitlyUnwrappedOptionalTypes) +
llvm::capacity_in_bytes(ParenTypes) +
llvm::capacity_in_bytes(ReferenceStorageTypes) +
llvm::capacity_in_bytes(LValueTypes) +
@@ -4033,7 +4031,8 @@ Type OptionalType::get(OptionalTypeKind which, Type valueType) {
// OTK_None if we made code more convenient to write.
case OTK_None: llvm_unreachable("building a non-optional type!");
case OTK_Optional: return OptionalType::get(valueType);
case OTK_ImplicitlyUnwrappedOptional: return ImplicitlyUnwrappedOptionalType::get(valueType);
case OTK_ImplicitlyUnwrappedOptional:
llvm_unreachable("Should no longer have IUOs");
}
llvm_unreachable("bad optional type kind");
}
@@ -4050,18 +4049,6 @@ OptionalType *OptionalType::get(Type base) {
return entry = new (C, arena) OptionalType(C, base, properties);
}
ImplicitlyUnwrappedOptionalType *ImplicitlyUnwrappedOptionalType::get(Type base) {
auto properties = base->getRecursiveProperties();
auto arena = getArena(properties);
const ASTContext &C = base->getASTContext();
auto *&entry = C.Impl.getArena(arena).ImplicitlyUnwrappedOptionalTypes[base];
if (entry) return entry;
return entry = new (C, arena) ImplicitlyUnwrappedOptionalType(C, base, properties);
}
ProtocolType *ProtocolType::get(ProtocolDecl *D, Type Parent,
const ASTContext &C) {
llvm::FoldingSetNodeID id;