LLVM  3.7.0
MCDisassembler.cpp
Go to the documentation of this file.
1 //===-- MCDisassembler.cpp - Disassembler interface -----------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "llvm/MC/MCDisassembler.h"
13 
14 using namespace llvm;
15 
17 }
18 
20  uint64_t Address, bool IsBranch,
21  uint64_t Offset,
22  uint64_t InstSize) const {
23  raw_ostream &cStream = CommentStream ? *CommentStream : nulls();
24  if (Symbolizer)
25  return Symbolizer->tryAddingSymbolicOperand(Inst, cStream, Value, Address,
26  IsBranch, Offset, InstSize);
27  return false;
28 }
29 
31  uint64_t Address) const {
32  raw_ostream &cStream = CommentStream ? *CommentStream : nulls();
33  if (Symbolizer)
34  Symbolizer->tryAddingPcLoadReferenceComment(cStream, Value, Address);
35 }
36 
37 void MCDisassembler::setSymbolizer(std::unique_ptr<MCSymbolizer> Symzer) {
38  Symbolizer = std::move(Symzer);
39 }
raw_ostream * CommentStream
void setSymbolizer(std::unique_ptr< MCSymbolizer > Symzer)
Set Symzer as the current symbolizer.
std::unique_ptr< MCSymbolizer > Symbolizer
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:150
bool tryAddingSymbolicOperand(MCInst &Inst, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize) const
LLVM Value Representation.
Definition: Value.h:69
raw_ostream & nulls()
This returns a reference to a raw_ostream which simply discards output.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:38
void tryAddingPcLoadReferenceComment(int64_t Value, uint64_t Address) const