#include "llvm/MC/MCCodeView.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/Line.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/EndianStream.h"
usingnamespacellvm;
usingnamespacellvm::codeview;
CodeViewContext::~CodeViewContext() { … }
bool CodeViewContext::isValidFileNumber(unsigned FileNumber) const { … }
bool CodeViewContext::addFile(MCStreamer &OS, unsigned FileNumber,
StringRef Filename,
ArrayRef<uint8_t> ChecksumBytes,
uint8_t ChecksumKind) { … }
MCCVFunctionInfo *CodeViewContext::getCVFunctionInfo(unsigned FuncId) { … }
bool CodeViewContext::recordFunctionId(unsigned FuncId) { … }
bool CodeViewContext::recordInlinedCallSiteId(unsigned FuncId, unsigned IAFunc,
unsigned IAFile, unsigned IALine,
unsigned IACol) { … }
void CodeViewContext::recordCVLoc(MCContext &Ctx, const MCSymbol *Label,
unsigned FunctionId, unsigned FileNo,
unsigned Line, unsigned Column,
bool PrologueEnd, bool IsStmt) { … }
MCDataFragment *CodeViewContext::getStringTableFragment() { … }
std::pair<StringRef, unsigned> CodeViewContext::addToStringTable(StringRef S) { … }
unsigned CodeViewContext::getStringTableOffset(StringRef S) { … }
void CodeViewContext::emitStringTable(MCObjectStreamer &OS) { … }
void CodeViewContext::emitFileChecksums(MCObjectStreamer &OS) { … }
void CodeViewContext::emitFileChecksumOffset(MCObjectStreamer &OS,
unsigned FileNo) { … }
void CodeViewContext::addLineEntry(const MCCVLoc &LineEntry) { … }
std::vector<MCCVLoc>
CodeViewContext::getFunctionLineEntries(unsigned FuncId) { … }
std::pair<size_t, size_t> CodeViewContext::getLineExtent(unsigned FuncId) { … }
std::pair<size_t, size_t>
CodeViewContext::getLineExtentIncludingInlinees(unsigned FuncId) { … }
ArrayRef<MCCVLoc> CodeViewContext::getLinesForExtent(size_t L, size_t R) { … }
void CodeViewContext::emitLineTableForFunction(MCObjectStreamer &OS,
unsigned FuncId,
const MCSymbol *FuncBegin,
const MCSymbol *FuncEnd) { … }
static bool compressAnnotation(uint32_t Data, SmallVectorImpl<char> &Buffer) { … }
static bool compressAnnotation(BinaryAnnotationsOpCode Annotation,
SmallVectorImpl<char> &Buffer) { … }
static uint32_t encodeSignedNumber(uint32_t Data) { … }
void CodeViewContext::emitInlineLineTableForFunction(MCObjectStreamer &OS,
unsigned PrimaryFunctionId,
unsigned SourceFileId,
unsigned SourceLineNum,
const MCSymbol *FnStartSym,
const MCSymbol *FnEndSym) { … }
MCFragment *CodeViewContext::emitDefRange(
MCObjectStreamer &OS,
ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
StringRef FixedSizePortion) { … }
static unsigned computeLabelDiff(const MCAssembler &Asm, const MCSymbol *Begin,
const MCSymbol *End) { … }
void CodeViewContext::encodeInlineLineTable(const MCAssembler &Asm,
MCCVInlineLineTableFragment &Frag) { … }
void CodeViewContext::encodeDefRange(const MCAssembler &Asm,
MCCVDefRangeFragment &Frag) { … }