LLVM
8.0.1
|
#include "Disassembler.h"
#include "llvm-c/Disassembler.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Triple.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCDisassembler/MCRelocationInfo.h"
#include "llvm/MC/MCDisassembler/MCSymbolizer.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCInstrItineraries.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSchedule.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstddef>
#include <cstring>
Go to the source code of this file.
Functions | |
LLVMDisasmContextRef | LLVMCreateDisasmCPUFeatures (const char *TT, const char *CPU, const char *Features, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp) |
Create a disassembler for the TripleName, a specific CPU and specific feature string. More... | |
LLVMDisasmContextRef | LLVMCreateDisasmCPU (const char *TT, const char *CPU, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp) |
Create a disassembler for the TripleName and a specific CPU. More... | |
LLVMDisasmContextRef | LLVMCreateDisasm (const char *TT, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp) |
Create a disassembler for the TripleName. More... | |
void | LLVMDisasmDispose (LLVMDisasmContextRef DCR) |
Dispose of a disassembler context. More... | |
static void | emitComments (LLVMDisasmContext *DC, formatted_raw_ostream &FormattedOS) |
Emits the comments that are stored in DC comment stream. More... | |
static int | getItineraryLatency (LLVMDisasmContext *DC, const MCInst &Inst) |
Gets latency information for Inst from the itinerary scheduling model, based on DC information. More... | |
static int | getLatency (LLVMDisasmContext *DC, const MCInst &Inst) |
Gets latency information for Inst , based on DC information. More... | |
static void | emitLatency (LLVMDisasmContext *DC, const MCInst &Inst) |
Emits latency information in DC->CommentStream for Inst , based on the information available in DC . More... | |
size_t | LLVMDisasmInstruction (LLVMDisasmContextRef DCR, uint8_t *Bytes, uint64_t BytesSize, uint64_t PC, char *OutString, size_t OutStringSize) |
Disassemble a single instruction using the disassembler context specified in the parameter DC. More... | |
int | LLVMSetDisasmOptions (LLVMDisasmContextRef DCR, uint64_t Options) |
Set the disassembler's options. More... | |
|
static |
Emits the comments that are stored in DC
comment stream.
Each comment in the comment stream must end with a newline.
Definition at line 135 of file Disassembler.cpp.
References llvm::SmallVectorImpl< T >::clear(), llvm::LLVMDisasmContext::CommentsToEmit, llvm::StringRef::empty(), llvm::StringRef::find(), llvm::raw_ostream::flush(), llvm::LLVMDisasmContext::getAsmInfo(), llvm::MCAsmInfo::getCommentColumn(), llvm::MCAsmInfo::getCommentString(), llvm::formatted_raw_ostream::PadToColumn(), llvm::SmallString< InternalLen >::str(), and llvm::StringRef::substr().
Referenced by LLVMDisasmInstruction().
|
static |
Emits latency information in DC->CommentStream for Inst
, based on the information available in DC
.
Definition at line 226 of file Disassembler.cpp.
References llvm::LLVMDisasmContext::CommentStream, getLatency(), and llvm::Latency.
Referenced by LLVMDisasmInstruction().
|
static |
Gets latency information for Inst
from the itinerary scheduling model, based on DC
information.
Definition at line 165 of file Disassembler.cpp.
References llvm::StringRef::empty(), llvm::MCInstrInfo::get(), llvm::LLVMDisasmContext::getCPU(), llvm::LLVMDisasmContext::getInstrInfo(), llvm::MCSubtargetInfo::getInstrItineraryForCPU(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOpcode(), llvm::InstrItineraryData::getOperandCycle(), llvm::MCInstrDesc::getSchedClass(), llvm::LLVMDisasmContext::getSubtargetInfo(), llvm::Latency, and llvm::max().
Referenced by getLatency().
|
static |
Gets latency information for Inst
, based on DC
information.
Definition at line 190 of file Disassembler.cpp.
References llvm::MCWriteLatencyEntry::Cycles, llvm::MCInstrInfo::get(), llvm::LLVMDisasmContext::getInstrInfo(), getItineraryLatency(), llvm::MCInst::getOpcode(), llvm::MCInstrDesc::getSchedClass(), llvm::MCSchedModel::getSchedClassDesc(), llvm::MCSubtargetInfo::getSchedModel(), llvm::LLVMDisasmContext::getSubtargetInfo(), llvm::MCSubtargetInfo::getWriteLatencyEntry(), llvm::MCSchedModel::hasInstrSchedModel(), llvm::MCSchedClassDesc::isValid(), llvm::MCSchedClassDesc::isVariant(), llvm::Latency, llvm::max(), and llvm::MCSchedClassDesc::NumWriteLatencyEntries.
Referenced by llvm::mca::WriteState::dump(), llvm::SDep::dump(), emitLatency(), llvm::mca::Instruction::execute(), getCombinerObjective(), llvm::mca::WriteState::onInstructionIssued(), and llvm::mca::Instruction::update().