Skip to content

Commit 0b4f48a

Browse files
committed
---
yaml --- r: 349069 b: refs/heads/master c: 797a797 h: refs/heads/master i: 349067: dda92c1
1 parent 3c77aeb commit 0b4f48a

File tree

7 files changed

+3
-37
lines changed

7 files changed

+3
-37
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 87dd47aeaadfd6eeff98f0de026e26b91d530776
2+
refs/heads/master: 797a7974bc1fb5da69c83ce47e491aab5ec59253
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/AST/Decl.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3365,10 +3365,6 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33653365
Bits.NominalTypeDecl.AddedImplicitInitializers = true;
33663366
}
33673367

3368-
/// Set the interface type of this nominal type to the metatype of the
3369-
/// declared interface type.
3370-
void computeType();
3371-
33723368
/// getDeclaredType - Retrieve the type declared by this entity, without
33733369
/// any generic parameters bound if this is a generic type.
33743370
Type getDeclaredType() const;

trunk/lib/AST/Decl.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3368,16 +3368,6 @@ bool NominalTypeDecl::isResilient(ModuleDecl *M,
33683368
llvm_unreachable("bad resilience expansion");
33693369
}
33703370

3371-
void NominalTypeDecl::computeType() {
3372-
assert(!hasInterfaceType());
3373-
3374-
Type declaredInterfaceTy = getDeclaredInterfaceType();
3375-
setInterfaceType(MetatypeType::get(declaredInterfaceTy, getASTContext()));
3376-
3377-
if (declaredInterfaceTy->hasError())
3378-
setInvalid();
3379-
}
3380-
33813371
enum class DeclTypeKind : unsigned {
33823372
DeclaredType,
33833373
DeclaredInterfaceType

trunk/lib/ClangImporter/ImportDecl.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,6 @@ namespace {
23642364
decl, AccessLevel::Public, loc,
23652365
importedName.getDeclName().getBaseIdentifier(),
23662366
Impl.importSourceLoc(decl->getLocation()), None, nullptr, dc);
2367-
enumDecl->computeType();
23682367
enumDecl->setMemberLoader(&Impl, 0);
23692368
return enumDecl;
23702369
}
@@ -2733,7 +2732,6 @@ namespace {
27332732
auto Loc = Impl.importSourceLoc(decl->getLocation());
27342733
auto structDecl = Impl.createDeclWithClangNode<StructDecl>(decl,
27352734
AccessLevel::Public, Loc, name, Loc, None, nullptr, dc);
2736-
structDecl->computeType();
27372735
structDecl->setAddedImplicitInitializers();
27382736

27392737
auto options = getDefaultMakeStructRawValuedOptions();
@@ -2783,7 +2781,6 @@ namespace {
27832781
C.getProtocol(KnownProtocolKind::ErrorCodeProtocol))) {
27842782
// Create the wrapper struct.
27852783
errorWrapper = new (C) StructDecl(loc, name, loc, None, nullptr, dc);
2786-
errorWrapper->computeType();
27872784
errorWrapper->setAddedImplicitInitializers();
27882785
errorWrapper->setAccess(AccessLevel::Public);
27892786
errorWrapper->getAttrs().add(
@@ -2853,7 +2850,6 @@ namespace {
28532850
decl, AccessLevel::Public, loc, enumName,
28542851
Impl.importSourceLoc(decl->getLocation()), None, nullptr, enumDC);
28552852
enumDecl->setHasFixedRawValues();
2856-
enumDecl->computeType();
28572853

28582854
// Annotate as 'frozen' if appropriate.
28592855
if (enumKind == EnumKind::FrozenEnum)
@@ -3214,7 +3210,6 @@ namespace {
32143210
name,
32153211
Impl.importSourceLoc(decl->getLocation()),
32163212
None, nullptr, dc);
3217-
result->computeType();
32183213
result->setAddedImplicitInitializers();
32193214
Impl.ImportedDecls[{decl->getCanonicalDecl(), getVersion()}] = result;
32203215

@@ -4660,7 +4655,6 @@ namespace {
46604655
Impl.importSourceLoc(decl->getBeginLoc()),
46614656
Impl.importSourceLoc(decl->getLocation()), name, None,
46624657
/*TrailingWhere=*/nullptr);
4663-
result->computeType();
46644658

46654659
addObjCAttribute(result, Impl.importIdentifier(decl->getIdentifier()));
46664660

@@ -4705,7 +4699,6 @@ namespace {
47054699
SourceLoc(), name,
47064700
SourceLoc(), None,
47074701
nullptr, dc);
4708-
result->computeType();
47094702
Impl.ImportedDecls[{decl->getCanonicalDecl(), getVersion()}] = result;
47104703
result->setCircularityCheck(CircularityCheck::Checked);
47114704
result->setSuperclass(Type());
@@ -4810,8 +4803,6 @@ namespace {
48104803
return nullptr;
48114804
}
48124805

4813-
result->computeType();
4814-
48154806
Impl.ImportedDecls[{decl->getCanonicalDecl(), getVersion()}] = result;
48164807
result->setCircularityCheck(CircularityCheck::Checked);
48174808
addObjCAttribute(result, Impl.importIdentifier(decl->getIdentifier()));
@@ -5291,7 +5282,6 @@ SwiftDeclConverter::importCFClassType(const clang::TypedefNameDecl *decl,
52915282
auto theClass = Impl.createDeclWithClangNode<ClassDecl>(
52925283
decl, AccessLevel::Public, SourceLoc(), className, SourceLoc(), None,
52935284
nullptr, dc);
5294-
theClass->computeType();
52955285
theClass->setCircularityCheck(CircularityCheck::Checked);
52965286
theClass->setSuperclass(superclass);
52975287
theClass->setAddedImplicitInitializers(); // suppress all initializers
@@ -5458,7 +5448,6 @@ SwiftDeclConverter::importSwiftNewtype(const clang::TypedefNameDecl *decl,
54585448

54595449
auto structDecl = Impl.createDeclWithClangNode<StructDecl>(
54605450
decl, AccessLevel::Public, Loc, name, Loc, None, nullptr, dc);
5461-
structDecl->computeType();
54625451
structDecl->setAddedImplicitInitializers();
54635452

54645453
// Import the type of the underlying storage
@@ -5738,7 +5727,6 @@ SwiftDeclConverter::importAsOptionSetType(DeclContext *dc, Identifier name,
57385727
// Create a struct with the underlying type as a field.
57395728
auto structDecl = Impl.createDeclWithClangNode<StructDecl>(
57405729
decl, AccessLevel::Public, Loc, name, Loc, None, nullptr, dc);
5741-
structDecl->computeType();
57425730
structDecl->setAddedImplicitInitializers();
57435731

57445732
makeStructRawValued(Impl, structDecl, underlyingType,

trunk/lib/IRGen/GenClass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,6 @@ ClassDecl *IRGenModule::getObjCRuntimeBaseClass(Identifier name,
22392239
MutableArrayRef<TypeLoc>(),
22402240
/*generics*/ nullptr,
22412241
Context.TheBuiltinModule);
2242-
SwiftRootClass->computeType();
22432242
SwiftRootClass->setIsObjC(Context.LangOpts.EnableObjCInterop);
22442243
SwiftRootClass->getAttrs().add(ObjCAttr::createNullary(Context, objcName,
22452244
/*isNameImplicit=*/true));

trunk/lib/Sema/TypeCheckDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4173,7 +4173,8 @@ void TypeChecker::validateDecl(ValueDecl *D) {
41734173
case DeclKind::Class:
41744174
case DeclKind::Protocol: {
41754175
auto nominal = cast<NominalTypeDecl>(D);
4176-
nominal->computeType();
4176+
Type declaredInterfaceTy = nominal->getDeclaredInterfaceType();
4177+
nominal->setInterfaceType(MetatypeType::get(declaredInterfaceTy, Context));
41774178

41784179
if (auto *ED = dyn_cast<EnumDecl>(nominal)) {
41794180
// @objc enums use their raw values as the value representation, so we

trunk/lib/Serialization/Deserialization.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,8 +2437,6 @@ class swift::DeclDeserializer {
24372437
theStruct->setImplicit();
24382438
theStruct->setIsObjC(isObjC);
24392439

2440-
theStruct->computeType();
2441-
24422440
handleInherited(theStruct,
24432441
rawInheritedAndDependencyIDs.slice(0, numInheritedTypes));
24442442

@@ -3220,8 +3218,6 @@ class swift::DeclDeserializer {
32203218
proto->setImplicit();
32213219
proto->setIsObjC(isObjC);
32223220

3223-
proto->computeType();
3224-
32253221
proto->setCircularityCheck(CircularityCheck::Checked);
32263222

32273223
proto->setLazyRequirementSignature(&MF,
@@ -3424,8 +3420,6 @@ class swift::DeclDeserializer {
34243420
if (inheritsSuperclassInitializers)
34253421
theClass->setInheritsSuperclassInitializers();
34263422

3427-
theClass->computeType();
3428-
34293423
handleInherited(theClass,
34303424
rawInheritedAndDependencyIDs.slice(0, numInheritedTypes));
34313425

@@ -3500,8 +3494,6 @@ class swift::DeclDeserializer {
35003494

35013495
theEnum->setRawType(MF.getType(rawTypeID));
35023496

3503-
theEnum->computeType();
3504-
35053497
auto rawInheritedIDs = rawInheritedAndDependencyIDs.slice(0, numInherited);
35063498
handleInherited(theEnum, rawInheritedIDs);
35073499

0 commit comments

Comments
 (0)