Skip to content

Commit e08020f

Browse files
authored
Merge pull request swiftlang#31584 from compnerd/library-visibility
runtime: replace `LLVM_LIBRARY_VISIBILITY` with `SWIFT_LIBRARY_VISIBI…
2 parents 7ffccfe + 9731704 commit e08020f

File tree

6 files changed

+19
-26
lines changed

6 files changed

+19
-26
lines changed

stdlib/private/StdlibUnittest/InspectValue.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515

1616
using namespace swift;
1717

18-
SWIFT_CC(swift) LLVM_LIBRARY_VISIBILITY extern "C"
19-
const char *getMetadataKindOf(
20-
OpaqueValue *value,
21-
const Metadata *type
22-
) {
18+
SWIFT_CC(swift)
19+
SWIFT_LIBRARY_VISIBILITY extern "C" const
20+
char *getMetadataKindOf(OpaqueValue *value, const Metadata *type) {
2321
switch (type->getKind()) {
2422
#define METADATAKIND(NAME, VALUE) \
2523
case MetadataKind::NAME: return #NAME;
@@ -28,4 +26,3 @@ const char *getMetadataKindOf(
2826
default: return "none of your business";
2927
}
3028
}
31-

stdlib/public/SwiftShims/RefCount.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ namespace swift {
182182
}
183183

184184
// FIXME: HACK: copied from HeapObject.cpp
185-
extern "C" LLVM_LIBRARY_VISIBILITY LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED
185+
extern "C" SWIFT_LIBRARY_VISIBILITY LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED
186186
void _swift_release_dealloc(swift::HeapObject *object);
187187

188188
namespace swift {

stdlib/public/runtime/Errors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ void swift::printCurrentBacktrace(unsigned framesToSkip) {
255255
// The layout of this struct is CrashReporter ABI, so there are no ABI concerns
256256
// here.
257257
extern "C" {
258-
LLVM_LIBRARY_VISIBILITY
258+
SWIFT_LIBRARY_VISIBILITY
259259
struct crashreporter_annotations_t gCRAnnotations
260260
__attribute__((__section__("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION))) = {
261261
CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0, 0};

stdlib/public/runtime/ExistentialMetadataImpl.h

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ namespace swift {
2525
namespace metadataimpl {
2626

2727
/// A common base class for opaque-existential and class-existential boxes.
28-
template<typename Impl>
29-
struct LLVM_LIBRARY_VISIBILITY ExistentialBoxBase {
30-
};
28+
template <typename Impl> struct SWIFT_LIBRARY_VISIBILITY ExistentialBoxBase {};
3129

3230
/// A common base class for fixed and non-fixed opaque-existential box
3331
/// implementations.
34-
struct LLVM_LIBRARY_VISIBILITY OpaqueExistentialBoxBase
32+
struct SWIFT_LIBRARY_VISIBILITY OpaqueExistentialBoxBase
3533
: ExistentialBoxBase<OpaqueExistentialBoxBase> {
3634
template <class Container, class... A>
3735
static void destroy(Container *value, A... args) {
@@ -290,7 +288,7 @@ struct LLVM_LIBRARY_VISIBILITY OpaqueExistentialBoxBase
290288
/// witness tables. Note that the WitnessTables field is accessed via
291289
/// spooky action from Header.
292290
template <unsigned NumWitnessTables>
293-
struct LLVM_LIBRARY_VISIBILITY FixedOpaqueExistentialContainer {
291+
struct SWIFT_LIBRARY_VISIBILITY FixedOpaqueExistentialContainer {
294292
OpaqueExistentialContainer Header;
295293
const void *WitnessTables[NumWitnessTables];
296294
};
@@ -304,7 +302,7 @@ struct FixedOpaqueExistentialContainer<0> {
304302
/// A box implementation class for an opaque existential type with
305303
/// a fixed number of witness tables.
306304
template <unsigned NumWitnessTables>
307-
struct LLVM_LIBRARY_VISIBILITY OpaqueExistentialBox
305+
struct SWIFT_LIBRARY_VISIBILITY OpaqueExistentialBox
308306
: OpaqueExistentialBoxBase {
309307
struct Container : FixedOpaqueExistentialContainer<NumWitnessTables> {
310308
const Metadata *getType() const {
@@ -346,7 +344,7 @@ struct LLVM_LIBRARY_VISIBILITY OpaqueExistentialBox
346344

347345
/// A non-fixed box implementation class for an opaque existential
348346
/// type with a dynamic number of witness tables.
349-
struct LLVM_LIBRARY_VISIBILITY NonFixedOpaqueExistentialBox
347+
struct SWIFT_LIBRARY_VISIBILITY NonFixedOpaqueExistentialBox
350348
: OpaqueExistentialBoxBase {
351349
struct Container {
352350
OpaqueExistentialContainer Header;
@@ -400,7 +398,7 @@ struct LLVM_LIBRARY_VISIBILITY NonFixedOpaqueExistentialBox
400398

401399
/// A common base class for fixed and non-fixed class-existential box
402400
/// implementations.
403-
struct LLVM_LIBRARY_VISIBILITY ClassExistentialBoxBase
401+
struct SWIFT_LIBRARY_VISIBILITY ClassExistentialBoxBase
404402
: ExistentialBoxBase<ClassExistentialBoxBase> {
405403
static constexpr unsigned numExtraInhabitants =
406404
swift_getHeapObjectExtraInhabitantCount();
@@ -462,14 +460,12 @@ struct LLVM_LIBRARY_VISIBILITY ClassExistentialBoxBase
462460
return swift_getHeapObjectExtraInhabitantIndex(
463461
(HeapObject* const *) src->getValueSlot()) + 1;
464462
}
465-
466463
};
467464

468465
/// A box implementation class for an existential container with
469466
/// a class constraint and a fixed number of protocol witness tables.
470467
template <unsigned NumWitnessTables>
471-
struct LLVM_LIBRARY_VISIBILITY ClassExistentialBox
472-
: ClassExistentialBoxBase {
468+
struct SWIFT_LIBRARY_VISIBILITY ClassExistentialBox : ClassExistentialBoxBase {
473469
struct Container {
474470
ClassExistentialContainer Header;
475471
const void *TypeInfo[NumWitnessTables];
@@ -495,7 +491,7 @@ struct LLVM_LIBRARY_VISIBILITY ClassExistentialBox
495491

496492
/// A non-fixed box implementation class for a class existential
497493
/// type with a dynamic number of witness tables.
498-
struct LLVM_LIBRARY_VISIBILITY NonFixedClassExistentialBox
494+
struct SWIFT_LIBRARY_VISIBILITY NonFixedClassExistentialBox
499495
: ClassExistentialBoxBase {
500496
struct Container {
501497
ClassExistentialContainer Header;
@@ -532,7 +528,7 @@ struct LLVM_LIBRARY_VISIBILITY NonFixedClassExistentialBox
532528

533529
/// A common base class for fixed and non-fixed existential metatype box
534530
/// implementations.
535-
struct LLVM_LIBRARY_VISIBILITY ExistentialMetatypeBoxBase
531+
struct SWIFT_LIBRARY_VISIBILITY ExistentialMetatypeBoxBase
536532
: ExistentialBoxBase<ExistentialMetatypeBoxBase> {
537533
static constexpr unsigned numExtraInhabitants =
538534
swift_getHeapObjectExtraInhabitantCount();
@@ -591,7 +587,7 @@ struct LLVM_LIBRARY_VISIBILITY ExistentialMetatypeBoxBase
591587
/// A box implementation class for an existential metatype container
592588
/// with a fixed number of protocol witness tables.
593589
template <unsigned NumWitnessTables>
594-
struct LLVM_LIBRARY_VISIBILITY ExistentialMetatypeBox
590+
struct SWIFT_LIBRARY_VISIBILITY ExistentialMetatypeBox
595591
: ExistentialMetatypeBoxBase {
596592
struct Container {
597593
ExistentialMetatypeContainer Header;
@@ -618,7 +614,7 @@ struct LLVM_LIBRARY_VISIBILITY ExistentialMetatypeBox
618614

619615
/// A non-fixed box implementation class for an existential metatype
620616
/// type with a dynamic number of witness tables.
621-
struct LLVM_LIBRARY_VISIBILITY NonFixedExistentialMetatypeBox
617+
struct SWIFT_LIBRARY_VISIBILITY NonFixedExistentialMetatypeBox
622618
: ExistentialMetatypeBoxBase {
623619
struct Container {
624620
ExistentialMetatypeContainer Header;

stdlib/public/runtime/HeapObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ HeapObject *swift::swift_allocEmptyBox() {
327327
}
328328

329329
// Forward-declare this, but define it after swift_release.
330-
extern "C" LLVM_LIBRARY_VISIBILITY LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED
330+
extern "C" SWIFT_LIBRARY_VISIBILITY LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED
331331
void _swift_release_dealloc(HeapObject *object);
332332

333333
static HeapObject *_swift_retain_(HeapObject *object) {

stdlib/public/runtime/Private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ class TypeInfo {
192192
}
193193
#endif
194194

195-
LLVM_LIBRARY_VISIBILITY
195+
SWIFT_LIBRARY_VISIBILITY
196196
const ClassMetadata *_swift_getClass(const void *object);
197197

198-
LLVM_LIBRARY_VISIBILITY
198+
SWIFT_LIBRARY_VISIBILITY
199199
bool usesNativeSwiftReferenceCounting(const ClassMetadata *theClass);
200200

201201
static inline

0 commit comments

Comments
 (0)