14 #ifndef LLVM_MC_MCCODEVIEW_H 15 #define LLVM_MC_MCCODEVIEW_H 26 class MCObjectStreamer;
28 class CodeViewContext;
37 uint16_t PrologueEnd : 1;
42 MCCVLoc(
unsigned functionid,
unsigned fileNum,
unsigned line,
unsigned column,
43 bool prologueend,
bool isstmt)
44 : FunctionId(functionid), FileNum(fileNum), Line(line), Column(column),
45 PrologueEnd(prologueend), IsStmt(isstmt) {}
63 bool isStmt()
const {
return IsStmt; }
71 void setLine(
unsigned line) { Line = line; }
75 assert(column <= UINT16_MAX);
118 unsigned ParentFuncIdPlusOne = 0;
120 enum :
unsigned { FunctionSentinel = ~0U };
147 return !isUnallocatedFunctionInfo() &&
148 ParentFuncIdPlusOne != FunctionSentinel;
152 assert(isInlinedCallSite());
153 return ParentFuncIdPlusOne - 1;
163 bool isValidFileNumber(
unsigned FileNumber)
const;
169 bool recordFunctionId(
unsigned FuncId);
175 bool recordInlinedCallSiteId(
unsigned FuncId,
unsigned IAFunc,
176 unsigned IAFile,
unsigned IALine,
187 unsigned Column,
bool PrologueEnd,
bool IsStmt) {
188 CurrentCVLoc.setFunctionId(FunctionId);
189 CurrentCVLoc.setFileNum(FileNo);
190 CurrentCVLoc.setLine(Line);
191 CurrentCVLoc.setColumn(Column);
192 CurrentCVLoc.setPrologueEnd(PrologueEnd);
193 CurrentCVLoc.setIsStmt(IsStmt);
202 bool isValidCVFileNumber(
unsigned FileNumber);
207 std::vector<MCCVLineEntry> getFunctionLineEntries(
unsigned FuncId);
209 std::pair<size_t, size_t> getLineExtent(
unsigned FuncId);
219 unsigned PrimaryFunctionId,
220 unsigned SourceFileId,
221 unsigned SourceLineNum,
231 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
252 bool CVLocSeen =
false;
259 bool InsertedStrTabFragment =
false;
264 unsigned getStringTableOffset(
StringRef S);
267 unsigned StringTableOffset;
271 bool Assigned =
false;
287 std::map<unsigned, std::pair<size_t, size_t>> MCCVLineStartStop;
290 std::vector<MCCVLineEntry> MCCVLines;
293 std::vector<MCCVFunctionInfo> Functions;
297 bool ChecksumOffsetsAssigned =
false;
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Instances of this class represent the information from a .cv_loc directive.
Compute iterated dominance frontiers using a linear time algorithm.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool isPrologueEnd() const
DenseMap< unsigned, LineInfo > InlinedAtMap
Map from inlined call site id to the inlined at location to use for that call site.
void setColumn(unsigned column)
Set the Column of this MCCVLoc.
Encapsulates the layout of an assembly file at a particular point in time.
unsigned getLine() const
Get the Line of this MCCVLoc.
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.
Streaming object file generation interface.
bool isInlinedCallSite() const
Returns true if this represents an inlined call site, meaning ParentFuncIdPlusOne is neither zero nor...
unsigned getParentFuncId() const
const MCCVLoc & getCurrentCVLoc()
friend class CodeViewContext
Streaming machine code generation interface.
void setFunctionId(unsigned FID)
void setFileNum(unsigned fileNum)
Set the FileNum of this MCCVLoc.
Fragment representing the .cv_def_range directive.
void setLine(unsigned line)
Set the Line of this MCCVLoc.
unsigned getFileNum() const
Get the FileNum of this MCCVLoc.
MCCVLineEntry(const MCSymbol *Label, const MCCVLoc loc)
Fragment representing the binary annotations produced by the .cv_inline_linetable directive...
static void addToStringTable(raw_ostream &Out, StringRef ArcName, const NewArchiveMember &M, bool Thin)
bool isUnallocatedFunctionInfo() const
Returns true if this is function info has not yet been used in a .cv_func_id or .cv_inline_site_id di...
void setPrologueEnd(bool PE)
Instances of this class represent the line information for the CodeView line table entries...
Fragment for data and encoded instructions.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const MCSymbol * getLabel() const
unsigned getColumn() const
Get the Column of this MCCVLoc.
StringRef - Represent a constant reference to a string, i.e.
Information describing a function or inlined call site introduced by .cv_func_id or ...
unsigned getFunctionId() const
Holds state from .cv_file and .cv_loc directives for later emission.