Pass wasm exception model to TargetOptions

This is no longer implied by -wasm-enable-eh.
This commit is contained in:
Nikita Popov
2025-07-11 10:11:03 +02:00
parent 63e1074c97
commit 12b19be741
5 changed files with 11 additions and 2 deletions

View File

@@ -396,7 +396,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
bool EmitStackSizeSection, bool RelaxELFRelocations, bool UseInitArray,
const char *SplitDwarfFile, const char *OutputObjFile,
const char *DebugInfoCompression, bool UseEmulatedTls,
const char *ArgsCstrBuff, size_t ArgsCstrBuffLen) {
const char *ArgsCstrBuff, size_t ArgsCstrBuffLen, bool UseWasmEH) {
auto OptLevel = fromRust(RustOptLevel);
auto RM = fromRust(RustReloc);
@@ -462,6 +462,9 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
Options.ThreadModel = ThreadModel::Single;
}
if (UseWasmEH)
Options.ExceptionModel = ExceptionHandling::Wasm;
Options.EmitStackSizeSection = EmitStackSizeSection;
if (ArgsCstrBuff != nullptr) {