LLVM  6.0.0svn
Classes | Public Member Functions | List of all members
llvm::CodeViewContext Class Reference

Holds state from .cv_file and .cv_loc directives for later emission. More...

#include "llvm/MC/MCCodeView.h"

Public Member Functions

 CodeViewContext ()
 
 ~CodeViewContext ()
 
bool isValidFileNumber (unsigned FileNumber) const
 This is a valid number for use with .cv_loc if we've already seen a .cv_file for it. More...
 
bool addFile (MCStreamer &OS, unsigned FileNumber, StringRef Filename, ArrayRef< uint8_t > ChecksumBytes, uint8_t ChecksumKind)
 
bool recordFunctionId (unsigned FuncId)
 Records the function id of a normal function. More...
 
bool recordInlinedCallSiteId (unsigned FuncId, unsigned IAFunc, unsigned IAFile, unsigned IALine, unsigned IACol)
 Records the function id of an inlined call site. More...
 
MCCVFunctionInfogetCVFunctionInfo (unsigned FuncId)
 Retreive the function info if this is a valid function id, or nullptr. More...
 
void setCurrentCVLoc (unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt)
 Saves the information from the currently parsed .cv_loc directive and sets CVLocSeen. More...
 
void clearCVLocSeen ()
 
bool getCVLocSeen ()
 
const MCCVLocgetCurrentCVLoc ()
 
bool isValidCVFileNumber (unsigned FileNumber)
 
void addLineEntry (const MCCVLineEntry &LineEntry)
 Add a line entry. More...
 
std::vector< MCCVLineEntrygetFunctionLineEntries (unsigned FuncId)
 
std::pair< size_t, size_tgetLineExtent (unsigned FuncId)
 
ArrayRef< MCCVLineEntrygetLinesForExtent (size_t L, size_t R)
 
void emitLineTableForFunction (MCObjectStreamer &OS, unsigned FuncId, const MCSymbol *FuncBegin, const MCSymbol *FuncEnd)
 Emits a line table substream. More...
 
void emitInlineLineTableForFunction (MCObjectStreamer &OS, unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
 
void encodeInlineLineTable (MCAsmLayout &Layout, MCCVInlineLineTableFragment &F)
 Encodes the binary annotations once we have a layout. More...
 
void emitDefRange (MCObjectStreamer &OS, ArrayRef< std::pair< const MCSymbol *, const MCSymbol *>> Ranges, StringRef FixedSizePortion)
 
void encodeDefRange (MCAsmLayout &Layout, MCCVDefRangeFragment &F)
 
void emitStringTable (MCObjectStreamer &OS)
 Emits the string table substream. More...
 
void emitFileChecksums (MCObjectStreamer &OS)
 Emits the file checksum substream. More...
 
void emitFileChecksumOffset (MCObjectStreamer &OS, unsigned FileNo)
 Emits the offset into the checksum table of the given file number. More...
 
std::pair< StringRef, unsignedaddToStringTable (StringRef S)
 Add something to the string table. More...
 

Detailed Description

Holds state from .cv_file and .cv_loc directives for later emission.

Definition at line 158 of file MCCodeView.h.

Constructor & Destructor Documentation

◆ CodeViewContext()

CodeViewContext::CodeViewContext ( )

Definition at line 30 of file MCCodeView.cpp.

◆ ~CodeViewContext()

CodeViewContext::~CodeViewContext ( )

Definition at line 32 of file MCCodeView.cpp.

Member Function Documentation

◆ addFile()

bool CodeViewContext::addFile ( MCStreamer OS,
unsigned  FileNumber,
StringRef  Filename,
ArrayRef< uint8_t >  ChecksumBytes,
uint8_t  ChecksumKind 
)

◆ addLineEntry()

void llvm::CodeViewContext::addLineEntry ( const MCCVLineEntry LineEntry)
inline

Add a line entry.

Definition at line 210 of file MCCodeView.h.

References llvm::MCCVLoc::getFunctionId(), and I.

Referenced by llvm::MCCVLineEntry::Make().

◆ addToStringTable()

std::pair< StringRef, unsigned > CodeViewContext::addToStringTable ( StringRef  S)

Add something to the string table.

Returns the final string as well as offset into the string table.

Definition at line 133 of file MCCodeView.cpp.

References llvm::SmallVectorImpl< T >::append(), assert(), llvm::StringRef::empty(), I, llvm::MipsISD::Ret, llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::codeview::StringTable.

Referenced by printFPOReg().

◆ clearCVLocSeen()

void llvm::CodeViewContext::clearCVLocSeen ( )
inline

Definition at line 202 of file MCCodeView.h.

Referenced by llvm::MCCVLineEntry::Make().

◆ emitDefRange()

void CodeViewContext::emitDefRange ( MCObjectStreamer OS,
ArrayRef< std::pair< const MCSymbol *, const MCSymbol *>>  Ranges,
StringRef  FixedSizePortion 
)

◆ emitFileChecksumOffset()

void CodeViewContext::emitFileChecksumOffset ( MCObjectStreamer OS,
unsigned  FileNo 
)

◆ emitFileChecksums()

void CodeViewContext::emitFileChecksums ( MCObjectStreamer OS)

◆ emitInlineLineTableForFunction()

void CodeViewContext::emitInlineLineTableForFunction ( MCObjectStreamer OS,
unsigned  PrimaryFunctionId,
unsigned  SourceFileId,
unsigned  SourceLineNum,
const MCSymbol FnStartSym,
const MCSymbol FnEndSym 
)

◆ emitLineTableForFunction()

void CodeViewContext::emitLineTableForFunction ( MCObjectStreamer OS,
unsigned  FuncId,
const MCSymbol FuncBegin,
const MCSymbol FuncEnd 
)

◆ emitStringTable()

void CodeViewContext::emitStringTable ( MCObjectStreamer OS)

◆ encodeDefRange()

void CodeViewContext::encodeDefRange ( MCAsmLayout Layout,
MCCVDefRangeFragment F 
)

◆ encodeInlineLineTable()

void CodeViewContext::encodeInlineLineTable ( MCAsmLayout Layout,
MCCVInlineLineTableFragment F 
)

◆ getCurrentCVLoc()

const MCCVLoc& llvm::CodeViewContext::getCurrentCVLoc ( )
inline

Definition at line 205 of file MCCodeView.h.

Referenced by llvm::MCCVLineEntry::Make().

◆ getCVFunctionInfo()

MCCVFunctionInfo* llvm::CodeViewContext::getCVFunctionInfo ( unsigned  FuncId)
inline

Retreive the function info if this is a valid function id, or nullptr.

Definition at line 180 of file MCCodeView.h.

Referenced by llvm::MCStreamer::EmitCVLocDirective().

◆ getCVLocSeen()

bool llvm::CodeViewContext::getCVLocSeen ( )
inline

Definition at line 204 of file MCCodeView.h.

Referenced by llvm::MCCVLineEntry::Make().

◆ getFunctionLineEntries()

std::vector<MCCVLineEntry> llvm::CodeViewContext::getFunctionLineEntries ( unsigned  FuncId)
inline

Definition at line 219 of file MCCodeView.h.

References llvm::WebAssembly::End, llvm::MCCVLoc::getFunctionId(), and I.

◆ getLineExtent()

std::pair<size_t, size_t> llvm::CodeViewContext::getLineExtent ( unsigned  FuncId)
inline

Definition at line 231 of file MCCodeView.h.

References I.

◆ getLinesForExtent()

ArrayRef<MCCVLineEntry> llvm::CodeViewContext::getLinesForExtent ( size_t  L,
size_t  R 
)
inline

◆ isValidCVFileNumber()

bool llvm::CodeViewContext::isValidCVFileNumber ( unsigned  FileNumber)

◆ isValidFileNumber()

bool CodeViewContext::isValidFileNumber ( unsigned  FileNumber) const

This is a valid number for use with .cv_loc if we've already seen a .cv_file for it.

Definition at line 41 of file MCCodeView.cpp.

◆ recordFunctionId()

bool CodeViewContext::recordFunctionId ( unsigned  FuncId)

Records the function id of a normal function.

Returns false if the function id has already been used, and true otherwise.

Definition at line 80 of file MCCodeView.cpp.

References llvm::MCCVFunctionInfo::FunctionSentinel.

Referenced by llvm::MCStreamer::EmitCVFuncIdDirective().

◆ recordInlinedCallSiteId()

bool CodeViewContext::recordInlinedCallSiteId ( unsigned  FuncId,
unsigned  IAFunc,
unsigned  IAFile,
unsigned  IALine,
unsigned  IACol 
)

Records the function id of an inlined call site.

Records the "inlined at" location info of the call site, including what function or inlined call site it was inlined into. Returns false if the function id has already been used, and true otherwise.

Definition at line 93 of file MCCodeView.cpp.

References llvm::MCCVFunctionInfo::LineInfo::Col, llvm::MCCVFunctionInfo::LineInfo::File, llvm::MCCVFunctionInfo::getParentFuncId(), llvm::MCCVFunctionInfo::InlinedAt, llvm::MCCVFunctionInfo::InlinedAtMap, llvm::MCCVFunctionInfo::isInlinedCallSite(), llvm::MCCVFunctionInfo::LineInfo::Line, and llvm::MCCVFunctionInfo::ParentFuncIdPlusOne.

Referenced by llvm::MCStreamer::EmitCVInlineSiteIdDirective().

◆ setCurrentCVLoc()

void llvm::CodeViewContext::setCurrentCVLoc ( unsigned  FunctionId,
unsigned  FileNo,
unsigned  Line,
unsigned  Column,
bool  PrologueEnd,
bool  IsStmt 
)
inline

Saves the information from the currently parsed .cv_loc directive and sets CVLocSeen.

When the next instruction is assembled an entry in the line number table with this information and the address of the instruction will be created.

Definition at line 192 of file MCCodeView.h.

Referenced by llvm::MCStreamer::EmitCVLocDirective().


The documentation for this class was generated from the following files: