LLVM  8.0.1
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 
12 #include <algorithm>
13 
14 using namespace llvm;
15 
17 
19  uint64_t Address, bool IsBranch,
20  uint64_t Offset,
21  uint64_t InstSize) const {
22  raw_ostream &cStream = CommentStream ? *CommentStream : nulls();
23  if (Symbolizer)
24  return Symbolizer->tryAddingSymbolicOperand(Inst, cStream, Value, Address,
25  IsBranch, Offset, InstSize);
26  return false;
27 }
28 
30  uint64_t Address) const {
31  raw_ostream &cStream = CommentStream ? *CommentStream : nulls();
32  if (Symbolizer)
33  Symbolizer->tryAddingPcLoadReferenceComment(cStream, Value, Address);
34 }
35 
36 void MCDisassembler::setSymbolizer(std::unique_ptr<MCSymbolizer> Symzer) {
37  Symbolizer = std::move(Symzer);
38 }
This class represents lattice values for constants.
Definition: AllocatorList.h:24
raw_ostream * CommentStream
bool tryAddingSymbolicOperand(MCInst &Inst, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize) const
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:161
void tryAddingPcLoadReferenceComment(int64_t Value, uint64_t Address) const
virtual ~MCDisassembler()
LLVM Value Representation.
Definition: Value.h:73
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:46