Skip to content

Commit 41f680c

Browse files
authored
Merge pull request #84826 from tbkka/tbkka-revert-revert-floatingpointdescription
Re-land new Floating-poing `debugDescription`
2 parents 46623cb + 1d23852 commit 41f680c

22 files changed

+3106
-3247
lines changed

Runtimes/Core/core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ add_library(swiftCore
8080
FlatMap.swift
8181
Flatten.swift
8282
FloatingPoint.swift
83+
FloatingPointToString.swift
8384
Hashable.swift
8485
AnyHashable.swift # ORDER DEPENDENCY
8586
Hasher.swift
@@ -88,6 +89,7 @@ add_library(swiftCore
8889
Identifiable.swift
8990
Indices.swift
9091
InlineArray.swift
92+
_InlineArray.swift
9193
InputStream.swift
9294
IntegerParsing.swift
9395
Integers.swift

Runtimes/Core/runtime/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ add_library(swiftRuntime OBJECT
5252
RefCount.cpp
5353
ReflectionMirror.cpp
5454
RuntimeInvocationsTracking.cpp
55-
SwiftDtoa.cpp
5655
SwiftTLSContext.cpp
5756
ThreadingError.cpp
5857
Tracing.cpp

include/swift/AST/KnownStdlibTypes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ KNOWN_STDLIB_TYPE_DECL(DecodingError, NominalTypeDecl, 0)
101101
KNOWN_STDLIB_TYPE_DECL(Result, NominalTypeDecl, 2)
102102

103103
KNOWN_STDLIB_TYPE_DECL(InlineArray, NominalTypeDecl, 2)
104+
KNOWN_STDLIB_TYPE_DECL(_InlineArray, NominalTypeDecl, 2)
104105

105106
KNOWN_STDLIB_TYPE_DECL(MutableSpan, NominalTypeDecl, 1)
106107

include/swift/Runtime/SwiftDtoa.h

Lines changed: 0 additions & 302 deletions
This file was deleted.

lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ Type TypeBase::getArrayElementType() {
853853
}
854854

855855
Type TypeBase::getInlineArrayElementType() {
856-
if (!isInlineArray())
856+
if (!isInlineArray() && !is_InlineArray())
857857
return Type();
858858

859859
if (!is<BoundGenericStructType>())

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
13681368
// these can be reconstructed by substituting the "template parameters" in
13691369
// the unspecialized type. We make an exception for inline arrays, because
13701370
// DWARF has special support for arrays.
1371-
if (Type->isInlineArray() && !Type->hasTypeParameter() &&
1371+
if ((Type->isInlineArray() || Type->is_InlineArray()) &&
1372+
!Type->hasTypeParameter() &&
13721373
!Type->hasPrimaryArchetype())
13731374
// Create the substituted type.
13741375
return createStructType(Type, Decl, Scope, File, Line, SizeInBits,

lib/SILGen/SILGenExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5223,7 +5223,7 @@ static RValue emitInlineArrayLiteral(SILGenFunction &SGF, CollectionExpr *E,
52235223

52245224
RValue RValueEmitter::visitCollectionExpr(CollectionExpr *E, SGFContext C) {
52255225
// Handle 'InlineArray' literals separately.
5226-
if (E->getType()->isInlineArray()) {
5226+
if (E->getType()->isInlineArray() || E->getType()->is_InlineArray()) {
52275227
return emitInlineArrayLiteral(SGF, E, C);
52285228
}
52295229

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3976,7 +3976,7 @@ namespace {
39763976
Type arrayTy = cs.getType(expr);
39773977
Type elementType;
39783978

3979-
if (arrayTy->isInlineArray()) {
3979+
if (arrayTy->isInlineArray() || arrayTy->is_InlineArray()) {
39803980
// <let count: Int, Element>
39813981
elementType = arrayTy->castTo<BoundGenericStructType>()->getGenericArgs()[1];
39823982
} else {

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2208,7 +2208,7 @@ namespace {
22082208
if (contextualType->isArray())
22092209
eltType = contextualType->getArrayElementType();
22102210

2211-
if (contextualType->isInlineArray())
2211+
if (contextualType->isInlineArray() || contextualType->is_InlineArray())
22122212
eltType = contextualType->getInlineArrayElementType();
22132213

22142214
CS.addConstraint(ConstraintKind::LiteralConformsTo, contextualType,

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9057,7 +9057,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
90579057
// parameter, then check if the counts are equal and solve.
90589058
if (kind == ConstraintKind::LiteralConformsTo &&
90599059
protocol == arrayLiteralProto &&
9060-
type->isInlineArray() &&
9060+
(type->isInlineArray() || type->is_InlineArray()) &&
90619061
arrayLiteral) {
90629062
auto iaTy = type->castTo<BoundGenericStructType>();
90639063

0 commit comments

Comments
 (0)