diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-07-15 22:49:25 +0000 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2019-07-15 22:49:25 +0000 |
commit | 9f96a58cccb63110ca9515644c454620c86c566d (patch) | |
tree | 177627ee6e16992d4466cce9b1e0fb3c0588cc01 /llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | |
parent | c9e3c8301446f20efef6721dd3a05f2f9da217d8 (diff) | |
download | llvm-9f96a58cccb63110ca9515644c454620c86c566d.zip llvm-9f96a58cccb63110ca9515644c454620c86c566d.tar.gz llvm-9f96a58cccb63110ca9515644c454620c86c566d.tar.bz2 |
[WebAssembly] Rename except_ref type to exnref
Summary:
We agreed to rename `except_ref` to `exnref` for consistency with other
reference types in
https://github.com/WebAssembly/exception-handling/issues/79. This also
renames WebAssemblyInstrExceptRef.td to WebAssemblyInstrRef.td in order
to use the file for other reference types in future.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64703
llvm-svn: 366145
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp index a23a47d..e6bfc52 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp @@ -308,7 +308,7 @@ void WebAssemblyCFGStackify::placeBlockMarker(MachineBasicBlock &MBB) { // Add the BLOCK. - // 'br_on_exn' extracts except_ref object and pushes variable number of values + // 'br_on_exn' extracts exnref object and pushes variable number of values // depending on its tag. For C++ exception, its a single i32 value, and the // generated code will be in the form of: // block i32 @@ -766,11 +766,11 @@ bool WebAssemblyCFGStackify::fixUnwindMismatches(MachineFunction &MF) { // Note that the new wrapping block/end_block will be generated later in // placeBlockMarker. // - // TODO Currently local.set and local.gets are generated to move except_ref - // value created by catches. That's because we don't support yielding values - // from a block in LLVM machine IR yet, even though it is supported by wasm. - // Delete unnecessary local.get/local.sets once yielding values from a block - // is supported. The full EH spec requires multi-value support to do this, but + // TODO Currently local.set and local.gets are generated to move exnref value + // created by catches. That's because we don't support yielding values from a + // block in LLVM machine IR yet, even though it is supported by wasm. Delete + // unnecessary local.get/local.sets once yielding values from a block is + // supported. The full EH spec requires multi-value support to do this, but // for C++ we don't yet need it because we only throw a single i32. // // --- @@ -834,7 +834,7 @@ bool WebAssemblyCFGStackify::fixUnwindMismatches(MachineFunction &MF) { DenseMap<MachineBasicBlock *, SmallVector<TryRange, 4>> UnwindDestToTryRanges; // In new CFG, <destination to branch to, a vector of try ranges> DenseMap<MachineBasicBlock *, SmallVector<TryRange, 4>> BrDestToTryRanges; - // In new CFG, <destination to branch to, register containing except_ref> + // In new CFG, <destination to branch to, register containing exnref> DenseMap<MachineBasicBlock *, unsigned> BrDestToExnReg; // Gather possibly throwing calls (i.e., previously invokes) whose current @@ -936,8 +936,7 @@ bool WebAssemblyCFGStackify::fixUnwindMismatches(MachineFunction &MF) { // of the function with a local.get and a rethrow instruction. if (NeedAppendixBlock) { auto *AppendixBB = getAppendixBlock(MF); - unsigned ExnReg = - MRI.createVirtualRegister(&WebAssembly::EXCEPT_REFRegClass); + unsigned ExnReg = MRI.createVirtualRegister(&WebAssembly::EXNREFRegClass); BuildMI(AppendixBB, DebugLoc(), TII.get(WebAssembly::RETHROW)) .addReg(ExnReg); // These instruction ranges should branch to this appendix BB. @@ -1225,8 +1224,8 @@ void WebAssemblyCFGStackify::fixEndsAtEndOfFunction(MachineFunction &MF) { case MVT::v2f64: RetType = WebAssembly::ExprType::V128; break; - case MVT::ExceptRef: - RetType = WebAssembly::ExprType::ExceptRef; + case MVT::exnref: + RetType = WebAssembly::ExprType::Exnref; break; default: llvm_unreachable("unexpected return type"); |