|
LLVM
7.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 | 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... | |
| bool | getCVLocSeen () |
| void | clearCVLocSeen () |
| 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... | |
| 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 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.
| bool CodeViewContext::addFile | ( | MCStreamer & | OS, |
| unsigned | FileNumber, | ||
| StringRef | Filename, | ||
| ArrayRef< uint8_t > | ChecksumBytes, | ||
| uint8_t | ChecksumKind | ||
| ) |
Definition at line 47 of file MCCodeView.cpp.
References addToStringTable(), assert(), llvm::lltok::ChecksumKind, llvm::MCContext::createTempSymbol(), llvm::StringRef::empty(), and llvm::MCStreamer::getContext().
Referenced by llvm::MCStreamer::EmitCVFileDirective().
| void CodeViewContext::addLineEntry | ( | const MCCVLineEntry & | LineEntry | ) |
Add a line entry.
Definition at line 258 of file MCCodeView.cpp.
References llvm::MCCVLoc::getFunctionId(), and I.
Referenced by llvm::MCCVLineEntry::Make().
Add something to the string table.
Returns the final string as well as offset into the string table.
Definition at line 140 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().
|
inline |
Definition at line 198 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 427 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 240 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 185 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(), llvm::ARMBuildAttrs::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 414 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 319 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 163 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 600 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, isPodLike< T >::value >::push_back(), llvm::SmallVectorBase::size(), llvm::StringRef::size(), and llvm::support::endian::Writer::write().
Referenced by llvm::MCAssembler::Finish().
| void CodeViewContext::encodeInlineLineTable | ( | MCAsmLayout & | Layout, |
| MCCVInlineLineTableFragment & | F | ||
| ) |
Encodes the binary annotations once we have a layout.
Definition at line 454 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::MCCVLineEntry::getLabel(), llvm::MCSymbol::getSection(), I, llvm::MCCVFunctionInfo::InlinedAtMap, llvm::MCCVFunctionInfo::LineInfo::Line, llvm_unreachable, llvm::max(), llvm::codeview::MaxRecordLength, llvm::MCCVLoc::setFileNum(), llvm::MCCVLoc::setLine(), and llvm::SmallVectorBase::size().
Referenced by llvm::MCAssembler::Finish().
Definition at line 200 of file MCCodeView.h.
References addToStringTable(), llvm::lltok::ChecksumKind, and F().
Referenced by llvm::MCCVLineEntry::Make().
| MCCVFunctionInfo * CodeViewContext::getCVFunctionInfo | ( | unsigned | FuncId | ) |
Retreive the function info if this is a valid function id, or nullptr.
Definition at line 79 of file MCCodeView.cpp.
Referenced by llvm::MCStreamer::EmitCVLocDirective().
|
inline |
Definition at line 197 of file MCCodeView.h.
Referenced by llvm::MCCVLineEntry::Make().
| std::vector< MCCVLineEntry > CodeViewContext::getFunctionLineEntries | ( | unsigned | FuncId | ) |
Definition at line 268 of file MCCodeView.cpp.
References I.
| std::pair< size_t, size_t > CodeViewContext::getLineExtent | ( | unsigned | FuncId | ) |
Definition at line 303 of file MCCodeView.cpp.
References I.
| ArrayRef< MCCVLineEntry > CodeViewContext::getLinesForExtent | ( | size_t | L, |
| size_t | R | ||
| ) |
Definition at line 311 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 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 87 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 100 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 186 of file MCCodeView.h.
Referenced by llvm::MCStreamer::EmitCVLocDirective().
1.8.13