//===-- WebAssemblyUtilities.cpp - WebAssembly Utility Functions ----------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file implements several utility functions for WebAssembly.
///
//===----------------------------------------------------------------------===//
using namespace llvm;
// Exception handling & setjmp-longjmp handling related options. These are
// defined here to be shared between WebAssembly and its subdirectories.
// Emscripten's asm.js-style exception handling
cl::opt<bool> ;
// Emscripten's asm.js-style setjmp/longjmp handling
cl::opt<bool> ;
// Exception handling using wasm EH instructions
cl::opt<bool>
;
// setjmp/longjmp handling using wasm EH instrutions
cl::opt<bool>
;
// Function names in libc++abi and libunwind
const char *const WebAssembly::CxaBeginCatchFn = "__cxa_begin_catch";
const char *const WebAssembly::CxaRethrowFn = "__cxa_rethrow";
const char *const WebAssembly::StdTerminateFn = "_ZSt9terminatev";
const char *const WebAssembly::PersonalityWrapperFn =
"_Unwind_Wasm_CallPersonality";
/// Test whether MI is a child of some other node in an expression tree.
bool
bool
const MachineOperand &
MCSymbolWasm *
MCSymbolWasm *
// Find a catch instruction from an EH pad.
MachineInstr *
unsigned