|
LLVM
10.0.0
|
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... | |
| MCCVFunctionInfo * | getCVFunctionInfo (unsigned FuncId) |
| Retreive the function info if this is a valid function id, or nullptr. More... | |
| void | recordCVLoc (MCContext &Ctx, const MCSymbol *Label, 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... | |
| bool | isValidCVFileNumber (unsigned FileNumber) |
| void | addLineEntry (const MCCVLoc &LineEntry) |
| Add a line entry. More... | |
| std::vector< MCCVLoc > | getFunctionLineEntries (unsigned FuncId) |
| std::pair< size_t, size_t > | getLineExtent (unsigned FuncId) |
| ArrayRef< MCCVLoc > | getLinesForExtent (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... | |
| MCFragment * | 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, unsigned > | addToStringTable (StringRef S) |
| Add something to the string table. More... | |
Holds state from .cv_file and .cv_loc directives for later emission.
Definition at line 137 of file MCCodeView.h.
| CodeViewContext::CodeViewContext | ( | ) |
Definition at line 28 of file MCCodeView.cpp.
| CodeViewContext::~CodeViewContext | ( | ) |
Definition at line 30 of file MCCodeView.cpp.
| bool CodeViewContext::addFile | ( | MCStreamer & | OS, |
| unsigned | FileNumber, | ||
| StringRef | Filename, | ||
| ArrayRef< uint8_t > | ChecksumBytes, | ||
| uint8_t | ChecksumKind | ||
| ) |
Definition at line 46 of file MCCodeView.cpp.
References assert(), llvm::lltok::ChecksumKind, llvm::MCContext::createTempSymbol(), llvm::StringRef::empty(), and llvm::MCStreamer::getContext().
Referenced by llvm::MCStreamer::EmitCVFileDirective().
Add a line entry.
Definition at line 265 of file MCCodeView.cpp.
References llvm::MCCVLoc::getFunctionId(), and I.
Add something to the string table.
Returns the final string as well as offset into the string table.
Definition at line 147 of file MCCodeView.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), llvm::StringRef::empty(), I, llvm::MipsISD::Ret, llvm::SmallVectorBase::size(), and llvm::codeview::StringTable.
Referenced by printFPOReg().
| MCFragment * CodeViewContext::emitDefRange | ( | MCObjectStreamer & | OS, |
| ArrayRef< std::pair< const MCSymbol *, const MCSymbol *>> | Ranges, | ||
| StringRef | FixedSizePortion | ||
| ) |
Definition at line 434 of file MCCodeView.cpp.
References llvm::MCStreamer::getCurrentSectionOnly().
Referenced by llvm::MCObjectStreamer::EmitCVDefRangeDirective().
| void CodeViewContext::emitFileChecksumOffset | ( | MCObjectStreamer & | OS, |
| unsigned | FileNo | ||
| ) |
Emits the offset into the checksum table of the given file number.
Definition at line 247 of file MCCodeView.cpp.
References llvm::MCSymbolRefExpr::create(), llvm::MCStreamer::EmitSymbolValue(), llvm::MCObjectStreamer::EmitValueImpl(), and llvm::MCStreamer::getContext().
Referenced by llvm::MCObjectStreamer::EmitCVFileChecksumOffsetDirective().
| void CodeViewContext::emitFileChecksums | ( | MCObjectStreamer & | OS | ) |
Emits the file checksum substream.
Definition at line 192 of file MCCodeView.cpp.
References llvm::alignTo(), llvm::MCConstantExpr::create(), llvm::MCContext::createTempSymbol(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(), llvm::MCObjectStreamer::EmitAssignment(), llvm::MCObjectStreamer::EmitBytes(), llvm::MCStreamer::EmitIntValue(), llvm::MCObjectStreamer::EmitLabel(), llvm::MCObjectStreamer::EmitValueToAlignment(), File, llvm::codeview::FileChecksums, llvm::MCStreamer::getContext(), and llvm::toStringRef().
Referenced by llvm::MCObjectStreamer::EmitCVFileChecksumsDirective().
| void CodeViewContext::emitInlineLineTableForFunction | ( | MCObjectStreamer & | OS, |
| unsigned | PrimaryFunctionId, | ||
| unsigned | SourceFileId, | ||
| unsigned | SourceLineNum, | ||
| const MCSymbol * | FnStartSym, | ||
| const MCSymbol * | FnEndSym | ||
| ) |
Definition at line 421 of file MCCodeView.cpp.
References llvm::MCStreamer::getCurrentSectionOnly().
Referenced by llvm::MCObjectStreamer::EmitCVInlineLinetableDirective().
| void CodeViewContext::emitLineTableForFunction | ( | MCObjectStreamer & | OS, |
| unsigned | FuncId, | ||
| const MCSymbol * | FuncBegin, | ||
| const MCSymbol * | FuncEnd | ||
| ) |
Emits a line table substream.
Definition at line 326 of file MCCodeView.cpp.
References llvm::MCStreamer::AddComment(), llvm::any_of(), llvm::MCContext::createTempSymbol(), E, llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::EmitCOFFSecRel32(), llvm::MCStreamer::EmitCOFFSectionIndex(), llvm::MCObjectStreamer::EmitCVFileChecksumOffsetDirective(), llvm::MCStreamer::EmitIntValue(), llvm::MCObjectStreamer::EmitLabel(), llvm::find_if(), llvm::MCCVLoc::getColumn(), llvm::MCStreamer::getContext(), llvm::MCCVLoc::getFileNum(), I, llvm::codeview::LF_HaveColumns, llvm::codeview::Lines, and llvm::codeview::LineInfo::StatementFlag.
| void CodeViewContext::emitStringTable | ( | MCObjectStreamer & | OS | ) |
Emits the string table substream.
Definition at line 170 of file MCCodeView.cpp.
References llvm::MCContext::createTempSymbol(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::EmitIntValue(), llvm::MCObjectStreamer::EmitLabel(), llvm::MCObjectStreamer::EmitValueToAlignment(), llvm::MCStreamer::getContext(), llvm::MCObjectStreamer::insert(), and llvm::codeview::StringTable.
Referenced by llvm::MCObjectStreamer::EmitCVStringTableDirective().
| void CodeViewContext::encodeDefRange | ( | MCAsmLayout & | Layout, |
| MCCVDefRangeFragment & | F | ||
| ) |
Definition at line 608 of file MCCodeView.cpp.
References assert(), llvm::SmallVectorImpl< T >::clear(), computeLabelDiff(), llvm::MCFixup::create(), llvm::MCConstantExpr::create(), llvm::MCSymbolRefExpr::create(), llvm::MCBinaryExpr::createAdd(), E, llvm::MCExpr::evaluateAsRelocatable(), llvm::FK_SecRel_2, llvm::FK_SecRel_4, llvm::MCAsmLayout::getAssembler(), llvm::MCEncodedFragmentWithContents< ContentsSize >::getContents(), llvm::MCAssembler::getContext(), llvm::MCCVDefRangeFragment::getFixedSizePortion(), llvm::MCEncodedFragmentWithFixups< ContentsSize, FixupsSize >::getFixups(), llvm::MCCVDefRangeFragment::getRanges(), I, llvm::support::little, llvm::codeview::MaxDefRange, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorBase::size(), llvm::StringRef::size(), and llvm::support::endian::Writer::write().
Referenced by needPadding().
| void CodeViewContext::encodeInlineLineTable | ( | MCAsmLayout & | Layout, |
| MCCVInlineLineTableFragment & | F | ||
| ) |
Encodes the binary annotations once we have a layout.
Definition at line 461 of file MCCodeView.cpp.
References assert(), llvm::codeview::ChangeCodeLength, llvm::codeview::ChangeCodeOffset, llvm::codeview::ChangeCodeOffsetAndLineOffset, llvm::codeview::ChangeFile, llvm::codeview::ChangeLineOffset, llvm::SmallVectorImpl< T >::clear(), compressAnnotation(), computeLabelDiff(), llvm::ArrayRef< T >::empty(), encodeSignedNumber(), llvm::errs(), llvm::MCCVFunctionInfo::LineInfo::File, llvm::ArrayRef< T >::front(), llvm::MCCVInlineLineTableFragment::getContents(), llvm::MCCVInlineLineTableFragment::getFnEndSym(), llvm::MCCVInlineLineTableFragment::getFnStartSym(), llvm::MCCVLoc::getLabel(), llvm::MCSymbol::getSection(), I, llvm::MCCVFunctionInfo::InlinedAtMap, llvm::MCCVFunctionInfo::LineInfo::Line, llvm_unreachable, llvm::max(), llvm::codeview::MaxRecordLength, llvm::MCCVLoc::setFileNum(), llvm::MCCVLoc::setLabel(), llvm::MCCVLoc::setLine(), and llvm::SmallVectorBase::size().
Referenced by needPadding().
| MCCVFunctionInfo * CodeViewContext::getCVFunctionInfo | ( | unsigned | FuncId | ) |
Retreive the function info if this is a valid function id, or nullptr.
Definition at line 78 of file MCCodeView.cpp.
References FuncId.
Referenced by llvm::MCStreamer::checkCVLocSection().
Definition at line 275 of file MCCodeView.cpp.
References I.
| std::pair< size_t, size_t > CodeViewContext::getLineExtent | ( | unsigned | FuncId | ) |
Definition at line 310 of file MCCodeView.cpp.
References I.
Definition at line 318 of file MCCodeView.cpp.
References llvm::makeArrayRef(), and llvm::None.
This is a valid number for use with .cv_loc if we've already seen a .cv_file for it.
Definition at line 39 of file MCCodeView.cpp.
| void CodeViewContext::recordCVLoc | ( | MCContext & | Ctx, |
| const MCSymbol * | Label, | ||
| 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.
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 130 of file MCCodeView.cpp.
Referenced by llvm::MCObjectStreamer::EmitCVLocDirective().
Records the function id of a normal function.
Returns false if the function id has already been used, and true otherwise.
Definition at line 86 of file MCCodeView.cpp.
References FuncId, and llvm::MCCVFunctionInfo::FunctionSentinel.
Referenced by llvm::MCStreamer::EmitCVFuncIdDirective().
| 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 99 of file MCCodeView.cpp.
References llvm::MCCVFunctionInfo::LineInfo::Col, llvm::MCCVFunctionInfo::LineInfo::File, FuncId, llvm::MCCVFunctionInfo::getParentFuncId(), Info, llvm::MCCVFunctionInfo::InlinedAt, llvm::MCCVFunctionInfo::InlinedAtMap, llvm::MCCVFunctionInfo::isInlinedCallSite(), llvm::MCCVFunctionInfo::LineInfo::Line, and llvm::MCCVFunctionInfo::ParentFuncIdPlusOne.
Referenced by llvm::MCStreamer::EmitCVInlineSiteIdDirective().
1.8.13