forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Fix resume-only case in Emscripten EH (#36)
Summary: D72308 incorrectly assumed `resume` cannot exist without a `landingpad`, which is not true. This sets `Changed` to true whenever we make changes to a function, including creating a call to `__resumeException` within a function without a landing pad. Reviewers: tlively Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73308 Co-authored-by: Heejin Ahn <[email protected]>
- Loading branch information
1 parent
a6f4c1b
commit a56b846
Showing
3 changed files
with
21 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
llvm/test/CodeGen/WebAssembly/lower-em-exceptions-lpad-only.ll
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
llvm/test/CodeGen/WebAssembly/lower-em-exceptions-resume-only.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; RUN: opt < %s -wasm-lower-em-ehsjlj -S | FileCheck %s | ||
|
||
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" | ||
target triple = "wasm32-unknown-unknown" | ||
|
||
; Checks if a module that only contains a resume but not an invoke works | ||
; correctly and does not crash. | ||
; CHECK-LABEL: @resume_only | ||
; CHECK: call void @__resumeException | ||
define void @resume_only() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { | ||
entry: | ||
%val0 = insertvalue { i8*, i32 } undef, i8* null, 0 | ||
%val1 = insertvalue { i8*, i32} %val0, i32 0, 1 | ||
resume { i8*, i32 } %val1 | ||
} | ||
|
||
declare i32 @__gxx_personality_v0(...) |