diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-04-02 22:27:38 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-04-02 22:27:38 +0000 |
commit | 7b999ea7b7e172faeb105d3c3da488c7c3e65890 (patch) | |
tree | 0686be16b9a9d4bff94f229e74d56571557a6038 /llvm/utils/TableGen/DisassemblerEmitter.cpp | |
parent | 7ad0ad0b9a07a546c9e2ae46021062622fea8146 (diff) | |
download | llvm-7b999ea7b7e172faeb105d3c3da488c7c3e65890.zip llvm-7b999ea7b7e172faeb105d3c3da488c7c3e65890.tar.gz llvm-7b999ea7b7e172faeb105d3c3da488c7c3e65890.tar.bz2 |
Second try of initial ARM/Thumb disassembler check-in. It consists of a tablgen
backend (ARMDecoderEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.
Reviewed by Chris Latter and Bob Wilson.
llvm-svn: 100233
Diffstat (limited to 'llvm/utils/TableGen/DisassemblerEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/DisassemblerEmitter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/DisassemblerEmitter.cpp b/llvm/utils/TableGen/DisassemblerEmitter.cpp index a195c0b..3284366 100644 --- a/llvm/utils/TableGen/DisassemblerEmitter.cpp +++ b/llvm/utils/TableGen/DisassemblerEmitter.cpp @@ -12,6 +12,8 @@ #include "Record.h" #include "X86DisassemblerTables.h" #include "X86RecognizableInstr.h" +#include "ARMDecoderEmitter.h" + using namespace llvm; using namespace llvm::X86Disassembler; @@ -124,6 +126,12 @@ void DisassemblerEmitter::run(raw_ostream &OS) { return; } + // Fixed-instruction-length targets use a common disassembler. + if (Target.getName() == "ARM") { + ARMDecoderEmitter(Records).run(OS); + return; + } + throw TGError(Target.getTargetRecord()->getLoc(), "Unable to generate disassembler for this target"); } |