Skip to content

Commit 01d48e0

Browse files
authored
Merge pull request #62667 from bnbarham/temp-fix-attribute-ordering
[Runtime] Temporarily update attribute ordering
2 parents b47bd15 + f32f405 commit 01d48e0

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

include/swift/Runtime/Config.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
168168
// Bring in visibility attribute macros
169169
#include "swift/shims/Visibility.h"
170170

171+
// Temporary definitions to allow compilation on clang-15.
172+
#if defined(__cplusplus)
173+
#define SWIFT_EXTERN_C extern "C"
174+
#else
175+
#define SWIFT_EXTERN_C
176+
#endif
177+
#define SWIFT_RUNTIME_EXPORT_ATTRIBUTE SWIFT_EXPORT_FROM_ATTRIBUTE(swiftCore)
178+
171179
// Define mappings for calling conventions.
172180

173181
// Annotation for specifying a calling convention of

include/swift/Runtime/Heap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace swift {
2929
// Never returns nil. The returned memory is uninitialized.
3030
//
3131
// An "alignment mask" is just the alignment (a power of 2) minus 1.
32-
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
32+
SWIFT_EXTERN_C SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT_ATTRIBUTE
3333
void *swift_slowAlloc(size_t bytes, size_t alignMask);
3434

3535
// If the caller cannot promise to zero the object during destruction,

include/swift/Runtime/HeapObject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct OpaqueValue;
6161
///
6262
/// POSSIBILITIES: The argument order is fair game. It may be useful
6363
/// to have a variant which guarantees zero-initialized memory.
64-
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
64+
SWIFT_EXTERN_C SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT_ATTRIBUTE
6565
HeapObject *swift_allocObject(HeapMetadata const *metadata,
6666
size_t requiredSize,
6767
size_t requiredAlignmentMask);
@@ -117,7 +117,7 @@ BoxPair swift_makeBoxUnique(OpaqueValue *buffer, Metadata const *type,
117117
size_t alignMask);
118118

119119
/// Returns the address of a heap object representing all empty box types.
120-
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
120+
SWIFT_EXTERN_C SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT_ATTRIBUTE
121121
HeapObject* swift_allocEmptyBox();
122122

123123
/// Atomically increments the retain count of an object.

include/swift/Runtime/Metadata.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ swift_getGenericMetadata(MetadataRequest request,
313313
/// - installing new v-table entries and overrides; and
314314
/// - registering the class with the runtime under ObjC interop.
315315
/// Most of this work can be achieved by calling swift_initClassMetadata.
316-
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
316+
SWIFT_EXTERN_C SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT_ATTRIBUTE
317317
ClassMetadata *
318318
swift_allocateGenericClassMetadata(const ClassDescriptor *description,
319319
const void *arguments,
@@ -322,7 +322,7 @@ swift_allocateGenericClassMetadata(const ClassDescriptor *description,
322322
/// Allocate a generic value metadata object. This is intended to be
323323
/// called by the metadata instantiation function of a generic struct or
324324
/// enum.
325-
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT
325+
SWIFT_EXTERN_C SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT_ATTRIBUTE
326326
ValueMetadata *
327327
swift_allocateGenericValueMetadata(const ValueTypeDescriptor *description,
328328
const void *arguments,

0 commit comments

Comments
 (0)