[WebAssembly] Make disassembler always emit most canonical name.
authorWouter van Oortmerssen <aardappel@gmail.com>
Tue, 5 Feb 2019 01:19:45 +0000 (01:19 +0000)
committerWouter van Oortmerssen <aardappel@gmail.com>
Tue, 5 Feb 2019 01:19:45 +0000 (01:19 +0000)
commit1a91cb0402270a3ce77a9397abda655384d89a43
treec55a16056aad9f18a9e8fde3934cac4409cf9a63
parent60731071dedd20ca77e2f53d17b148e25d3bf489
[WebAssembly] Make disassembler always emit most canonical name.

Summary:
There are a few instructions that all map to the same opcode, so
when disassembling, we have to pick one. That was just the first one
before (the except_ref variant in the case of "call"), now it is the
one marked as IsCanonical in tablegen, or failing that, the shortest
name (which is typically the "canonical" one).

Also introduced a canonical "end" instruction for this purpose.

Reviewers: dschuff, tlively

Subscribers: sbc100, jgravelle-google, aheejin, llvm-commits, sunfish

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D57713

llvm-svn: 353131
llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
llvm/lib/Target/WebAssembly/WebAssemblyInstrFormats.td
llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
llvm/test/MC/Disassembler/WebAssembly/wasm.txt
llvm/test/MC/WebAssembly/objdump.s
llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.cpp