Skip to content

Commit d83705b

Browse files
authored
Merge pull request #22161 from gottesmm/pr-3e0ca67a6062567588ea7d5d8d94f564f4266ab3
2 parents d8b0845 + cc68e6a commit d83705b

File tree

10 files changed

+5
-93
lines changed

10 files changed

+5
-93
lines changed

CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,6 @@ option(SWIFT_STDLIB_ENABLE_SIL_OWNERSHIP
319319
"Build the standard libraries and overlays with sil ownership enabled."
320320
FALSE)
321321

322-
option(SWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS
323-
"Build the standard libraries, overlays, and runtime with normal arguments at +0"
324-
TRUE)
325-
326322
option(SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS
327323
"Enable runtime function counters and expose the API."
328324
FALSE)
@@ -811,20 +807,17 @@ message(STATUS "Building host Swift tools for ${SWIFT_HOST_VARIANT_SDK} ${SWIFT_
811807
message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
812808
message(STATUS " Assertions: ${LLVM_ENABLE_ASSERTIONS}")
813809
message(STATUS " LTO: ${SWIFT_TOOLS_ENABLE_LTO}")
814-
message(STATUS " +0 Normal Args: ${SWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS}")
815810
message(STATUS "")
816811

817812
if (SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
818813

819814
message(STATUS "Building Swift standard library and overlays for SDKs: ${SWIFT_SDKS}")
820815
message(STATUS " Build type: ${SWIFT_STDLIB_BUILD_TYPE}")
821816
message(STATUS " Assertions: ${SWIFT_STDLIB_ASSERTIONS}")
822-
message(STATUS " +0 Normal Args: ${SWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS}")
823817
message(STATUS "")
824818

825819
message(STATUS "Building Swift runtime with:")
826820
message(STATUS " Leak Detection Checker Entrypoints: ${SWIFT_RUNTIME_ENABLE_LEAK_CHECKER}")
827-
message(STATUS " +0 Normal Args: ${SWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS}")
828821
message(STATUS "")
829822

830823
else()

cmake/modules/AddSwift.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,6 @@ function(_add_variant_swift_compile_flags
369369
list(APPEND result "-D" "INTERNAL_CHECKS_ENABLED")
370370
endif()
371371

372-
if (NOT SWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS)
373-
list(APPEND result "-Xfrontend" "-disable-guaranteed-normal-arguments")
374-
endif()
375-
376372
if(SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS)
377373
list(APPEND result "-D" "SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS")
378374
endif()

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,6 @@ def pch_disable_validation : Flag<["-"], "pch-disable-validation">,
304304
def enable_sil_ownership : Flag<["-"], "enable-sil-ownership">,
305305
HelpText<"Enable the SIL Ownership Model">;
306306

307-
def disable_guaranteed_normal_arguments : Flag<["-"], "disable-guaranteed-normal-arguments">,
308-
HelpText<"If set to true, all normal parameters (except to inits/setters) will be passed at +1">;
309-
310307
def enable_mandatory_semantic_arc_opts : Flag<["-"], "enable-mandatory-semantic-arc-opts">,
311308
HelpText<"Enable the mandatory semantic arc optimizer">;
312309

lib/SIL/SILFunctionType.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,12 +1240,6 @@ getSILFunctionTypeForAbstractCFunction(SILModule &M,
12401240
AnyFunctionType::ExtInfo extInfo,
12411241
Optional<SILDeclRef> constant);
12421242

1243-
/// If EnableGuaranteedNormalArguments is set, return a default convention that
1244-
/// uses guaranteed.
1245-
static DefaultConventions getNormalArgumentConvention(SILModule &M) {
1246-
return DefaultConventions(NormalParameterConvention::Guaranteed);
1247-
}
1248-
12491243
static CanSILFunctionType getNativeSILFunctionType(
12501244
SILModule &M, AbstractionPattern origType,
12511245
CanAnyFunctionType substInterfaceType, AnyFunctionType::ExtInfo extInfo,
@@ -1294,11 +1288,12 @@ static CanSILFunctionType getNativeSILFunctionType(
12941288
case SILDeclRef::Kind::DefaultArgGenerator:
12951289
case SILDeclRef::Kind::StoredPropertyInitializer:
12961290
case SILDeclRef::Kind::IVarInitializer:
1297-
case SILDeclRef::Kind::IVarDestroyer:
1298-
return getSILFunctionType(M, origType, substInterfaceType, extInfo,
1299-
getNormalArgumentConvention(M), ForeignInfo(),
1300-
origConstant, constant, reqtSubs,
1291+
case SILDeclRef::Kind::IVarDestroyer: {
1292+
auto conv = DefaultConventions(NormalParameterConvention::Guaranteed);
1293+
return getSILFunctionType(M, origType, substInterfaceType, extInfo, conv,
1294+
ForeignInfo(), origConstant, constant, reqtSubs,
13011295
witnessMethodConformance);
1296+
}
13021297
case SILDeclRef::Kind::Deallocator:
13031298
return getSILFunctionType(M, origType, substInterfaceType, extInfo,
13041299
DeallocatorConventions(), ForeignInfo(),

test/Frontend/emit-plus-one-normal-arguments.swift

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

test/sil-opt/guaranteed-normal-args-negative.sil

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

test/sil-opt/guaranteed-normal-args-positive.sil

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

tools/sil-opt/SILOpt.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,6 @@ DisableASTDump("sil-disable-ast-dump", llvm::cl::Hidden,
208208
static llvm::cl::opt<bool>
209209
PerformWMO("wmo", llvm::cl::desc("Enable whole-module optimizations"));
210210

211-
static llvm::cl::opt<bool> DisableGuaranteedNormalArguments(
212-
"disable-guaranteed-normal-arguments", llvm::cl::Hidden,
213-
llvm::cl::init(false),
214-
llvm::cl::desc("Assume that the input module was compiled with "
215-
"-disable-guaranteed-normal-arguments enabled"));
216-
217211
static llvm::cl::opt<bool>
218212
EnableExperimentalStaticAssert(
219213
"enable-experimental-static-assert", llvm::cl::Hidden,

utils/swift_build_support/swift_build_support/products/swift.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ def __init__(self, args, toolchain, source_dir, build_dir):
3333
# Add any sil ownership flags.
3434
self.cmake_options.extend(self._sil_ownership_flags)
3535

36-
# Add any guaranteed normal arguments flags
37-
self.cmake_options.extend(self._guaranteed_normal_arguments_flags)
38-
3936
# Generate the compile db.
4037
self.cmake_options.extend(self._compile_db_flags)
4138

@@ -115,12 +112,6 @@ def _sil_ownership_flags(self):
115112
return ["-DSWIFT_STDLIB_ENABLE_SIL_OWNERSHIP=FALSE"]
116113
return ["-DSWIFT_STDLIB_ENABLE_SIL_OWNERSHIP=TRUE"]
117114

118-
@property
119-
def _guaranteed_normal_arguments_flags(self):
120-
if self.args.disable_guaranteed_normal_arguments:
121-
return ["-DSWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS=FALSE"]
122-
return ["-DSWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS=TRUE"]
123-
124115
@property
125116
def _compile_db_flags(self):
126117
return ['-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE']

utils/swift_build_support/tests/products/test_swift.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ def test_by_default_no_cmake_options(self):
8888
expected = [
8989
'-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE',
9090
'-DSWIFT_STDLIB_ENABLE_SIL_OWNERSHIP=FALSE',
91-
'-DSWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS=FALSE',
9291
'-DSWIFT_FORCE_OPTIMIZED_TYPECHECKER=FALSE',
9392
'-DSWIFT_STDLIB_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING=FALSE'
9493
]
@@ -105,7 +104,6 @@ def test_swift_runtime_tsan(self):
105104
'-DSWIFT_RUNTIME_USE_SANITIZERS=Thread',
106105
'-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE',
107106
'-DSWIFT_STDLIB_ENABLE_SIL_OWNERSHIP=FALSE',
108-
'-DSWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS=FALSE',
109107
'-DSWIFT_FORCE_OPTIMIZED_TYPECHECKER=FALSE',
110108
'-DSWIFT_STDLIB_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING=FALSE'
111109
]
@@ -295,18 +293,6 @@ def test_sil_ownership_flags(self):
295293
[x for x in swift.cmake_options
296294
if 'SWIFT_STDLIB_ENABLE_SIL_OWNERSHIP' in x])
297295

298-
def test_swift_guaranteed_normal_arguments_flags(self):
299-
self.args.disable_guaranteed_normal_arguments = False
300-
swift = Swift(
301-
args=self.args,
302-
toolchain=self.toolchain,
303-
source_dir='/path/to/src',
304-
build_dir='/path/to/build')
305-
self.assertEqual(
306-
['-DSWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS=TRUE'],
307-
[x for x in swift.cmake_options
308-
if 'SWIFT_ENABLE_GUARANTEED_NORMAL_ARGUMENTS' in x])
309-
310296
def test_force_optimized_typechecker_flags(self):
311297
self.args.force_optimized_typechecker = True
312298
swift = Swift(

0 commit comments

Comments
 (0)