Skip to content

Introduce SWIFT_EXTERN_RUNTIME_EXPORT for Windows #6820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/swift/Runtime/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ swift_dynamicCastFailure(const void *sourceType, const char *sourceName,
const char *message = nullptr);

SWIFT_RUNTIME_EXPORT
extern "C"
void swift_reportError(uint32_t flags, const char *message);

// namespace swift
Expand Down
39 changes: 19 additions & 20 deletions include/swift/Runtime/Enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ struct TypeLayout;
/// \param payload - type metadata for the payload case of the enum.
/// \param emptyCases - the number of empty cases in the enum.
SWIFT_RUNTIME_EXPORT
extern "C" void swift_initEnumValueWitnessTableSinglePayload(
ValueWitnessTable *vwtable,
const TypeLayout *payload,
unsigned emptyCases);
void swift_initEnumValueWitnessTableSinglePayload(ValueWitnessTable *vwtable,
const TypeLayout *payload,
unsigned emptyCases);

/// \brief Faster variant of the above which avoids digging into the enum type
/// metadata when the caller already has the payload information handy.
Expand All @@ -57,9 +56,9 @@ extern "C" void swift_initEnumValueWitnessTableSinglePayload(
/// returns a value greater than or equal to zero and less than
/// emptyCases.
SWIFT_RT_ENTRY_VISIBILITY
extern "C" int swift_getEnumCaseSinglePayload(const OpaqueValue *value,
const Metadata *payload,
unsigned emptyCases)
int swift_getEnumCaseSinglePayload(const OpaqueValue *value,
const Metadata *payload,
unsigned emptyCases)
SWIFT_CC(RegisterPreservingCC);


Expand All @@ -76,19 +75,19 @@ extern "C" int swift_getEnumCaseSinglePayload(const OpaqueValue *value,
/// than emptyCases for an empty case.
/// \param emptyCases - the number of empty cases in the enum.
SWIFT_RT_ENTRY_VISIBILITY
extern "C" void swift_storeEnumTagSinglePayload(OpaqueValue *value,
const Metadata *payload,
int whichCase,
unsigned emptyCases)
void swift_storeEnumTagSinglePayload(OpaqueValue *value,
const Metadata *payload,
int whichCase,
unsigned emptyCases)
SWIFT_CC(RegisterPreservingCC);

/// \brief Initialize the value witness table for a generic, multi-payload
/// enum instance.
SWIFT_RUNTIME_EXPORT
extern "C" void swift_initEnumMetadataMultiPayload(ValueWitnessTable *vwtable,
EnumMetadata *enumType,
unsigned numPayloads,
const TypeLayout * const *payloadTypes);
void swift_initEnumMetadataMultiPayload(ValueWitnessTable *vwtable,
EnumMetadata *enumType,
unsigned numPayloads,
const TypeLayout * const *payloadTypes);

/// \brief Return an integer value representing which case of a multi-payload
/// enum is inhabited.
Expand All @@ -98,15 +97,15 @@ extern "C" void swift_initEnumMetadataMultiPayload(ValueWitnessTable *vwtable,
///
/// \returns The index of the enum case.
SWIFT_RUNTIME_EXPORT
extern "C" unsigned swift_getEnumCaseMultiPayload(const OpaqueValue *value,
const EnumMetadata *enumType);
unsigned swift_getEnumCaseMultiPayload(const OpaqueValue *value,
const EnumMetadata *enumType);

/// \brief Store the tag value for the given case into a multi-payload enum,
/// whose associated payload (if any) has already been initialized.
SWIFT_RUNTIME_EXPORT
extern "C" void swift_storeEnumTagMultiPayload(OpaqueValue *value,
const EnumMetadata *enumType,
unsigned whichCase);
void swift_storeEnumTagMultiPayload(OpaqueValue *value,
const EnumMetadata *enumType,
unsigned whichCase);

}

Expand Down
Loading