aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2021-08-01 18:30:18 -0700
committerHeejin Ahn <aheejin@gmail.com>2021-08-03 21:03:46 -0700
commit9bd02c433b5ee0235f263dab4e2f307a5ceb5b0d (patch)
treef98274596af9105c464a7edffc04540be4f5c466 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parentad253446208a06902d3bc4939ac7a64f8026cc84 (diff)
downloadllvm-9bd02c433b5ee0235f263dab4e2f307a5ceb5b0d.zip
llvm-9bd02c433b5ee0235f263dab4e2f307a5ceb5b0d.tar.gz
llvm-9bd02c433b5ee0235f263dab4e2f307a5ceb5b0d.tar.bz2
[WebAssembly] Misc. cosmetic changes in EH (NFC)
- Rename `wasm.catch` intrinsic to `wasm.catch.exn`, because we are planning to add a separate `wasm.catch.longjmp` intrinsic which returns two values. - Rename several variables - Remove an unnecessary parameter from `canLongjmp` and `isEmAsmCall` from LowerEmscriptenEHSjLj pass - Add `-verify-machineinstrs` in a test for a safety measure - Add more comments + fix some errors in comments - Replace `std::vector` with `SmallVector` for cases likely with small number of elements - Renamed `EnableEH`/`EnableSjLj` to `EnableEmEH`/`EnableEmSjLj`: We are soon going to add `EnableWasmSjLj`, so this makes the distincion clearer Reviewed By: tlively Differential Revision: https://reviews.llvm.org/D107405
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 10497e45..f98e9bf0 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -34,13 +34,13 @@ using namespace llvm;
#define DEBUG_TYPE "wasm"
// Emscripten's asm.js-style exception handling
-cl::opt<bool> EnableEmException(
+cl::opt<bool> WasmEnableEmException(
"enable-emscripten-cxx-exceptions",
cl::desc("WebAssembly Emscripten-style exception handling"),
cl::init(false));
// Emscripten's asm.js-style setjmp/longjmp handling
-cl::opt<bool> EnableEmSjLj(
+cl::opt<bool> WasmEnableEmSjLj(
"enable-emscripten-sjlj",
cl::desc("WebAssembly Emscripten-style setjmp/longjmp handling"),
cl::init(false));
@@ -387,7 +387,7 @@ void WebAssemblyPassConfig::addIRPasses() {
// blocks. Lowering invokes when there is no EH support is done in
// TargetPassConfig::addPassesToHandleExceptions, but this runs after this
// function and SjLj handling expects all invokes to be lowered before.
- if (!EnableEmException &&
+ if (!WasmEnableEmException &&
TM->Options.ExceptionModel == ExceptionHandling::None) {
addPass(createLowerInvokePass());
// The lower invoke pass may create unreachable code. Remove it in order not
@@ -396,9 +396,9 @@ void WebAssemblyPassConfig::addIRPasses() {
}
// Handle exceptions and setjmp/longjmp if enabled.
- if (EnableEmException || EnableEmSjLj)
- addPass(createWebAssemblyLowerEmscriptenEHSjLj(EnableEmException,
- EnableEmSjLj));
+ if (WasmEnableEmException || WasmEnableEmSjLj)
+ addPass(createWebAssemblyLowerEmscriptenEHSjLj(WasmEnableEmException,
+ WasmEnableEmSjLj));
// Expand indirectbr instructions to switches.
addPass(createIndirectBrExpandPass());