summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.h
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-05-10 22:16:44 +0000
committerSam Clegg <sbc@chromium.org>2018-05-10 22:16:44 +0000
commit16c16827bc7e21ff628e89562e32960eb3d7ca1d (patch)
tree5dab905667f9fdc837a4a8f21df3141fafd5ccff /llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.h
parent65e9f1f2c9d5a9d4422472184ae9a6bb1e1d7552 (diff)
downloadbcm5719-llvm-16c16827bc7e21ff628e89562e32960eb3d7ca1d.tar.gz
bcm5719-llvm-16c16827bc7e21ff628e89562e32960eb3d7ca1d.zip
[WebAssembly] Initial Disassembler.
This implements a new table-gen emitter to create tables for a wasm disassembler, and a dissassembler to use them. Comes with 2 tests, that tests a few instructions manually. Is also able to disassemble large .wasm files with objdump reasonably. Not working so well, to be addressed in followups: - objdump appears to be passing an incorrect starting point. - since the disassembler works an instruction at a time, and it is disassembling stack instruction, it has no idea of pseudo register assignments. These registers are required for the instruction printing code that follows. For now, all such registers appear in the output as $0. Patch by Wouter van Oortmerssen Differential Revision: https://reviews.llvm.org/D45848 llvm-svn: 332052
Diffstat (limited to 'llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.h')
-rw-r--r--llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.h b/llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.h
new file mode 100644
index 00000000000..91f820f120a
--- /dev/null
+++ b/llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.h
@@ -0,0 +1,30 @@
+//===- WebAssemblyDisassemblerEmitter.h - Disassembler tables ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is part of the WebAssembly Disassembler Emitter.
+// It contains the interface of the disassembler tables.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_UTILS_TABLEGEN_WEBASSEMBLYDISASSEMBLEREMITTER_H
+#define LLVM_UTILS_TABLEGEN_WEBASSEMBLYDISASSEMBLEREMITTER_H
+
+#include "CodeGenInstruction.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/raw_ostream.h"
+
+namespace llvm {
+
+void emitWebAssemblyDisassemblerTables(
+ raw_ostream &OS,
+ const ArrayRef<const CodeGenInstruction *> &NumberedInstructions);
+
+} // namespace llvm
+
+#endif
OpenPOWER on IntegriCloud