summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/utils/TableGen/DisassemblerEmitter.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
committerpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
commitb773203fb58f3ef282fb69c832d8710cab5bc82d (patch)
treee75913f147570fbd75169647b144df85b88a038c /gnu/llvm/utils/TableGen/DisassemblerEmitter.cpp
parenttweak errno in previous (diff)
downloadwireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz
wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/utils/TableGen/DisassemblerEmitter.cpp')
-rw-r--r--gnu/llvm/utils/TableGen/DisassemblerEmitter.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/gnu/llvm/utils/TableGen/DisassemblerEmitter.cpp b/gnu/llvm/utils/TableGen/DisassemblerEmitter.cpp
index 6e1d8dde981..b99a0a973a2 100644
--- a/gnu/llvm/utils/TableGen/DisassemblerEmitter.cpp
+++ b/gnu/llvm/utils/TableGen/DisassemblerEmitter.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "CodeGenTarget.h"
+#include "WebAssemblyDisassemblerEmitter.h"
#include "X86DisassemblerTables.h"
#include "X86RecognizableInstr.h"
#include "llvm/TableGen/Error.h"
@@ -74,8 +75,8 @@ using namespace llvm::X86Disassembler;
/// accurate. Sometimes they are not.
/// (3) to fix the tables to reflect the actual context (for example, required
/// prefixes), and possibly to add a new context by editing
-/// lib/Target/X86/X86DisassemblerDecoderCommon.h. This is unlikely to be
-/// the cause.
+/// include/llvm/Support/X86DisassemblerDecoderCommon.h. This is unlikely
+/// to be the cause.
///
/// DisassemblerEmitter.cpp contains the implementation for the emitter,
/// which simply pulls out instructions from the CodeGenTarget and pushes them
@@ -125,6 +126,14 @@ void EmitDisassembler(RecordKeeper &Records, raw_ostream &OS) {
return;
}
+ // WebAssembly has variable length opcodes, so can't use EmitFixedLenDecoder
+ // below (which depends on a Size table-gen Record), and also uses a custom
+ // disassembler.
+ if (Target.getName() == "WebAssembly") {
+ emitWebAssemblyDisassemblerTables(OS, Target.getInstructionsByEnumValue());
+ return;
+ }
+
// ARM and Thumb have a CHECK() macro to deal with DecodeStatuses.
if (Target.getName() == "ARM" || Target.getName() == "Thumb" ||
Target.getName() == "AArch64" || Target.getName() == "ARM64") {