Skip to content

Commit 9789b25

Browse files
committed
add typealias to known types
formatting underscore
1 parent 33ed207 commit 9789b25

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

include/swift/AST/ASTContext.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,6 @@ class ASTContext final {
530530

531531
// Retrieve the declaration of Swift._stdlib_isOSVersionAtLeast.
532532
FuncDecl *getIsOSVersionAtLeastDecl() const;
533-
534-
// Retrieve the declaration of Swift._MaxBuiltinFloatType.
535-
TypeAliasDecl *getMaxBuiltinFloatTypeDecl() const;
536533

537534
/// Look for the declaration with the given name within the
538535
/// Swift module.

include/swift/AST/KnownStdlibTypes.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ KNOWN_STDLIB_TYPE_DECL(Float, NominalTypeDecl, 0)
4545
KNOWN_STDLIB_TYPE_DECL(Double, NominalTypeDecl, 0)
4646
KNOWN_STDLIB_TYPE_DECL(Float80, NominalTypeDecl, 0)
4747

48+
KNOWN_STDLIB_TYPE_DECL(_MaxBuiltinFloatType, TypeAliasDecl, 0)
49+
4850
KNOWN_STDLIB_TYPE_DECL(String, NominalTypeDecl, 0)
4951
KNOWN_STDLIB_TYPE_DECL(Substring, NominalTypeDecl, 0)
5052
KNOWN_STDLIB_TYPE_DECL(Array, NominalTypeDecl, 1)

lib/AST/ASTContext.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ FOR_KNOWN_FOUNDATION_TYPES(CACHE_FOUNDATION_DECL)
206206
// -> Builtin.Int1
207207
FuncDecl *IsOSVersionAtLeastDecl = nullptr;
208208

209-
/// typealias Swift._MaxBuiltinFloatType
210-
TypeAliasDecl *MaxBuiltinFloatTypeDecl = nullptr;
211-
212209
/// The set of known protocols, lazily populated as needed.
213210
ProtocolDecl *KnownProtocols[NumKnownProtocols] = { };
214211

@@ -1180,25 +1177,6 @@ FuncDecl *ASTContext::getIsOSVersionAtLeastDecl() const {
11801177
return decl;
11811178
}
11821179

1183-
TypeAliasDecl *ASTContext::getMaxBuiltinFloatTypeDecl() const {
1184-
if (getImpl().MaxBuiltinFloatTypeDecl)
1185-
return getImpl().MaxBuiltinFloatTypeDecl;
1186-
1187-
// Go find '_MaxBuiltinFloatType' in the Swift module.
1188-
SmallVector<ValueDecl *, 1> results;
1189-
lookupInSwiftModule("_MaxBuiltinFloatType", results);
1190-
1191-
if (results.size() != 1)
1192-
return nullptr;
1193-
1194-
if (auto typeAlias = dyn_cast<TypeAliasDecl>(results.front())) {
1195-
getImpl().MaxBuiltinFloatTypeDecl = typeAlias;
1196-
return typeAlias;
1197-
}
1198-
1199-
return nullptr;
1200-
}
1201-
12021180
static bool isHigherPrecedenceThan(PrecedenceGroupDecl *a,
12031181
PrecedenceGroupDecl *b) {
12041182
assert(a != b && "exact match should already have been filtered");

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ namespace {
20012001
}
20022002

20032003
// Get the _MaxBuiltinFloatType decl, or look for it if it's not cached.
2004-
auto maxFloatTypeDecl = tc.Context.getMaxBuiltinFloatTypeDecl();
2004+
auto maxFloatTypeDecl = tc.Context.get_MaxBuiltinFloatTypeDecl();
20052005

20062006
if (!maxFloatTypeDecl ||
20072007
!maxFloatTypeDecl->hasInterfaceType() ||

0 commit comments

Comments
 (0)