LLVM API Documentation
00001 //===-- MCDisassembler.cpp - Disassembler interface -----------------------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #include "llvm/MC/MCDisassembler.h" 00011 #include "llvm/MC/MCExternalSymbolizer.h" 00012 #include "llvm/Support/raw_ostream.h" 00013 00014 using namespace llvm; 00015 00016 MCDisassembler::~MCDisassembler() { 00017 } 00018 00019 bool MCDisassembler::tryAddingSymbolicOperand(MCInst &Inst, int64_t Value, 00020 uint64_t Address, bool IsBranch, 00021 uint64_t Offset, 00022 uint64_t InstSize) const { 00023 raw_ostream &cStream = CommentStream ? *CommentStream : nulls(); 00024 if (Symbolizer) 00025 return Symbolizer->tryAddingSymbolicOperand(Inst, cStream, Value, Address, 00026 IsBranch, Offset, InstSize); 00027 return false; 00028 } 00029 00030 void MCDisassembler::tryAddingPcLoadReferenceComment(int64_t Value, 00031 uint64_t Address) const { 00032 raw_ostream &cStream = CommentStream ? *CommentStream : nulls(); 00033 if (Symbolizer) 00034 Symbolizer->tryAddingPcLoadReferenceComment(cStream, Value, Address); 00035 } 00036 00037 void MCDisassembler::setSymbolizer(std::unique_ptr<MCSymbolizer> Symzer) { 00038 Symbolizer = std::move(Symzer); 00039 }