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: unassignedclangb...@nondot.org
          Reporter: sascha.braun....@googlemail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to