From 2bc97e83f69eead5e5b3c570f919a366beb5801f Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Mon, 23 May 2022 20:16:55 -0700 Subject: [PATCH 1/2] [EH] Rename format_exception.cpp I think we need a separate file in libc++abi for 'our' EH, meaning both Emscripten EH and Wasm EH. (I think they can be in the same file, as long as we have `ifdef`s) This also adds a file header. I think this method can be in that file, rather than having a separate file for this. I named this `cxa_emscripten.cpp` because it's the name #16627 used and I hope we can put all Emscripten specific stuff there, but maybe @sbc100 had another thought; if so let me know. --- .../src/{format_exception.cpp => cxa_emscripten.cpp} | 10 ++++++++++ tools/system_libs.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) rename system/lib/libcxxabi/src/{format_exception.cpp => cxa_emscripten.cpp} (73%) diff --git a/system/lib/libcxxabi/src/format_exception.cpp b/system/lib/libcxxabi/src/cxa_emscripten.cpp similarity index 73% rename from system/lib/libcxxabi/src/format_exception.cpp rename to system/lib/libcxxabi/src/cxa_emscripten.cpp index 815e8b9918f59..3d2b9f08fb1b3 100644 --- a/system/lib/libcxxabi/src/format_exception.cpp +++ b/system/lib/libcxxabi/src/cxa_emscripten.cpp @@ -1,3 +1,13 @@ +//===------------------------- cxa_emscripten.cpp -------------------------===// +// +// This code contains Emscripten specific code for exception handling. +// Emscripten has two modes of exception handling: Emscripten EH, which uses JS +// glue code, and Wasm EH, which uses the new Wasm exception handling proposal +// and meant to be faster. Code for different modes is demarcated with +// '__USING_EMSCRIPTEN_EXCEPTIONS__' and '__USING_WASM_EXCEPTIONS__'. +// +//===----------------------------------------------------------------------===// + #include "cxa_exception.h" #include "private_typeinfo.h" #include diff --git a/tools/system_libs.py b/tools/system_libs.py index 5c2c003cf1497..e6fb0cf83f881 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -1203,7 +1203,7 @@ def get_files(self): 'stdlib_stdexcept.cpp', 'stdlib_typeinfo.cpp', 'private_typeinfo.cpp', - 'format_exception.cpp', + 'cxa_emscripten.cpp', ] if self.eh_mode == Exceptions.NONE: filenames += ['cxa_noexception.cpp'] From 2fde6ddcb8ed3e40bade1a2a61bb6fa33169eb9d Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 24 May 2022 15:59:08 -0700 Subject: [PATCH 2/2] Rename to cxa_exception_emscripten.cpp --- .../src/{cxa_emscripten.cpp => cxa_exception_emscripten.cpp} | 2 +- tools/system_libs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename system/lib/libcxxabi/src/{cxa_emscripten.cpp => cxa_exception_emscripten.cpp} (96%) diff --git a/system/lib/libcxxabi/src/cxa_emscripten.cpp b/system/lib/libcxxabi/src/cxa_exception_emscripten.cpp similarity index 96% rename from system/lib/libcxxabi/src/cxa_emscripten.cpp rename to system/lib/libcxxabi/src/cxa_exception_emscripten.cpp index 3d2b9f08fb1b3..e740d0fec97a0 100644 --- a/system/lib/libcxxabi/src/cxa_emscripten.cpp +++ b/system/lib/libcxxabi/src/cxa_exception_emscripten.cpp @@ -1,4 +1,4 @@ -//===------------------------- cxa_emscripten.cpp -------------------------===// +//===------------------- cxa_exception_emscripten.cpp ---------------------===// // // This code contains Emscripten specific code for exception handling. // Emscripten has two modes of exception handling: Emscripten EH, which uses JS diff --git a/tools/system_libs.py b/tools/system_libs.py index e6fb0cf83f881..2f1d72b19879a 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -1203,7 +1203,7 @@ def get_files(self): 'stdlib_stdexcept.cpp', 'stdlib_typeinfo.cpp', 'private_typeinfo.cpp', - 'cxa_emscripten.cpp', + 'cxa_exception_emscripten.cpp', ] if self.eh_mode == Exceptions.NONE: filenames += ['cxa_noexception.cpp']