mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-24 12:50:42 +00:00

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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332052 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
952 B
C++
31 lines
952 B
C++
//===- 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
|