mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[wasm] add @_extern(wasm) attribute support
This attribute instructs the compiler that this function declaration
should be "import"ed from host environment. It's equivalent of Clang's
`__attribute__((import_module("module"), import_name("field")))`
This commit is contained in:
@@ -180,6 +180,10 @@ void SILFunctionBuilder::addFunctionAttributes(
|
||||
}
|
||||
}
|
||||
|
||||
if (auto *EA = Attrs.getAttribute<ExternAttr>()) {
|
||||
F->setWasmImportModuleAndField(EA->ModuleName, EA->Name);
|
||||
}
|
||||
|
||||
if (Attrs.hasAttribute<UsedAttr>())
|
||||
F->setMarkedAsUsed(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user