1 //===- MCDisassembler.cpp - Disassembler interface ------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCDisassembler/MCDisassembler.h"
11 #include "llvm/Support/raw_ostream.h"
16 MCDisassembler::~MCDisassembler() = default;
18 bool MCDisassembler::tryAddingSymbolicOperand(MCInst &Inst, int64_t Value,
19 uint64_t Address, bool IsBranch,
21 uint64_t InstSize) const {
22 raw_ostream &cStream = CommentStream ? *CommentStream : nulls();
24 return Symbolizer->tryAddingSymbolicOperand(Inst, cStream, Value, Address,
25 IsBranch, Offset, InstSize);
29 void MCDisassembler::tryAddingPcLoadReferenceComment(int64_t Value,
30 uint64_t Address) const {
31 raw_ostream &cStream = CommentStream ? *CommentStream : nulls();
33 Symbolizer->tryAddingPcLoadReferenceComment(cStream, Value, Address);
36 void MCDisassembler::setSymbolizer(std::unique_ptr<MCSymbolizer> Symzer) {
37 Symbolizer = std::move(Symzer);