[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:
Yuta Saito
2023-08-31 00:03:47 +00:00
parent cd3e6e3481
commit 6d378a3ec3
17 changed files with 214 additions and 46 deletions

View File

@@ -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.