[PATCH] D53873: [WebAssembly] Fix signature parsing for 'try' in AsmParser
Heejin Ahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 1 13:34:32 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL345888: [WebAssembly] Fix signature parsing for 'try' in AsmParser (authored by aheejin, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D53873
Files:
llvm/trunk/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
llvm/trunk/test/MC/WebAssembly/basic-assembly.s
Index: llvm/trunk/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
+++ llvm/trunk/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
@@ -303,7 +303,7 @@
// assembly, so we add a dummy one explicitly (since we have no control
// over signature tables here, we assume these will be regenerated when
// the wasm module is generated).
- if (BaseName == "block" || BaseName == "loop") {
+ if (BaseName == "block" || BaseName == "loop" || BaseName == "try") {
Operands.push_back(make_unique<WebAssemblyOperand>(
WebAssemblyOperand::Integer, NameLoc, NameLoc,
WebAssemblyOperand::IntOp{-1}));
Index: llvm/trunk/test/MC/WebAssembly/basic-assembly.s
===================================================================
--- llvm/trunk/test/MC/WebAssembly/basic-assembly.s
+++ llvm/trunk/test/MC/WebAssembly/basic-assembly.s
@@ -1,4 +1,4 @@
-# RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+simd128,+nontrapping-fptoint < %s | FileCheck %s
+# RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+simd128,+nontrapping-fptoint,+exception-handling < %s | FileCheck %s
.text
.type test0, at function
@@ -46,6 +46,13 @@
# TODO: enable once instruction has been added.
#i32x4.trunc_s/f32x4:sat
i32.trunc_s/f32
+ try
+.LBB0_3:
+ i32.catch 0
+.LBB0_4:
+ catch_all
+.LBB0_5:
+ end_try
#i32.trunc_s:sat/f32
get_global __stack_pointer at GLOBAL
end_function
@@ -88,5 +95,12 @@
# CHECK-NEXT: get_local 5
# CHECK-NEXT: f32x4.add
# CHECK-NEXT: i32.trunc_s/f32
+# CHECK-NEXT: try
+# CHECK-NEXT: .LBB0_3:
+# CHECK-NEXT: i32.catch 0
+# CHECK-NEXT: .LBB0_4:
+# CHECK-NEXT: catch_all
+# CHECK-NEXT: .LBB0_5:
+# CHECK-NEXT: end_try
# CHECK-NEXT: get_global __stack_pointer at GLOBAL
# CHECK-NEXT: end_function
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53873.172220.patch
Type: text/x-patch
Size: 1998 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181101/e8ee9dff/attachment.bin>
More information about the llvm-commits
mailing list