[PATCH] D81689: [WebAssembly] New-style command support

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 16:48:19 PDT 2020


sbc100 added inline comments.


================
Comment at: lld/test/wasm/command-exports-no-tors.ll:5
+
+; Like command-exports.ll, but with no ctors or dtors, so there should be no
+; __wasm_call_ctors, __cxa_atexit, or wrappers.
----------------
no-tors.ll -> no-ctors.ll?

Also, I've been converting existing tests over to the .s format.   For an example of this see `ctor_return_value.s`.     If possible, I'd prefer to add `.s` tests only going forward .


================
Comment at: lld/test/wasm/command-exports.ll:2
+; RUN: llc -filetype=obj -o %t.o %s
+; RUN: wasm-ld --no-entry %t.o -o %t.wasm
+; RUN: obj2yaml %t.wasm | FileCheck %s
----------------
Ditto .s if possible.


================
Comment at: lld/test/wasm/init-fini-gc.ll:8
 
-; Test that the __wasm_call_ctor function if not referenced
+; Test that we emit wrappers and call __wasm_call_ctor when not referenced.
 
----------------
I guess we should rename this test...?  


================
Comment at: lld/test/wasm/init-fini-gc.ll:27
 
-define i32 @__cxa_atexit(i32 %func, i32 %arg, i32 %dso_handle) {
+define hidden i32 @__cxa_atexit(i32 %func, i32 %arg, i32 %dso_handle) {
   ret i32 0
----------------
Why this?


================
Comment at: lld/test/wasm/init-fini-gc.ll:72
+; CHECK-NEXT:      - Index:           7
+; CHECK-NEXT:        Name:            _start.command_export
 
----------------
What do we actually want to test for here?


================
Comment at: lld/wasm/Writer.cpp:624
+  // call, don't wrap the exports.
+  if (initFunctions.empty() && !config->isPic && WasmSym::callDtors == NULL)
+    return;
----------------
config->isPic is already checked at the call site.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81689/new/

https://reviews.llvm.org/D81689





More information about the llvm-commits mailing list