diff options
Diffstat (limited to 'contrib/llvm/lib/MC/MCDisassembler/MCDisassembler.cpp')
-rw-r--r-- | contrib/llvm/lib/MC/MCDisassembler/MCDisassembler.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/contrib/llvm/lib/MC/MCDisassembler/MCDisassembler.cpp b/contrib/llvm/lib/MC/MCDisassembler/MCDisassembler.cpp new file mode 100644 index 0000000..1084e5e --- /dev/null +++ b/contrib/llvm/lib/MC/MCDisassembler/MCDisassembler.cpp @@ -0,0 +1,39 @@ +//===-- MCDisassembler.cpp - Disassembler interface -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/MC/MCDisassembler.h" +#include "llvm/MC/MCExternalSymbolizer.h" +#include "llvm/Support/raw_ostream.h" + +using namespace llvm; + +MCDisassembler::~MCDisassembler() { +} + +bool MCDisassembler::tryAddingSymbolicOperand(MCInst &Inst, int64_t Value, + uint64_t Address, bool IsBranch, + uint64_t Offset, + uint64_t InstSize) const { + raw_ostream &cStream = CommentStream ? *CommentStream : nulls(); + if (Symbolizer) + return Symbolizer->tryAddingSymbolicOperand(Inst, cStream, Value, Address, + IsBranch, Offset, InstSize); + return false; +} + +void MCDisassembler::tryAddingPcLoadReferenceComment(int64_t Value, + uint64_t Address) const { + raw_ostream &cStream = CommentStream ? *CommentStream : nulls(); + if (Symbolizer) + Symbolizer->tryAddingPcLoadReferenceComment(cStream, Value, Address); +} + +void MCDisassembler::setSymbolizer(std::unique_ptr<MCSymbolizer> Symzer) { + Symbolizer = std::move(Symzer); +} |