[all-commits] [llvm/llvm-project] d4efc3: [Coverage][WebAssembly] Add initial support for We...

Yuta Saito via All-commits all-commits at lists.llvm.org
Mon Oct 14 10:42:04 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4efc3e097f40afbe8ae275150f49bb08fc04572
      https://github.com/llvm/llvm-project/commit/d4efc3e097f40afbe8ae275150f49bb08fc04572
  Author: Yuta Saito <kateinoigakukun at gmail.com>
  Date:   2024-10-15 (Tue, 15 Oct 2024)

  Changed paths:
    M clang/lib/Driver/ToolChains/WebAssembly.cpp
    M compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
    M compiler-rt/cmake/config-ix.cmake
    M compiler-rt/lib/profile/CMakeLists.txt
    M compiler-rt/lib/profile/GCDAProfiling.c
    M compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
    M compiler-rt/lib/profile/InstrProfilingPlatformOther.c
    M compiler-rt/lib/profile/InstrProfilingPort.h
    M compiler-rt/lib/profile/InstrProfilingUtil.c
    A lld/test/wasm/custom-section-align.s
    M lld/wasm/InputChunks.h
    M lld/wasm/InputFiles.cpp
    M lld/wasm/OutputSections.cpp
    M llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    M llvm/lib/MC/MCContext.cpp
    M llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    A llvm/test/CodeGen/WebAssembly/profile.ll
    M llvm/test/Instrumentation/InstrProfiling/profiling.ll
    A llvm/test/tools/llvm-cov/Inputs/binary-formats.v6.wasm32
    A llvm/test/tools/llvm-cov/Inputs/binary-formats.wasm.proftext
    M llvm/test/tools/llvm-cov/binary-formats.c

  Log Message:
  -----------
  [Coverage][WebAssembly] Add initial support for WebAssembly/WASI (#111332)

Currently, WebAssembly/WASI target does not provide direct support for
code coverage.
This patch set fixes several issues to unlock the feature. The main
changes are:

1. Port `compiler-rt/lib/profile` to WebAssembly/WASI.
2. Adjust profile metadata sections for Wasm object file format.
- [CodeGen] Emit `__llvm_covmap` and `__llvm_covfun` as custom sections
instead of data segments.
    - [lld] Align the interval space of custom sections at link time.
- [llvm-cov] Copy misaligned custom section data if the start address is
not aligned.
    - [llvm-cov] Read `__llvm_prf_names` from data segments
3. [clang] Link with profile runtime libraries if requested

See each commit message for more details and rationale.
This is part of the effort to add code coverage support in Wasm target
of Swift toolchain.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list