Skip to content

Commit 15b2322

Browse files
authored
Revert "[SE-0368] StaticBigInt (#40722)"
This reverts commit 0b29450.
1 parent 0b29450 commit 15b2322

File tree

13 files changed

+10
-573
lines changed

13 files changed

+10
-573
lines changed

include/swift/AST/Builtins.def

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -701,18 +701,6 @@ BUILTIN_MISC_OPERATION(UToUCheckedTrunc, "u_to_u_checked_trunc", "n", Special)
701701
/// IntToFPWithOverflow has type (Integer) -> Float
702702
BUILTIN_MISC_OPERATION(IntToFPWithOverflow, "itofp_with_overflow", "n", Special)
703703

704-
/// Builtin.bitWidth_IntLiteral has type
705-
/// (_ value: Builtin.IntLiteral) -> Builtin.Word
706-
BUILTIN_MISC_OPERATION(BitWidth, "bitWidth", "n", Special)
707-
708-
/// Builtin.isNegative_IntLiteral has type
709-
/// (_ value: Builtin.IntLiteral) -> Builtin.Int1
710-
BUILTIN_MISC_OPERATION(IsNegative, "isNegative", "n", Special)
711-
712-
/// Builtin.wordAtIndex_IntLiteral has type
713-
/// (_ value: Builtin.IntLiteral, _ index: Builtin.Word) -> Builtin.Word
714-
BUILTIN_MISC_OPERATION(WordAtIndex, "wordAtIndex", "n", Special)
715-
716704
/// zeroInitializer has type <T> () -> T
717705
BUILTIN_MISC_OPERATION(ZeroInitializer, "zeroInitializer", "n", Special)
718706

lib/AST/Builtins.cpp

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -1796,33 +1796,6 @@ static ValueDecl *getIntToFPWithOverflowOperation(ASTContext &Context,
17961796
return getBuiltinFunction(Id, { InTy }, OutTy);
17971797
}
17981798

1799-
static ValueDecl *getBitWidthOperation(
1800-
ASTContext &ctx,
1801-
Identifier id,
1802-
Type valueTy
1803-
) {
1804-
if (!valueTy->getAs<BuiltinIntegerLiteralType>()) return nullptr;
1805-
return getBuiltinFunction(ctx, id, _thin, _parameters(valueTy), _word);
1806-
}
1807-
1808-
static ValueDecl *getIsNegativeOperation(
1809-
ASTContext &ctx,
1810-
Identifier id,
1811-
Type valueTy
1812-
) {
1813-
if (!valueTy->getAs<BuiltinIntegerLiteralType>()) return nullptr;
1814-
return getBuiltinFunction(ctx, id, _thin, _parameters(valueTy), _int(1));
1815-
}
1816-
1817-
static ValueDecl *getWordAtIndexOperation(
1818-
ASTContext &ctx,
1819-
Identifier id,
1820-
Type valueTy
1821-
) {
1822-
if (!valueTy->getAs<BuiltinIntegerLiteralType>()) return nullptr;
1823-
return getBuiltinFunction(ctx, id, _thin, _parameters(valueTy, _word), _word);
1824-
}
1825-
18261799
static ValueDecl *getUnreachableOperation(ASTContext &Context,
18271800
Identifier Id) {
18281801
auto NeverTy = Context.getNeverType();
@@ -2808,18 +2781,6 @@ ValueDecl *swift::getBuiltinValueDecl(ASTContext &Context, Identifier Id) {
28082781
if (Types.size() != 2) return nullptr;
28092782
return getIntToFPWithOverflowOperation(Context, Id, Types[0], Types[1]);
28102783

2811-
case BuiltinValueKind::BitWidth:
2812-
if (Types.size() != 1) return nullptr;
2813-
return getBitWidthOperation(Context, Id, Types[0]);
2814-
2815-
case BuiltinValueKind::IsNegative:
2816-
if (Types.size() != 1) return nullptr;
2817-
return getIsNegativeOperation(Context, Id, Types[0]);
2818-
2819-
case BuiltinValueKind::WordAtIndex:
2820-
if (Types.size() != 1) return nullptr;
2821-
return getWordAtIndexOperation(Context, Id, Types[0]);
2822-
28232784
case BuiltinValueKind::GetObjCTypeEncoding:
28242785
return getGetObjCTypeEncodingOperation(Context, Id);
28252786

lib/IRGen/GenBuiltin.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -961,24 +961,6 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
961961
return;
962962
}
963963

964-
if (Builtin.ID == BuiltinValueKind::BitWidth) {
965-
assert(Builtin.Types[0]->is<BuiltinIntegerLiteralType>());
966-
out.add(emitIntLiteralBitWidth(IGF, args));
967-
return;
968-
}
969-
970-
if (Builtin.ID == BuiltinValueKind::IsNegative) {
971-
assert(Builtin.Types[0]->is<BuiltinIntegerLiteralType>());
972-
out.add(emitIntLiteralIsNegative(IGF, args));
973-
return;
974-
}
975-
976-
if (Builtin.ID == BuiltinValueKind::WordAtIndex) {
977-
assert(Builtin.Types[0]->is<BuiltinIntegerLiteralType>());
978-
out.add(emitIntLiteralWordAtIndex(IGF, args));
979-
return;
980-
}
981-
982964
if (Builtin.ID == BuiltinValueKind::Once
983965
|| Builtin.ID == BuiltinValueKind::OnceWithContext) {
984966
// The input type is statically (Builtin.RawPointer, @convention(thin) () -> ()).

lib/IRGen/GenIntegerLiteral.cpp

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -401,45 +401,3 @@ llvm::Value *irgen::emitIntegerLiteralToFP(IRGenFunction &IGF,
401401
llvm_unreachable("not a floating-point type");
402402
}
403403
}
404-
405-
llvm::Value *irgen::emitIntLiteralBitWidth(
406-
IRGenFunction &IGF,
407-
Explosion &in
408-
) {
409-
auto data = in.claimNext();
410-
auto flags = in.claimNext();
411-
(void)data; // [[maybe_unused]]
412-
return IGF.Builder.CreateLShr(
413-
flags,
414-
IGF.IGM.getSize(Size(IntegerLiteralFlags::BitWidthShift))
415-
);
416-
}
417-
418-
llvm::Value *irgen::emitIntLiteralIsNegative(
419-
IRGenFunction &IGF,
420-
Explosion &in
421-
) {
422-
auto data = in.claimNext();
423-
auto flags = in.claimNext();
424-
(void)data; // [[maybe_unused]]
425-
static_assert(
426-
IntegerLiteralFlags::IsNegativeFlag == 1,
427-
"hardcoded in this truncation"
428-
);
429-
return IGF.Builder.CreateTrunc(flags, IGF.IGM.Int1Ty);
430-
}
431-
432-
llvm::Value *irgen::emitIntLiteralWordAtIndex(
433-
IRGenFunction &IGF,
434-
Explosion &in
435-
) {
436-
auto data = in.claimNext();
437-
auto flags = in.claimNext();
438-
auto index = in.claimNext();
439-
(void)flags; // [[maybe_unused]]
440-
return IGF.Builder.CreateLoad(
441-
IGF.Builder.CreateInBoundsGEP(IGF.IGM.SizeTy, data, index),
442-
IGF.IGM.SizeTy,
443-
IGF.IGM.getPointerAlignment()
444-
);
445-
}

lib/IRGen/GenIntegerLiteral.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -66,10 +66,6 @@ llvm::Value *emitIntegerLiteralToFP(IRGenFunction &IGF,
6666
Explosion &in,
6767
llvm::Type *toType);
6868

69-
llvm::Value *emitIntLiteralBitWidth(IRGenFunction &IGF, Explosion &in);
70-
llvm::Value *emitIntLiteralIsNegative(IRGenFunction &IGF, Explosion &in);
71-
llvm::Value *emitIntLiteralWordAtIndex(IRGenFunction &IGF, Explosion &in);
72-
7369
}
7470
}
7571

lib/SIL/IR/OperandOwnership.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -742,9 +742,6 @@ BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, ICMP_ULE)
742742
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, ICMP_ULT)
743743
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, InsertElement)
744744
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, IntToFPWithOverflow)
745-
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, BitWidth)
746-
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, IsNegative)
747-
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, WordAtIndex)
748745
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, IntToPtr)
749746
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, IsOptionalType)
750747
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, IsPOD)

lib/SIL/IR/ValueOwnership.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -495,9 +495,6 @@ CONSTANT_OWNERSHIP_BUILTIN(None, SToSCheckedTrunc)
495495
CONSTANT_OWNERSHIP_BUILTIN(None, SToUCheckedTrunc)
496496
CONSTANT_OWNERSHIP_BUILTIN(None, UToUCheckedTrunc)
497497
CONSTANT_OWNERSHIP_BUILTIN(None, IntToFPWithOverflow)
498-
CONSTANT_OWNERSHIP_BUILTIN(None, BitWidth)
499-
CONSTANT_OWNERSHIP_BUILTIN(None, IsNegative)
500-
CONSTANT_OWNERSHIP_BUILTIN(None, WordAtIndex)
501498

502499
// This is surprising, Builtin.unreachable returns a "Never" value which is
503500
// trivially typed.

lib/SILOptimizer/Transforms/AccessEnforcementReleaseSinking.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -129,9 +129,6 @@ static bool isBarrier(SILInstruction *inst) {
129129
case BuiltinValueKind::SToSCheckedTrunc:
130130
case BuiltinValueKind::UToUCheckedTrunc:
131131
case BuiltinValueKind::IntToFPWithOverflow:
132-
case BuiltinValueKind::BitWidth:
133-
case BuiltinValueKind::IsNegative:
134-
case BuiltinValueKind::WordAtIndex:
135132
case BuiltinValueKind::ZeroInitializer:
136133
case BuiltinValueKind::Once:
137134
case BuiltinValueKind::OnceWithContext:

stdlib/public/core/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# This source file is part of the Swift.org open source project
44
#
5-
# Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
5+
# Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
66
# Licensed under Apache License v2.0 with Runtime Library Exception
77
#
88
# See https://swift.org/LICENSE.txt for license information
@@ -226,7 +226,6 @@ set(SWIFTLIB_SOURCES
226226
PlaygroundDisplay.swift
227227
CommandLine.swift
228228
SliceBuffer.swift
229-
StaticBigInt.swift
230229
UnfoldSequence.swift
231230
UnsafeBufferPointerSlice.swift
232231
VarArgs.swift

stdlib/public/core/GroupInfo.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@
167167
"Integers": [
168168
"Integers.swift",
169169
"IntegerTypes.swift",
170-
"IntegerParsing.swift",
171-
"StaticBigInt.swift"],
170+
"IntegerParsing.swift"],
172171
"Floating": [
173172
"FloatingPoint.swift",
174173
"FloatingPointParsing.swift",

0 commit comments

Comments
 (0)