Skip to content

Commit b2bbf00

Browse files
authored
Remove unused infrastructure added for runtime attributes (swiftlang#62971)
1 parent c547f57 commit b2bbf00

File tree

8 files changed

+2
-83
lines changed

8 files changed

+2
-83
lines changed

stdlib/public/SwiftShims/swift/shims/MetadataSections.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ typedef struct MetadataSectionRange {
4545
///
4646
/// \warning If you change the size of this structure by adding fields, it is an
4747
/// ABI-breaking change on platforms that use it. Make sure to increment
48-
/// \c CurrentSectionMetadataVersion if you do.
48+
/// \c CurrentSectionMetadataVersion if you do. To minimize impact, always add
49+
/// new fields to the \em end of the structure.
4950
struct MetadataSections {
5051
__swift_uintptr_t version;
5152

stdlib/public/runtime/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ set(swift_runtime_sources
7070
SwiftTLSContext.cpp
7171
ThreadingError.cpp
7272
AccessibleFunction.cpp
73-
RuntimeAttribute.cpp
7473
Win32.cpp)
7574

7675
# Acknowledge that the following sources are known.

stdlib/public/runtime/ImageInspection.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ void initializeDynamicReplacementLookup();
5555
/// Load the metadata from the image necessary to find functions by name.
5656
void initializeAccessibleFunctionsLookup();
5757

58-
/// Load the metadata from the image necessary to find runtime metadata.
59-
void initializeRuntimeAttributesLookup();
60-
6158
// Callbacks to register metadata from an image to the runtime.
6259
void addImageProtocolsBlockCallback(const void *baseAddress,
6360
const void *start, uintptr_t size);
@@ -85,12 +82,6 @@ void addImageAccessibleFunctionsBlockCallback(const void *baseAddress,
8582
void addImageAccessibleFunctionsBlockCallbackUnsafe(const void *baseAddress,
8683
const void *start,
8784
uintptr_t size);
88-
void addImageRuntimeAttributesBlockCallback(const void *baseAddress,
89-
const void *start,
90-
uintptr_t size);
91-
void addImageRuntimeAttributesBlockCallbackUnsafe(const void *baseAddress,
92-
const void *start,
93-
uintptr_t size);
9485

9586
} // end namespace swift
9687

stdlib/public/runtime/ImageInspectionCommon.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ void swift_addNewDSOImage(swift::MetadataSections *sections) {
129129
swift::addImageAccessibleFunctionsBlockCallback(
130130
baseAddress, functions, accessible_funcs_section.length);
131131

132-
if (sections->version >= 3) {
133-
const auto &runtime_attribs_section = sections->swift5_runtime_attributes;
134-
const void *functions =
135-
reinterpret_cast<void *>(runtime_attribs_section.start);
136-
if (runtime_attribs_section.length)
137-
swift::addImageRuntimeAttributesBlockCallback(
138-
baseAddress, functions, runtime_attribs_section.length);
139-
}
140-
141132
// Register this section for future enumeration by clients. This should occur
142133
// after this function has done all other relevant work to avoid a race
143134
// condition when someone calls swift_enumerateAllMetadataSections() on
@@ -177,9 +168,6 @@ void swift::initializeDynamicReplacementLookup() {
177168
void swift::initializeAccessibleFunctionsLookup() {
178169
}
179170

180-
void swift::initializeRuntimeAttributesLookup() {
181-
}
182-
183171
#ifndef NDEBUG
184172

185173
SWIFT_RUNTIME_EXPORT

stdlib/public/runtime/ImageInspectionCommon.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
/// The Mach-O section name for the section containing accessible functions.
3838
/// This lives within SEG_TEXT.
3939
#define MachOAccessibleFunctionsSection "__swift5_acfuncs"
40-
/// The Mach-O section name for the section containing runtime attributes.
41-
/// This lives within SEG_TEXT.
42-
#define MachORuntimeAttributesSection "__swift5_rattrs"
4340

4441
#define MachOTextSegment "__TEXT"
4542

stdlib/public/runtime/ImageInspectionMachO.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ constexpr const char DynamicReplacementSomeSection[] =
4545
MachODynamicReplacementSomeSection;
4646
constexpr const char AccessibleFunctionsSection[] =
4747
MachOAccessibleFunctionsSection;
48-
constexpr const char RuntimeAttributesSection[] =
49-
MachORuntimeAttributesSection;
5048
constexpr const char TextSegment[] = MachOTextSegment;
5149

5250
#if __POINTER_WIDTH__ == 64
@@ -173,11 +171,5 @@ void swift::initializeAccessibleFunctionsLookup() {
173171
addImageAccessibleFunctionsBlockCallbackUnsafe>);
174172
}
175173

176-
void swift::initializeRuntimeAttributesLookup() {
177-
REGISTER_FUNC(
178-
addImageCallback<TextSegment, RuntimeAttributesSection,
179-
addImageRuntimeAttributesBlockCallbackUnsafe>);
180-
}
181-
182174
#endif // defined(__APPLE__) && defined(__MACH__) &&
183175
// !defined(SWIFT_RUNTIME_STATIC_IMAGE_INSPECTION)

stdlib/public/runtime/ImageInspectionStatic.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,5 @@ void swift::initializeAccessibleFunctionsLookup() {
8686
return;
8787
addImageAccessibleFunctionsBlockCallbackUnsafe(__dso_handle, start, size);
8888
}
89-
void swift::initializeRuntimeAttributesLookup() {
90-
void *start;
91-
uintptr_t size;
92-
GET_SECTION_START_AND_SIZE(start, size, MachOTextSegment,
93-
MachORuntimeAttributesSection);
94-
if (start == nullptr || size == 0)
95-
return;
96-
addImageRuntimeAttributesBlockCallbackUnsafe(__dso_handle, start, size);
97-
}
9889

9990
#endif // defined(__MACH__) && defined(SWIFT_RUNTIME_STATIC_IMAGE_INSPECTION)

stdlib/public/runtime/RuntimeAttribute.cpp

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

0 commit comments

Comments
 (0)