From 68479e61155014eb131f0f45083d20109e46f4d8 Mon Sep 17 00:00:00 2001 From: Rett Berg Date: Wed, 6 Feb 2019 22:05:06 -0800 Subject: [PATCH] Clarify `br_table` From comments in https://github.com/CraneStation/cranelift/issues/101#issuecomment-461284555 --- cranelift/codegen/meta-python/base/instructions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cranelift/codegen/meta-python/base/instructions.py b/cranelift/codegen/meta-python/base/instructions.py index 53d1586abf..ebb7257f65 100644 --- a/cranelift/codegen/meta-python/base/instructions.py +++ b/cranelift/codegen/meta-python/base/instructions.py @@ -143,6 +143,12 @@ br_table = Instruction( Note that this branch instruction can't pass arguments to the targeted blocks. Split critical edges as needed to work around this. + + Do not confuse this with "tables" in WebAssembly. ``br_table`` is for + jump tables with destinations within the current function only -- think + of a ``match`` in Rust or a ``switch`` in C. If you want to call a + function in a dynamic library, that will typically use + ``call_indirect``. """, ins=(x, EBB, JT), is_branch=True, is_terminator=True)