@@ -26,11 +26,6 @@ struct SectionBounds: Sendable {
26
26
enum Kind : Equatable , Hashable , CaseIterable {
27
27
/// The test content metadata section.
28
28
case testContent
29
-
30
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
31
- /// The type metadata section.
32
- case typeMetadata
33
- #endif
34
29
}
35
30
36
31
/// All section bounds of the given kind found in the current process.
@@ -61,10 +56,6 @@ extension SectionBounds.Kind {
61
56
switch self {
62
57
case . testContent:
63
58
( " __DATA_CONST " , " __swift5_tests " )
64
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
65
- case . typeMetadata:
66
- ( " __TEXT " , " __swift5_types " )
67
- #endif
68
59
}
69
60
}
70
61
}
@@ -189,10 +180,6 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> [SectionBounds] {
189
180
let range = switch context. pointee. kind {
190
181
case . testContent:
191
182
sections. swift5_tests
192
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
193
- case . typeMetadata:
194
- sections. swift5_type_metadata
195
- #endif
196
183
}
197
184
let start = UnsafeRawPointer ( bitPattern: range. start)
198
185
let size = Int ( clamping: range. length)
@@ -284,10 +271,6 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> some Sequence<Section
284
271
let sectionName = switch kind {
285
272
case . testContent:
286
273
" .sw5test "
287
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
288
- case . typeMetadata:
289
- " .sw5tymd "
290
- #endif
291
274
}
292
275
return HMODULE . all. lazy. compactMap { _findSection ( named: sectionName, in: $0) }
293
276
}
@@ -335,25 +318,13 @@ private struct _SectionBound: Sendable, ~Copyable {
335
318
#if SWT_TARGET_OS_APPLE
336
319
@_silgen_name ( raw: " section$start$__DATA_CONST$__swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionBegin : _SectionBound
337
320
@_silgen_name ( raw: " section$end$__DATA_CONST$__swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionEnd: _SectionBound
338
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
339
- @_silgen_name ( raw: " section$start$__TEXT$__swift5_types " ) private nonisolated ( unsafe) var _typeMetadataSectionBegin : _SectionBound
340
- @_silgen_name ( raw: " section$end$__TEXT$__swift5_types " ) private nonisolated ( unsafe) var _typeMetadataSectionEnd: _SectionBound
341
- #endif
342
321
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android) || os(WASI)
343
322
@_silgen_name ( raw: " __start_swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionBegin : _SectionBound
344
323
@_silgen_name ( raw: " __stop_swift5_tests " ) private nonisolated ( unsafe) var _testContentSectionEnd: _SectionBound
345
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
346
- @_silgen_name ( raw: " __start_swift5_type_metadata " ) private nonisolated ( unsafe) var _typeMetadataSectionBegin : _SectionBound
347
- @_silgen_name ( raw: " __stop_swift5_type_metadata " ) private nonisolated ( unsafe) var _typeMetadataSectionEnd: _SectionBound
348
- #endif
349
324
#else
350
325
#warning("Platform-specific implementation missing: Runtime test discovery unavailable (static)")
351
326
private nonisolated ( unsafe) let _testContentSectionBegin = UnsafeMutableRawPointer . allocate ( byteCount: 1 , alignment: 16 )
352
327
private nonisolated ( unsafe) let _testContentSectionEnd = _testContentSectionBegin
353
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
354
- private nonisolated ( unsafe) let _typeMetadataSectionBegin = UnsafeMutableRawPointer . allocate ( byteCount: 1 , alignment: 16 )
355
- private nonisolated ( unsafe) let _typeMetadataSectionEnd = _typeMetadataSectionBegin
356
- #endif
357
328
#endif
358
329
359
330
/// The common implementation of ``SectionBounds/all(_:)`` for platforms that do
@@ -368,10 +339,6 @@ private func _sectionBounds(_ kind: SectionBounds.Kind) -> CollectionOfOne<Secti
368
339
let range = switch kind {
369
340
case . testContent:
370
341
_testContentSectionBegin ..< _testContentSectionEnd
371
- #if !SWT_NO_LEGACY_TEST_DISCOVERY
372
- case . typeMetadata:
373
- _typeMetadataSectionBegin ..< _typeMetadataSectionEnd
374
- #endif
375
342
}
376
343
let buffer = UnsafeRawBufferPointer ( start: range. lowerBound, count: range. count)
377
344
let sb = SectionBounds ( imageAddress: nil , buffer: buffer)
0 commit comments