mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[wasm] add @_expose(wasm) attribute support
This attribute instructs the compiler that this function declaration
should be "export"ed from this .wasm module. It's equivalent of Clang's
`__attribute__((export_name("name")))`
This commit is contained in:
@@ -299,6 +299,10 @@ private:
|
||||
/// Name of a section if @_section attribute was used, otherwise empty.
|
||||
StringRef Section;
|
||||
|
||||
/// Name of a Wasm export if @_expose(wasm) attribute was used, otherwise
|
||||
/// empty.
|
||||
StringRef WasmExportName;
|
||||
|
||||
/// Has value if there's a profile for this function
|
||||
/// Contains Function Entry Count
|
||||
ProfileCounter EntryCount;
|
||||
@@ -1264,6 +1268,10 @@ public:
|
||||
StringRef section() const { return Section; }
|
||||
void setSection(StringRef value) { Section = value; }
|
||||
|
||||
/// Return Wasm export name if @_expose(wasm) was used, otherwise empty
|
||||
StringRef wasmExportName() const { return WasmExportName; }
|
||||
void setWasmExportName(StringRef value) { WasmExportName = value; }
|
||||
|
||||
/// Returns true if this function belongs to a declaration that returns
|
||||
/// an opaque result type with one or more availability conditions that are
|
||||
/// allowed to produce a different underlying type at runtime.
|
||||
|
||||
Reference in New Issue
Block a user