[llvm-bugs] [Bug 49892] New: [WebAssembly Target] Import+Export Attribute: C++ Generics
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Apr 8 05:12:46 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=49892
Bug ID: 49892
Summary: [WebAssembly Target] Import+Export Attribute: C++
Generics
Product: clang
Version: unspecified
Hardware: PC
OS: other
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: sascha.braun.lpz at googlemail.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Hi,
this is more a feature proposal than a bug report.
For WASM, we have
__attribute__((import_name(name)))
__attribute__((export_name(name)))
This is static and not yet really suitable for generic types and functions.
Can this be extended, e.g. in the following manner:
__attribute__((import_name("importedfunction1<T>")))
Where T gets replaced by the generic argument type name.
In order to be able to address unmangled or language independent type names,
another addition may be needed:
We would need to be able to decorate types/classes with another attribute, e.g.
__attribute__((wasm_type_name("MyClass1NameAttribute"))) class MyClass1 { ...
};
So we can get finally to resolve
__attribute__((import_name("importedfunction1<T>"))) generic_type_function1()
{}
into a wasm import name importedfunction1<MyClass1NameAttribute>.
This can be very useful if the executing VM is aware of the generics the wasm
module is implementing.
Many Thanks,
Sascha
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210408/27a120dd/attachment-0001.html>
More information about the llvm-bugs
mailing list