|
LLVM
4.0.0
|
Holds state from .cv_file and .cv_loc directives for later emission. More...
#include <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 (unsigned FileNumber, StringRef Filename) |
| ArrayRef< StringRef > | getFilenames () |
| 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 | 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 MCCVLoc & | getCurrentCVLoc () |
| bool | isValidCVFileNumber (unsigned FileNumber) |
| void | addLineEntry (const MCCVLineEntry &LineEntry) |
| Add a line entry. More... | |
| std::vector< MCCVLineEntry > | getFunctionLineEntries (unsigned FuncId) |
| std::pair< size_t, size_t > | getLineExtent (unsigned FuncId) |
| ArrayRef< MCCVLineEntry > | 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... | |
| 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... | |
Holds state from .cv_file and .cv_loc directives for later emission.
Definition at line 158 of file MCCodeView.h.
| CodeViewContext::CodeViewContext | ( | ) |
Definition at line 29 of file MCCodeView.cpp.
| CodeViewContext::~CodeViewContext | ( | ) |
Definition at line 31 of file MCCodeView.cpp.
Definition at line 47 of file MCCodeView.cpp.
References assert(), and llvm::StringRef::empty().
Referenced by llvm::MCStreamer::EmitCVFileDirective().
|
inline |
Add a line entry.
Definition at line 210 of file MCCodeView.h.
References llvm::MCCVLoc::getFunctionId(), I, and Offset.
Referenced by llvm::MCCVLineEntry::Make().
|
inline |
Definition at line 202 of file MCCodeView.h.
Referenced by llvm::MCCVLineEntry::Make().
| void CodeViewContext::emitDefRange | ( | MCObjectStreamer & | OS, |
| ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> | Ranges, | ||
| StringRef | FixedSizePortion | ||
| ) |
Definition at line 297 of file MCCodeView.cpp.
References llvm::MCStreamer::getCurrentSectionOnly().
Referenced by llvm::MCObjectStreamer::EmitCVDefRangeDirective().
| void CodeViewContext::emitFileChecksums | ( | MCObjectStreamer & | OS | ) |
Emits the file checksum substream.
Definition at line 165 of file MCCodeView.cpp.
References llvm::MCContext::createTempSymbol(), llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::EmitIntValue(), llvm::MCObjectStreamer::EmitLabel(), llvm::codeview::FileChecksums, and llvm::MCStreamer::getContext().
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 284 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 192 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::MCStreamer::EmitIntValue(), llvm::MCObjectStreamer::EmitLabel(), llvm::find_if(), llvm::MCCVLoc::getColumn(), llvm::MCStreamer::getContext(), llvm::MCCVLoc::getFileNum(), llvm::codeview::HaveColumns, I, llvm::codeview::Lines, and llvm::codeview::LineInfo::StatementFlag.
Referenced by llvm::MCObjectStreamer::EmitCVLinetableDirective().
| void CodeViewContext::emitStringTable | ( | MCObjectStreamer & | OS | ) |
Emits the string table substream.
Definition at line 143 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 456 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::codeview::MaxDefRange, fuzzer::min(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::StringRef::size(), and llvm::support::endian::Writer< endian >::write().
| void CodeViewContext::encodeInlineLineTable | ( | MCAsmLayout & | Layout, |
| MCCVInlineLineTableFragment & | F | ||
| ) |
Encodes the binary annotations once we have a layout.
Definition at line 324 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::MCCVFunctionInfo::LineInfo::File, llvm::ArrayRef< T >::front(), llvm::MCCVInlineLineTableFragment::getContents(), llvm::MCCVInlineLineTableFragment::getFnEndSym(), llvm::MCCVInlineLineTableFragment::getFnStartSym(), llvm::MCCVLineEntry::getLabel(), llvm::MCSymbol::getSection(), I, llvm::MCCVFunctionInfo::InlinedAtMap, llvm::MCCVFunctionInfo::LineInfo::Line, llvm::codeview::MaxRecordLength, fuzzer::min(), llvm::MCCVLoc::setFileNum(), llvm::MCCVLoc::setLine(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Definition at line 205 of file MCCodeView.h.
Referenced by llvm::MCCVLineEntry::Make().
|
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().
|
inline |
Definition at line 204 of file MCCodeView.h.
Referenced by llvm::MCCVLineEntry::Make().
Definition at line 165 of file MCCodeView.h.
|
inline |
Definition at line 219 of file MCCodeView.h.
References llvm::WebAssembly::End, and I.
|
inline |
Definition at line 231 of file MCCodeView.h.
References I.
|
inline |
Definition at line 239 of file MCCodeView.h.
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 40 of file MCCodeView.cpp.
Records the function id of a normal function.
Returns false if the function id has already been used, and true otherwise.
Definition at line 68 of file MCCodeView.cpp.
References 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 81 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().
|
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.
References llvm::MCCVLoc::setColumn(), llvm::MCCVLoc::setFileNum(), llvm::MCCVLoc::setFunctionId(), llvm::MCCVLoc::setIsStmt(), llvm::MCCVLoc::setLine(), and llvm::MCCVLoc::setPrologueEnd().
Referenced by llvm::MCStreamer::EmitCVLocDirective().
1.8.6