[all-commits] [llvm/llvm-project] a6aae5: [WebAssembly] Don't inline -emscripten-cxx-excepti...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Wed Mar 24 12:28:39 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6aae5f7fcd1111db87bfe77072912484213f872
      https://github.com/llvm/llvm-project/commit/a6aae5f7fcd1111db87bfe77072912484213f872
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M clang/lib/Driver/ToolChains/WebAssembly.cpp
    M clang/test/Driver/wasm-toolchain.c

  Log Message:
  -----------
  [WebAssembly] Don't inline -emscripten-cxx-exceptions-allowed functions

Functions specified in `-emscripten-cxx-exceptions-allowed`, which is
set by Emscripten's `EXCEPTION_CATCHING_ALLOWED` setting, can be inlined
in LLVM middle ends before we reach WebAssemblyLowerEmscriptenEHSjLj
pass in the wasm backend and thus don't get transformed for exception
catching.

This fixes the issue by adding `--force-attribute=FUNC_NAME:noinline`
for each function name in `-emscripten-cxx-exceptions-allowed`, which
adds `noinline` attribute to the specified function and thus excludes
the function from inlining candidates in optimization passes.

Fixes the remaining half of
https://github.com/emscripten-core/emscripten/issues/10721.

Reviewed By: sbc100

Differential Revision: https://reviews.llvm.org/D99259




More information about the All-commits mailing list