86 #define DEBUG_TYPE "dwarfdebug" 88 STATISTIC(NumCSParams,
"Number of dbg call site params created");
92 cl::desc(
"Disable debug info printing"));
95 "use-dwarf-ranges-base-address-specifier",
cl::Hidden,
105 cl::desc(
"Generate DWARF4 type units."),
109 "split-dwarf-cross-cu-references",
cl::Hidden,
116 cl::desc(
"Make an absence of debug location information explicit."),
124 "Default for platform"),
132 cl::desc(
"Use inlined strings rather than string section."),
140 cl::desc(
"Disable emission .debug_ranges section."),
145 cl::desc(
"Use sections+offset as references rather than labels."),
158 cl::desc(
"Which DWARF linkage-name attributes to emit."),
160 "Default for platform"),
163 "Abstract subprograms")),
172 void DebugLocDwarfExpression::emitOp(uint8_t
Op,
const char *Comment) {
178 void DebugLocDwarfExpression::emitSigned(int64_t
Value) {
182 void DebugLocDwarfExpression::emitUnsigned(uint64_t Value) {
186 void DebugLocDwarfExpression::emitData1(uint8_t Value) {
190 void DebugLocDwarfExpression::emitBaseTypeRef(uint64_t Idx) {
191 assert(Idx < (1ULL << (ULEB128PadSize * 7)) &&
"Idx wont fit");
196 unsigned MachineReg) {
201 void DebugLocDwarfExpression::enableTemporaryBuffer() {
202 assert(!IsBuffering &&
"Already buffering?");
208 void DebugLocDwarfExpression::disableTemporaryBuffer() { IsBuffering =
false; }
210 unsigned DebugLocDwarfExpression::getTemporaryBufferSize() {
211 return TmpBuf ? TmpBuf->Bytes.size() : 0;
214 void DebugLocDwarfExpression::commitTemporaryBuffer() {
217 for (
auto Byte :
enumerate(TmpBuf->Bytes)) {
218 const char *Comment = (Byte.index() < TmpBuf->Comments.size())
219 ? TmpBuf->Comments[Byte.index()].c_str()
221 OutBS.
EmitInt8(Byte.value(), Comment);
223 TmpBuf->Bytes.clear();
224 TmpBuf->Comments.clear();
228 return getVariable()->getType();
240 assert((!Op1.isImm() || (Op1.getImm() == 0)) &&
"unexpected offset");
260 assert(FrameIndexExprs.empty() &&
"Already initialized?");
261 assert(!ValueLoc.get() &&
"Already initialized?");
269 if (
E->getNumElements())
270 FrameIndexExprs.push_back({0, E});
274 if (FrameIndexExprs.size() == 1)
275 return FrameIndexExprs;
278 [](
const FrameIndexExpr &A) {
279 return A.Expr->isFragment();
281 "multiple FI expressions without DW_OP_LLVM_fragment");
283 [](
const FrameIndexExpr &A,
const FrameIndexExpr &
B) ->
bool {
284 return A.Expr->getFragmentInfo()->OffsetInBits <
285 B.Expr->getFragmentInfo()->OffsetInBits;
288 return FrameIndexExprs;
292 assert(DebugLocListIndex == ~0U && !ValueLoc.get() &&
"not an MMI entry");
293 assert(V.DebugLocListIndex == ~0U && !V.ValueLoc.get() &&
"not an MMI entry");
297 assert(!FrameIndexExprs.empty() &&
"Expected an MMI entry");
298 assert(!V.FrameIndexExprs.
empty() &&
"Expected an MMI entry");
304 if (FrameIndexExprs.size()) {
305 auto *Expr = FrameIndexExprs.back().Expr;
306 if (!Expr || !Expr->isFragment())
310 for (
const auto &FIE : V.FrameIndexExprs)
313 return FIE.FI == Other.FI && FIE.Expr == Other.Expr;
315 FrameIndexExprs.push_back(FIE);
317 assert((FrameIndexExprs.size() == 1 ||
319 [](FrameIndexExpr &FIE) {
320 return FIE.Expr && FIE.Expr->isFragment();
322 "conflicting locations for variable");
326 bool GenerateTypeUnits,
334 if (GenerateTypeUnits)
340 if (DwarfVersion >= 5)
350 InfoHolder(A,
"info_string", DIEValueAllocator),
351 SkeletonHolder(A,
"skel_string", DIEValueAllocator),
352 IsDarwin(A->
TM.getTargetTriple().isOSDarwin()) {
366 if (DwarfInlinedStrings ==
Default)
367 UseInlineStrings = TT.
isNVPTX();
369 UseInlineStrings = DwarfInlinedStrings ==
Enable;
385 unsigned DwarfVersion = DwarfVersionNumber ? DwarfVersionNumber
391 UseRangesSection = !NoDwarfRangesSection && !TT.
isNVPTX();
394 if (DwarfSectionsAsReferences ==
Default)
395 UseSectionsAsReferences = TT.
isNVPTX();
397 UseSectionsAsReferences = DwarfSectionsAsReferences ==
Enable;
411 UseGNUTLSOpcode =
tuneForGDB() || DwarfVersion < 3;
414 UseDWARF2Bitfields = (DwarfVersion < 4) ||
tuneForGDB();
420 UseSegmentedStringOffsetsTable = DwarfVersion >= 5;
462 if (!SP->isDefinition())
471 if (SP->getLinkageName() !=
"" && SP->
getName() != SP->getLinkageName() &&
499 if (Ranges.
size() > 1)
518 void DwarfDebug::constructAbstractSubprogramScopeDIE(
DwarfCompileUnit &SrcCU,
532 auto &
CU = getOrCreateDwarfCompileUnit(SP->getUnit());
533 if (
auto *SkelCU =
CU.getSkeleton()) {
535 .constructAbstractSubprogramScopeDIE(Scope);
536 if (
CU.getCUNode()->getSplitDebugInlining())
537 SkelCU->constructAbstractSubprogramScopeDIE(Scope);
539 CU.constructAbstractSubprogramScopeDIE(Scope);
547 auto *MF = CallMI->
getMF();
549 auto CallFwdRegsInfo = CalleesMap.
find(CallMI);
552 if (CallFwdRegsInfo == CalleesMap.end())
556 const auto &TRI = MF->getSubtarget().getRegisterInfo();
557 const auto &
TII = MF->getSubtarget().getInstrInfo();
558 const auto &TLI = MF->getSubtarget().getTargetLowering();
565 for (
auto ArgReg : CallFwdRegsInfo->second) {
566 bool InsertedReg = ForwardedRegWorklist.
insert(ArgReg.Reg).second;
567 assert(InsertedReg &&
"Single register used to forward two arguments?");
581 bool ShouldTryEmitEntryVals = MBB->getIterator() == MF->begin();
595 if (MO.isReg() && MO.isDef() &&
597 for (
auto FwdReg : ForwardedRegWorklist) {
602 Explicit.push_back(FwdReg);
609 auto finishCallSiteParam = [&](
DbgValueLoc DbgLocVal,
unsigned Reg) {
610 unsigned FwdReg =
Reg;
611 if (ShouldTryEmitEntryVals) {
612 auto EntryValReg = RegsForEntryValues.
find(
Reg);
613 if (EntryValReg != RegsForEntryValues.
end())
614 FwdReg = EntryValReg->second;
623 for (;
I != MBB->rend(); ++
I) {
633 if (ForwardedRegWorklist.empty())
638 getForwardingRegsDefinedByMI(*
I, ExplicitFwdRegDefs, ImplicitFwdRegDefs);
639 if (ExplicitFwdRegDefs.
empty() && ImplicitFwdRegDefs.
empty())
644 for (
auto Reg : concat<unsigned>(ExplicitFwdRegDefs, ImplicitFwdRegDefs))
645 ForwardedRegWorklist.erase(
Reg);
647 for (
auto ParamFwdReg : ExplicitFwdRegDefs) {
648 if (
auto ParamValue =
TII->describeLoadedValue(*
I, ParamFwdReg)) {
649 if (ParamValue->first.isImm()) {
650 int64_t Val = ParamValue->first.getImm();
652 finishCallSiteParam(DbgLocVal, ParamFwdReg);
653 }
else if (ParamValue->first.isReg()) {
654 Register RegLoc = ParamValue->first.getReg();
657 if (ParamFwdReg == RegLoc)
660 unsigned SP = TLI->getStackPointerRegisterToSaveRestore();
662 bool IsSPorFP = (RegLoc == SP) || (RegLoc == FP);
667 finishCallSiteParam(DbgLocVal, ParamFwdReg);
669 }
else if (ShouldTryEmitEntryVals &&
670 ParamValue->second->getNumElements() == 0) {
671 ForwardedRegWorklist.insert(RegLoc);
672 RegsForEntryValues[RegLoc] = ParamFwdReg;
680 if (ShouldTryEmitEntryVals) {
684 for (
auto RegEntry : ForwardedRegWorklist) {
685 unsigned FwdReg = RegEntry;
686 auto EntryValReg = RegsForEntryValues.
find(RegEntry);
687 if (EntryValReg != RegsForEntryValues.
end())
688 FwdReg = EntryValReg->second;
698 void DwarfDebug::constructCallSiteEntryDIEs(
const DISubprogram &
SP,
703 if (!SP.areAllCallsDescribed() || !SP.isDefinition())
713 assert(TII &&
"TargetInstrInfo not found: cannot label tail calls");
731 if (
MI.hasDelaySlot())
741 unsigned CallReg = 0;
743 const Function *CalleeDecl =
nullptr;
744 if (CalleeOp.
isReg()) {
745 CallReg = CalleeOp.
getReg();
782 assert((IsTail || PCOffset || PCAddr) &&
783 "Call without return PC information");
786 << (CalleeDecl ? CalleeDecl->
getName()
790 << (IsTail ?
" [IsTail]" :
"") <<
"\n");
812 U.
addFlag(D, dwarf::DW_AT_GNU_pubnames);
815 void DwarfDebug::finishUnitAttributes(
const DICompileUnit *DIUnit,
823 std::string ProducerWithFlags = Producer.
str() +
" " + Flags.
str();
824 NewCU.
addString(Die, dwarf::DW_AT_producer, ProducerWithFlags);
826 NewCU.
addString(Die, dwarf::DW_AT_producer, Producer);
828 NewCU.
addUInt(Die, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
830 NewCU.
addString(Die, dwarf::DW_AT_name, FN);
841 if (!CompilationDir.
empty())
842 NewCU.
addString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
844 addGnuPubAttributes(NewCU, Die);
849 NewCU.
addFlag(Die, dwarf::DW_AT_APPLE_optimized);
853 NewCU.
addString(Die, dwarf::DW_AT_APPLE_flags, Flags);
856 NewCU.
addUInt(Die, dwarf::DW_AT_APPLE_major_runtime_vers,
857 dwarf::DW_FORM_data1, RVer);
862 NewCU.
addUInt(Die, dwarf::DW_AT_GNU_dwo_id, dwarf::DW_FORM_data8,
867 ? dwarf::DW_AT_dwo_name
868 : dwarf::DW_AT_GNU_dwo_name;
876 DwarfDebug::getOrCreateDwarfCompileUnit(
const DICompileUnit *DIUnit) {
877 if (
auto *CU = CUMap.lookup(DIUnit))
882 auto OwnedUnit = std::make_unique<DwarfCompileUnit>(
883 InfoHolder.
getUnits().size(), DIUnit,
Asm,
this, &InfoHolder);
885 InfoHolder.
addUnit(std::move(OwnedUnit));
888 NewCU.addImportedEntity(
IE);
894 if (!Asm->OutStreamer->hasRawTextSupport() || SingleCU)
895 Asm->OutStreamer->emitDwarfFile0Directive(
898 NewCU.getUniqueID());
901 NewCU.setSkeleton(constructSkeletonCU(NewCU));
902 NewCU.setSection(Asm->getObjFileLowering().getDwarfInfoDWOSection());
904 finishUnitAttributes(DIUnit, NewCU);
905 NewCU.setSection(Asm->getObjFileLowering().getDwarfInfoSection());
910 if (
auto *SP = dyn_cast_or_null<DISubprogram>(Scope))
911 NewCU.getOrCreateSubprogramDIE(SP);
913 CUMap.insert({DIUnit, &NewCU});
914 CUDieMap.insert({&NewCU.getUnitDie(), &NewCU});
920 if (isa<DILocalScope>(N->
getScope()))
940 if (!FragmentA || !FragmentB)
942 return FragmentA->OffsetInBits < FragmentB->OffsetInBits;
970 "DebugInfoAvailabilty initialized unexpectedly");
971 SingleCU = NumDebugCUs == 1;
976 Global.getDebugInfo(GVs);
977 for (
auto *GVE : GVs)
978 GVMap[GVE->getVariable()].push_back({&Global, GVE->getExpression()});
1012 return !isa<DILocalScope>(
IE->getScope());
1015 if (!HasNonLocalImportedEntities && CUNode->getEnumTypes().empty() &&
1016 CUNode->getRetainedTypes().empty() &&
1017 CUNode->getGlobalVariables().empty() && CUNode->getMacros().empty())
1023 for (
auto *GVE : CUNode->getGlobalVariables()) {
1027 auto &GVMapEntry = GVMap[GVE->getVariable()];
1028 auto *Expr = GVE->getExpression();
1029 if (!GVMapEntry.size() || (Expr && Expr->isConstant()))
1030 GVMapEntry.push_back({
nullptr, Expr});
1033 for (
auto *GVE : CUNode->getGlobalVariables()) {
1035 if (Processed.
insert(GV).second)
1039 for (
auto *Ty : CUNode->getEnumTypes()) {
1044 for (
auto *Ty : CUNode->getRetainedTypes()) {
1047 if (
DIType *RT = dyn_cast<DIType>(Ty))
1053 for (
auto *
IE : CUNode->getImportedEntities())
1054 constructAndAddImportedEntityDIE(CU,
IE);
1058 void DwarfDebug::finishEntityDefinitions() {
1059 for (
const auto &Entity : ConcreteEntities) {
1060 DIE *Die = Entity->getDIE();
1071 void DwarfDebug::finishSubprogramDefinitions() {
1075 getOrCreateDwarfCompileUnit(SP->getUnit()),
1080 void DwarfDebug::finalizeModuleInfo() {
1083 finishSubprogramDefinitions();
1085 finishEntityDefinitions();
1091 if (CUMap.size() > 1)
1096 for (
const auto &
P : CUMap) {
1097 auto &TheCU = *
P.second;
1113 ? dwarf::DW_AT_dwo_name
1114 : dwarf::DW_AT_GNU_dwo_name;
1115 finishUnitAttributes(TheCU.
getCUNode(), TheCU);
1118 SkCU->addString(SkCU->getUnitDie(), attrDWOName,
1128 dwarf::DW_FORM_data8,
ID);
1129 SkCU->addUInt(SkCU->getUnitDie(), dwarf::DW_AT_GNU_dwo_id,
1130 dwarf::DW_FORM_data8,
ID);
1135 SkCU->addSectionLabel(SkCU->getUnitDie(), dwarf::DW_AT_GNU_ranges_base,
1139 finishUnitAttributes(SkCU->getCUNode(), *SkCU);
1150 if (
unsigned NumRanges = TheCU.
getRanges().size()) {
1156 U.
addUInt(U.getUnitDie(), dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, 0);
1158 U.setBaseAddress(TheCU.
getRanges().front().Begin);
1159 U.attachRangesOrLowHighPC(U.getUnitDie(), TheCU.
takeRanges());
1166 U.addAddrTableBase();
1169 if (U.hasRangeLists())
1170 U.addRnglistsBase();
1172 if (!DebugLocs.
getLists().empty()) {
1174 U.addSectionLabel(U.getUnitDie(), dwarf::DW_AT_loclists_base,
1180 auto *CUNode = cast<DICompileUnit>(
P.first);
1182 if (CUNode->getMacros()) {
1185 U.getMacroLabelBegin(),
1188 U.addSectionLabel(U.getUnitDie(), dwarf::DW_AT_macro_info,
1189 U.getMacroLabelBegin(),
1196 if (CUNode->getDWOId())
1197 getOrCreateDwarfCompileUnit(CUNode);
1207 assert(CurFn ==
nullptr);
1210 for (
const auto &
P : CUMap) {
1211 auto &CU = *
P.second;
1222 finalizeModuleInfo();
1234 emitAbbreviations();
1248 emitDebugMacinfoDWO();
1256 emitDebugAbbrevDWO();
1258 emitDebugRangesDWO();
1268 emitAccelNamespaces();
1272 emitAccelDebugNames();
1281 emitDebugPubSections();
1289 const MDNode *ScopeNode) {
1294 cast<DILocalScope>(ScopeNode)));
1297 void DwarfDebug::ensureAbstractEntityIsCreatedIfScoped(
DwarfCompileUnit &CU,
1308 void DwarfDebug::collectVariableInfoFromMFTable(
1314 assert(
VI.Var->isValidLocationForIntrinsic(
VI.Loc) &&
1315 "Expected inlined-at fields to agree");
1317 InlinedEntity Var(
VI.Var,
VI.Loc->getInlinedAt());
1325 ensureAbstractEntityIsCreatedIfScoped(TheCU, Var.first, Scope->
getScopeNode());
1326 auto RegVar = std::make_unique<DbgVariable>(
1327 cast<DILocalVariable>(Var.first), Var.second);
1328 RegVar->initializeMMI(
VI.Expr,
VI.Slot);
1330 DbgVar->addMMIEntry(*RegVar);
1332 MFVars.
insert({Var, RegVar.get()});
1333 ConcreteEntities.push_back(std::move(RegVar));
1353 if (LSRange.size() == 0)
1357 const MachineInstr *LScopeBegin = LSRange.front().first;
1362 for (++Pred; Pred != MBB->rend(); ++Pred) {
1365 auto PredDL = Pred->getDebugLoc();
1366 if (!PredDL || Pred->isMetaInstruction())
1370 if (DL->getScope() == PredDL->getScope())
1373 if (!PredScope || LScope->dominates(PredScope))
1432 std::pair<DbgValueHistoryMap::EntryIndex, DbgValueLoc>;
1434 bool isSafeForSingleLocation =
true;
1438 for (
auto EB = Entries.
begin(), EI = EB, EE = Entries.
end(); EI != EE; ++EI) {
1442 size_t Index = std::distance(EB, EI);
1444 remove_if(OpenRanges, [&](OpenRange &R) {
return R.first <=
Index; });
1445 OpenRanges.
erase(Last, OpenRanges.
end());
1452 "Forgot label before/after instruction starting a range!");
1455 if (std::next(EI) == Entries.
end()) {
1457 if (EI->isClobber())
1458 EndMI = EI->getInstr();
1460 else if (std::next(EI)->isClobber())
1464 assert(EndLabel &&
"Forgot label after instruction ending a range!");
1466 if (EI->isDbgValue())
1472 if (EI->isDbgValue()) {
1485 isSafeForSingleLocation =
false;
1488 StartDebugMI = Instr;
1490 isSafeForSingleLocation =
false;
1496 if (OpenRanges.
empty())
1500 if (StartLabel == EndLabel) {
1501 LLVM_DEBUG(
dbgs() <<
"Omitting location list entry with empty range.\n");
1506 for (
auto &R : OpenRanges)
1512 auto CurEntry = DebugLoc.
rbegin();
1514 dbgs() << CurEntry->getValues().size() <<
" Values:\n";
1515 for (
auto &Value : CurEntry->getValues())
1517 dbgs() <<
"-----\n";
1520 auto PrevEntry = std::next(CurEntry);
1521 if (PrevEntry != DebugLoc.
rend() && PrevEntry->MergeRanges(*CurEntry))
1525 return DebugLoc.
size() == 1 && isSafeForSingleLocation &&
1534 ensureAbstractEntityIsCreatedIfScoped(TheCU, Node, Scope.
getScopeNode());
1535 if (isa<const DILocalVariable>(Node)) {
1536 ConcreteEntities.push_back(
1537 std::make_unique<DbgVariable>(cast<const DILocalVariable>(Node),
1540 cast<DbgVariable>(ConcreteEntities.back().get()));
1541 }
else if (isa<const DILabel>(Node)) {
1542 ConcreteEntities.push_back(
1543 std::make_unique<DbgLabel>(cast<const DILabel>(Node),
1546 cast<DbgLabel>(ConcreteEntities.back().get()));
1548 return ConcreteEntities.back().get();
1556 collectVariableInfoFromMFTable(TheCU, Processed);
1559 InlinedEntity IV =
I.first;
1560 if (Processed.
count(IV))
1564 const auto &HistoryMapEntries =
I.second;
1565 if (HistoryMapEntries.empty())
1579 DbgVariable *RegVar = cast<DbgVariable>(createConcreteEntity(TheCU,
1580 *Scope, LocalVar, IV.second));
1582 const MachineInstr *MInsn = HistoryMapEntries.front().getInstr();
1583 assert(MInsn->isDebugValue() &&
"History must begin with debug value");
1588 size_t HistSize = HistoryMapEntries.size();
1589 bool SingleValueWithClobber =
1590 HistSize == 2 && HistoryMapEntries[1].isClobber();
1591 if (HistSize == 1 || SingleValueWithClobber) {
1593 SingleValueWithClobber ? HistoryMapEntries[1].getInstr() :
nullptr;
1609 bool isValidSingleLocation = buildLocationList(Entries, HistoryMapEntries);
1614 if (isValidSingleLocation) {
1626 for (
auto &
Entry : Entries)
1627 Entry.finalize(*
Asm, List, BT, TheCU);
1633 InlinedEntity IL =
I.first;
1639 const DILabel *Label = cast<DILabel>(IL.first);
1657 createConcreteEntity(TheCU, *Scope, Label, IL.second, Sym);
1661 for (
const DINode *DN : SP->getRetainedNodes()) {
1662 if (!Processed.
insert(InlinedEntity(DN,
nullptr)).second)
1665 if (
auto *DV = dyn_cast<DILocalVariable>(DN)) {
1667 }
else if (
auto *DL = dyn_cast<DILabel>(DN)) {
1672 createConcreteEntity(TheCU, *Scope, DN,
nullptr);
1693 unsigned LastAsmLine =
1707 if (LastAsmLine == 0 && DL.
getLine() != 0) {
1718 if (LastAsmLine == 0)
1721 if (UnknownLocations == Disable)
1735 const MDNode *Scope =
nullptr;
1736 unsigned Column = 0;
1741 recordSourceLine(0, Column, Scope, 0);
1749 if (DL.
getLine() == 0 && LastAsmLine == 0)
1773 for (
const auto &MBB : *MF)
1774 for (
const auto &
MI : MBB)
1777 return MI.getDebugLoc();
1784 const MDNode *S,
unsigned Flags,
unsigned CUID,
1786 ArrayRef<std::unique_ptr<DwarfCompileUnit>> DCUs) {
1788 unsigned FileNo = 1;
1789 unsigned Discriminator = 0;
1790 if (
auto *Scope = cast_or_null<DIScope>(S)) {
1791 Fn = Scope->getFilename();
1792 if (Line != 0 && DwarfVersion >= 4)
1793 if (
auto *LBF = dyn_cast<DILexicalBlockFile>(Scope))
1794 Discriminator = LBF->getDiscriminator();
1797 .getOrCreateSourceID(Scope->getFile());
1799 Asm.
OutStreamer->EmitDwarfLocDirective(FileNo, Line, Col, Flags, 0,
1809 (void)getOrCreateDwarfCompileUnit(
1863 "endFunction should be called with the same function as beginFunction");
1871 if (TheCU.getCUNode()->isDebugDirectivesOnly()) {
1878 collectEntityInfo(TheCU, SP, Processed);
1886 if (!TheCU.getCUNode()->getDebugInfoForProfiling() &&
1900 auto *SP = cast<DISubprogram>(AScope->getScopeNode());
1901 for (
const DINode *DN : SP->getRetainedNodes()) {
1902 if (!Processed.
insert(InlinedEntity(DN,
nullptr)).second)
1905 const MDNode *Scope =
nullptr;
1906 if (
auto *DV = dyn_cast<DILocalVariable>(DN))
1907 Scope = DV->getScope();
1908 else if (
auto *DL = dyn_cast<DILabel>(DN))
1909 Scope = DL->getScope();
1914 ensureAbstractEntityIsCreated(TheCU, DN, Scope);
1916 &&
"ensureAbstractEntityIsCreated inserted abstract scopes");
1918 constructAbstractSubprogramScopeDIE(TheCU, AScope);
1921 ProcessedSPNodes.insert(SP);
1922 DIE &ScopeDIE = TheCU.constructSubprogramScopeDIE(SP, FnScope);
1923 if (
auto *SkelCU = TheCU.getSkeleton())
1925 TheCU.getCUNode()->getSplitDebugInlining())
1926 SkelCU->constructSubprogramScopeDIE(SP, FnScope);
1929 constructCallSiteEntryDIEs(*SP, TheCU, ScopeDIE, *MF);
1943 void DwarfDebug::recordSourceLine(
unsigned Line,
unsigned Col,
const MDNode *S,
1945 ::recordSourceLine(*
Asm, Line, Col, S, Flags,
1955 void DwarfDebug::emitDebugInfo() {
1961 void DwarfDebug::emitAbbreviations() {
1967 void DwarfDebug::emitStringOffsetsTableHeader() {
1974 template <
typename AccelTableT>
1983 void DwarfDebug::emitAccelDebugNames() {
1985 if (getUnits().
empty())
1992 void DwarfDebug::emitAccelNames() {
1999 void DwarfDebug::emitAccelObjC() {
2005 void DwarfDebug::emitAccelNamespaces() {
2006 emitAccel(AccelNamespace,
2012 void DwarfDebug::emitAccelTypes() {
2043 if (Die->
getTag() == dwarf::DW_TAG_compile_unit)
2051 DIE &SpecDIE = SpecVal.getDIEEntry().getEntry();
2058 case dwarf::DW_TAG_class_type:
2059 case dwarf::DW_TAG_structure_type:
2060 case dwarf::DW_TAG_union_type:
2061 case dwarf::DW_TAG_enumeration_type:
2067 case dwarf::DW_TAG_typedef:
2068 case dwarf::DW_TAG_base_type:
2069 case dwarf::DW_TAG_subrange_type:
2071 case dwarf::DW_TAG_namespace:
2073 case dwarf::DW_TAG_subprogram:
2075 case dwarf::DW_TAG_variable:
2077 case dwarf::DW_TAG_enumerator:
2079 dwarf::GIEL_STATIC);
2087 void DwarfDebug::emitDebugPubSections() {
2088 for (
const auto &NU : CUMap) {
2099 emitDebugPubSection(GnuStyle,
"Names", TheU, TheU->
getGlobalNames());
2104 emitDebugPubSection(GnuStyle,
"Types", TheU, TheU->
getGlobalTypes());
2116 void DwarfDebug::emitDebugPubSection(
bool GnuStyle,
StringRef Name,
2123 Asm->
OutStreamer->AddComment(
"Length of Public " + Name +
" Info");
2134 emitSectionReference(*TheU);
2140 for (
const auto &GI : Globals) {
2141 const char *Name = GI.getKeyData();
2142 const DIE *Entity = GI.second;
2165 void DwarfDebug::emitDebugStr() {
2166 MCSection *StringOffsetsSection =
nullptr;
2168 emitStringOffsetsTableHeader();
2173 StringOffsetsSection,
true);
2180 auto Comment = Comments.begin();
2181 auto End = Comments.end();
2196 for (
auto &
Op : Expr) {
2197 assert(
Op.getCode() != dwarf::DW_OP_const_type &&
2198 "3 operand ops not yet supported");
2199 Streamer.
EmitInt8(
Op.getCode(), Comment != End ? *(Comment++) :
"");
2201 for (
unsigned I = 0;
I < 2; ++
I) {
2202 if (
Op.getDescription().Op[
I] == Encoding::SizeNA)
2204 if (
Op.getDescription().Op[
I] == Encoding::BaseTypeRef) {
2207 assert(Offset < (1ULL << (ULEB128PadSize * 7)) &&
"Offset wont fit");
2218 for (uint64_t J = Offset; J <
Op.getOperandEndOffset(
I); ++J)
2219 Streamer.
EmitInt8(
Data.getData()[J], Comment != End ? *(Comment++) :
"");
2221 Offset =
Op.getOperandEndOffset(
I);
2223 assert(Offset ==
Op.getEndOffset());
2234 if (Value.
isInt()) {
2235 if (BT && (BT->
getEncoding() == dwarf::DW_ATE_signed ||
2246 if (DIExpr->isEntryValue()) {
2271 assert(!Values.empty() &&
2272 "location list entries without values are redundant");
2273 assert(Begin != End &&
"unexpected location list entry with empty range");
2278 if (Value.isFragment()) {
2282 }) &&
"all values are expected to be fragments");
2283 assert(std::is_sorted(Values.begin(), Values.end()) &&
2284 "fragments are expected to be sorted");
2286 for (
auto Fragment : Values)
2290 assert(Values.size() == 1 &&
"only fragments may have >1 value");
2293 DwarfExpr.finalize();
2294 if (DwarfExpr.TagOffset)
2332 Asm->
OutStreamer->AddComment(
"Segment selector size");
2345 Asm->
OutStreamer->AddComment(
"Offset entry count");
2367 Asm->
OutStreamer->AddComment(
"Offset entry count");
2377 template <
typename Ranges,
typename PayloadEmitter>
2381 unsigned StartxLength,
unsigned EndOfList,
2383 bool ShouldUseBaseAddress,
2384 PayloadEmitter EmitPayload) {
2396 for (
const auto &Range : R)
2397 SectionRanges[&Range.Begin->getSection()].push_back(&Range);
2400 bool BaseIsSet =
false;
2401 for (
const auto &
P : SectionRanges) {
2402 auto *
Base = CUBase;
2403 if (!
Base && ShouldUseBaseAddress) {
2404 const MCSymbol *Begin =
P.second.front()->Begin;
2412 }
else if (NewBase != Begin ||
P.second.size() > 1) {
2418 Asm->
OutStreamer->AddComment(StringifyEnum(BaseAddressx));
2420 Asm->
OutStreamer->AddComment(
" base address index");
2423 }
else if (BaseIsSet && !UseDwarf5) {
2430 for (
const auto *RS :
P.second) {
2433 assert(Begin &&
"Range without a begin symbol?");
2434 assert(End &&
"Range without an end symbol?");
2438 Asm->
OutStreamer->AddComment(StringifyEnum(OffsetPair));
2448 }
else if (UseDwarf5) {
2449 Asm->
OutStreamer->AddComment(StringifyEnum(StartxLength));
2464 Asm->
OutStreamer->AddComment(StringifyEnum(EndOfList));
2476 *List.
CU, dwarf::DW_LLE_base_addressx,
2477 dwarf::DW_LLE_offset_pair, dwarf::DW_LLE_startx_length,
2485 void DwarfDebug::emitDebugLocImpl(
MCSection *Sec) {
2503 void DwarfDebug::emitDebugLoc() {
2511 void DwarfDebug::emitDebugLocDWO() {
2532 Asm->
emitInt8(dwarf::DW_LLE_startx_length);
2540 Asm->
emitInt8(dwarf::DW_LLE_end_of_list);
2550 void DwarfDebug::emitDebugARanges() {
2555 for (
const SymbolCU &SCU : ArangeLabels) {
2556 if (SCU.Sym->isInSection()) {
2558 MCSection *Section = &SCU.Sym->getSection();
2560 SectionMap[Section].push_back(SCU);
2565 SectionMap[
nullptr].push_back(SCU);
2571 for (
auto &
I : SectionMap) {
2574 if (List.
size() < 1)
2582 Span.
Start = Cur.Sym;
2585 Spans[Cur.CU].push_back(Span);
2608 const MCSymbol *StartSym = List[0].Sym;
2609 for (
size_t n = 1,
e = List.
size(); n <
e; n++) {
2610 const SymbolCU &Prev = List[n - 1];
2614 if (Cur.
CU != Prev.
CU) {
2616 Span.
Start = StartSym;
2619 Spans[Prev.
CU].push_back(Span);
2632 std::vector<DwarfCompileUnit *> CUs;
2633 for (
const auto &it : Spans) {
2645 std::vector<ArangeSpan> &
List = Spans[CU];
2652 unsigned ContentSize =
2658 unsigned TupleSize = PtrSize * 2;
2664 ContentSize += Padding;
2665 ContentSize += (List.size() + 1) * TupleSize;
2668 Asm->
OutStreamer->AddComment(
"Length of ARange Set");
2670 Asm->
OutStreamer->AddComment(
"DWARF Arange version number");
2672 Asm->
OutStreamer->AddComment(
"Offset Into Debug Info Section");
2673 emitSectionReference(*CU);
2674 Asm->
OutStreamer->AddComment(
"Address Size (in bytes)");
2676 Asm->
OutStreamer->AddComment(
"Segment Size (in bytes)");
2690 uint64_t
Size = SymSize[Span.Start];
2698 Asm->
OutStreamer->AddComment(
"ARange terminator");
2708 dwarf::DW_RLE_base_addressx, dwarf::DW_RLE_offset_pair,
2709 dwarf::DW_RLE_startx_length, dwarf::DW_RLE_end_of_list,
2723 return !Pair.second->getCUNode()->isDebugDirectivesOnly();
2741 void DwarfDebug::emitDebugRanges() {
2742 const auto &Holder =
useSplitDwarf() ? SkeletonHolder : InfoHolder;
2744 emitDebugRangesImpl(Holder,
2750 void DwarfDebug::emitDebugRangesDWO() {
2751 emitDebugRangesImpl(InfoHolder,
2755 void DwarfDebug::handleMacroNodes(DIMacroNodeArray Nodes,
DwarfCompileUnit &U) {
2756 for (
auto *MN : Nodes) {
2757 if (
auto *M = dyn_cast<DIMacro>(MN))
2759 else if (
auto *
F = dyn_cast<DIMacroFile>(MN))
2760 emitMacroFile(*
F, U);
2766 void DwarfDebug::emitMacro(
DIMacro &M) {
2772 if (!Value.
empty()) {
2789 void DwarfDebug::emitDebugMacinfoImpl(
MCSection *Section) {
2790 for (
const auto &
P : CUMap) {
2791 auto &TheCU = *
P.second;
2794 auto *CUNode = cast<DICompileUnit>(
P.first);
2795 DIMacroNodeArray Macros = CUNode->getMacros();
2800 handleMacroNodes(Macros, U);
2801 Asm->
OutStreamer->AddComment(
"End Of Macro List Mark");
2807 void DwarfDebug::emitDebugMacinfo() {
2811 void DwarfDebug::emitDebugMacinfoDWO() {
2817 void DwarfDebug::initSkeletonUnit(
const DwarfUnit &U,
DIE &Die,
2818 std::unique_ptr<DwarfCompileUnit> NewU) {
2820 if (!CompilationDir.empty())
2821 NewU->addString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
2823 addGnuPubAttributes(*NewU, Die);
2825 SkeletonHolder.addUnit(std::move(NewU));
2830 auto OwnedUnit = std::make_unique<DwarfCompileUnit>(
2836 NewCU.initStmtList();
2839 NewCU.addStringOffsetsStart();
2841 initSkeletonUnit(CU, NewCU.
getUnitDie(), std::move(OwnedUnit));
2848 void DwarfDebug::emitDebugInfoDWO() {
2851 InfoHolder.emitUnits(
true);
2856 void DwarfDebug::emitDebugAbbrevDWO() {
2861 void DwarfDebug::emitDebugLineDWO() {
2863 SplitTypeUnitFileTable.Emit(
2868 void DwarfDebug::emitStringOffsetsTableHeaderDWO() {
2870 InfoHolder.getStringPool().emitStringOffsetsTableHeader(
2872 InfoHolder.getStringOffsetsStartSym());
2878 void DwarfDebug::emitDebugStrDWO() {
2880 emitStringOffsetsTableHeaderDWO();
2888 void DwarfDebug::emitDebugAddr() {
2896 SplitTypeUnitFileTable.maybeSetRootFile(
2899 return &SplitTypeUnitFileTable;
2910 return Result.
high();
2919 if (!TypeUnitsUnderConstruction.empty() && AddrPool.hasBeenUsed())
2922 auto Ins = TypeSignatures.insert(std::make_pair(CTy, 0));
2928 bool TopLevelType = TypeUnitsUnderConstruction.empty();
2929 AddrPool.resetUsedFlag();
2931 auto OwnedUnit = std::make_unique<DwarfTypeUnit>(CU,
Asm,
this, &InfoHolder,
2932 getDwoLineTable(CU));
2935 TypeUnitsUnderConstruction.emplace_back(std::move(OwnedUnit), CTy);
2937 NewTU.addUInt(UnitDie, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
2941 NewTU.setTypeSignature(Signature);
2942 Ins.first->second = Signature;
2947 ? Asm->getObjFileLowering().getDwarfTypesDWOSection()
2948 : Asm->getObjFileLowering().getDwarfInfoDWOSection();
2949 NewTU.setSection(Section);
2953 ? Asm->getObjFileLowering().getDwarfTypesSection(Signature)
2954 : Asm->getObjFileLowering().getDwarfInfoSection(Signature);
2955 NewTU.setSection(Section);
2957 CU.applyStmtList(UnitDie);
2963 NewTU.addStringOffsetsStart();
2965 NewTU.setType(NewTU.createTypeDIE(CTy));
2968 auto TypeUnitsToAdd = std::move(TypeUnitsUnderConstruction);
2969 TypeUnitsUnderConstruction.clear();
2973 if (AddrPool.hasBeenUsed()) {
2978 for (
const auto &TU : TypeUnitsToAdd)
2979 TypeSignatures.erase(TU.second);
2985 CU.constructTypeDIE(RefDie, cast<DICompositeType>(CTy));
2991 for (
auto &TU : TypeUnitsToAdd) {
2992 InfoHolder.computeSizeAndOffsetsForUnit(TU.first.get());
2996 CU.addDIETypeSignature(RefDie, Signature);
2999 DwarfDebug::NonTypeUnitContext::NonTypeUnitContext(
DwarfDebug *DD)
3001 TypeUnitsUnderConstruction(std::move(DD->TypeUnitsUnderConstruction)) {
3002 DD->TypeUnitsUnderConstruction.clear();
3007 DD->TypeUnitsUnderConstruction = std::move(TypeUnitsUnderConstruction);
3019 template <
typename DataT>
3038 AccelDebugNames.addName(Ref, Die);
3049 addAccelNameImpl(CU, AccelNames, Name, Die);
3056 addAccelNameImpl(CU, AccelObjC, Name, Die);
3061 addAccelNameImpl(CU, AccelNamespace, Name, Die);
3065 const DIE &Die,
char Flags) {
3066 addAccelNameImpl(CU, AccelTypes, Name, Die);
3070 return Asm->
OutStreamer->getContext().getDwarfVersion();
3074 return SectionLabels.find(S)->second;
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface ...
const StringMap< const DIE * > & getGlobalTypes() const
const DICompileUnit * getCUNode() const
debug_compile_units_iterator debug_compile_units_end() const
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
Instances of this class represent a uniqued identifier for a section in the current translation unit...
An object containing the capability of hashing and adding hash attributes onto a DIE.
DIE::value_iterator addSectionDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
addSectionDelta - Add a label delta attribute data and value.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
reference emplace_back(ArgTypes &&... Args)
const DILocalScope * getScopeNode() const
std::vector< BaseTypeRef > ExprRefedBaseTypes
Builder for DebugLocStream lists.
MCSection * getDwarfStrOffSection() const
void addFlag(DIE &Die, dwarf::Attribute Attribute)
Add a flag that is true to the DIE.
SectionKind getKind() const
void setLabel(MCSymbol *Sym)
static cl::opt< bool > SplitDwarfCrossCuReferences("split-dwarf-cross-cu-references", cl::Hidden, cl::desc("Enable cross-cu references in DWO files"), cl::init(false))
void addUnit(std::unique_ptr< DwarfCompileUnit > U)
Add a unit to the list of CUs.
static dwarf::PubIndexEntryDescriptor computeIndexValue(DwarfUnit *CU, const DIE *Die)
computeIndexValue - Compute the gdb index value for the DIE and CU.
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
void emitAppleAccelTable(AsmPrinter *Asm, AccelTable< DataT > &Contents, StringRef Prefix, const MCSymbol *SecBegin)
Emit an Apple Accelerator Table consisting of entries in the specified AccelTable.
bool isCall(QueryType Type=AnyInBundle) const
void addMMIEntry(const DbgVariable &V)
static cl::opt< bool > DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden, cl::desc("Disable debug info printing"))
MCSection * getDwarfAccelObjCSection() const
const MCSymbol * getBaseAddress() const
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
bool hasDebugInfo() const
Returns true if valid debug info is present.
#define DWARF2_FLAG_PROLOGUE_END
MCSection * getDwarfStrSection() const
MCTargetOptions MCOptions
Machine level options.
const MachineFunction * getMF() const
Return the function that contains the basic block that this instruction belongs to.
static SmallVectorImpl< DwarfCompileUnit::GlobalExpr > & sortGlobalExprs(SmallVectorImpl< DwarfCompileUnit::GlobalExpr > &GVEs)
Sort and unique GVEs by comparing their fragment offset.
This class represents lattice values for constants.
bool isAbstractScope() const
virtual bool isCalleeSavedPhysReg(unsigned PhysReg, const MachineFunction &MF) const
This is a wrapper around getCallPreservedMask().
void addUnsignedConstant(uint64_t Value)
Emit an unsigned constant.
void setRnglistsTableBaseSym(MCSymbol *Sym)
const ConstantFP * getConstantFP() const
unsigned getRuntimeVersion() const
MCSection * getDwarfLocSection() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
unsigned EnableDebugEntryValues
Emit debug info about parameter's entry values.
A Module instance is used to store all the information related to an LLVM module. ...
NonTypeUnitContext enterNonTypeUnitContext()
void setMemoryLocationKind()
Lock this down to become a memory location description.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
const SmallVectorImpl< RangeSpanList > & getRangeLists() const
getRangeLists - Get the vector of range lists.
BufferByteStreamer getStreamer()
bool isTargetIndex() const
isTargetIndex - Tests if this is a MO_TargetIndex operand.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
const DIType * getType() const
void push_back(const T &Elt)
AccelTableKind getAccelTableKind() const
Returns what kind (if any) of accelerator tables to emit.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
const DebugLocStream & getDebugLocs() const
Returns the entries for the .debug_loc section.
std::string SplitDwarfFile
uint16_t getDwarfVersion() const
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
bool isConstantFP() const
bool hasRangeLists() const
const CallSiteInfoMap & getCallSitesInfo() const
Collects and handles dwarf debug information.
MCSection * getDwarfAccelNamesSection() const
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
bool hasDelaySlot(QueryType Type=AnyInBundle) const
Returns true if the specified instruction has a delay slot which must be filled by the code generator...
static cl::opt< AccelTableKind > AccelTables("accel-tables", cl::Hidden, cl::desc("Output dwarf accelerator tables."), cl::values(clEnumValN(AccelTableKind::Default, "Default", "Default for platform"), clEnumValN(AccelTableKind::None, "Disable", "Disabled."), clEnumValN(AccelTableKind::Apple, "Apple", "Apple"), clEnumValN(AccelTableKind::Dwarf, "Dwarf", "DWARF")), cl::init(AccelTableKind::Default))
void beginEntryValueExpression(DIExpressionCursor &ExprCursor)
Begin emission of an entry value dwarf operation.
Base class containing the logic for constructing DWARF expressions independently of whether they are ...
SmallVectorImpl< InsnRange > & getRanges()
MCSection * getDwarfMacinfoDWOSection() const
unsigned getDebugSectionOffset() const
static cl::opt< bool > NoDwarfRangesSection("no-dwarf-ranges-section", cl::Hidden, cl::desc("Disable emission .debug_ranges section."), cl::init(false))
This class is defined as the common parent of DbgVariable and DbgLabel such that it could levarage po...
void emitDwarfSymbolReference(const MCSymbol *Label, bool ForceOffset=false) const
Emit a reference to a symbol for use in dwarf.
This class implements a map that also provides access to all stored values in a deterministic order...
uint64_t getDWOId() const
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
void addName(DwarfStringPoolEntryRef Name, Types &&... Args)
static const char *const DbgTimerName
DebugLoc emitInitialLocDirective(const MachineFunction &MF, unsigned CUID)
Emits inital debug location directive.
STATISTIC(NumFunctions, "Total number of functions")
unsigned const TargetRegisterInfo * TRI
MachineFunction * MF
The current machine function.
MCSection * getDwarfARangesSection() const
StringRef getProducer() const
bool isMetaInstruction() const
Return true if this instruction doesn't produce any output in the form of executable instructions...
iterator_range< mop_iterator > operands()
LexicalScope - This class is used to track scope information.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
uint64_t offsetToAlignment(uint64_t Value, Align Alignment)
Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a mu...
const MachineInstr * CurMI
If nonnull, stores the current machine instruction we're processing.
MCSection * getDwarfRnglistsDWOSection() const
VariableDbgInfoMapTy & getVariableDbgInfo()
Tagged DWARF-like metadata node.
DebuggerKind
Identify a debugger for "tuning" the debug info.
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support...
static const char *const DbgTimerDescription
static cl::opt< bool > GenerateARangeSection("generate-arange-section", cl::Hidden, cl::desc("Generate dwarf aranges"), cl::init(false))
void EmitInt8(uint8_t Byte, const Twine &Comment) override
DbgEntity * getExistingAbstractEntity(const DINode *Node)
MCSection * getDwarfRnglistsSection() const
MCSection * getDwarfPubNamesSection() const
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
TargetIndexLocation getTargetIndexLocation() const
DIScope * getScope() const
MCSymbol * getRnglistsTableBaseSym() const
DebugLoc PrevInstLoc
Previous instruction's location information.
DbgLabelInstrMap DbgLabels
Mapping of inlined labels and DBG_LABEL machine instruction.
StringRef getSplitDebugFilename() const
#define DWARF2_FLAG_IS_STMT
StringRef getFlags() const
MCSection * getDwarfMacinfoSection() const
LexicalScope * getOrCreateAbstractScope(const DILocalScope *Scope)
getOrCreateAbstractScope - Find or create an abstract lexical scope.
MCSection * getDwarfLocDWOSection() const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
bool isDebugDirectivesOnly() const
const HexagonInstrInfo * TII
Used for tracking debug info about call site parameters.
const MCExpr * getFunctionLocalOffsetAfterInsn(const MachineInstr *MI)
Return the function-local offset of an instruction.
DbgValueHistoryMap DbgValues
History of DBG_VALUE and clobber instructions for each user variable.
const ConstantFP * getFPImm() const
unsigned getNumOperands() const
Retuns the total number of operands.
void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
This class is basically a combination of TimeRegion and Timer.
const DIE * getUnitDie() const
Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to...
MachineBasicBlock iterator that automatically skips over MIs that are inside bundles (i...
void constructCallSiteParmEntryDIEs(DIE &CallSiteDIE, SmallVector< DbgCallSiteParam, 4 > &Params)
Construct call site parameter DIEs for the CallSiteDIE.
Base class for the full range of assembler expressions which are needed for parsing.
void addSubprogramNames(const DICompileUnit &CU, const DISubprogram *SP, DIE &Die)
The access may reference the value stored in memory.
bool none_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::none_of which take ranges instead of having to pass begin/end explicitly...
bool getRangesBaseAddress() const
LLVM_NODISCARD StringRef slice(size_t Start, size_t End) const
Return a reference to the substring from [Start, End).
bool isLexicalScopeDIENull(LexicalScope *Scope)
A helper function to check whether the DIE for a given Scope is going to be null. ...
DIE & constructCallSiteEntryDIE(DIE &ScopeDIE, const DISubprogram *CalleeSP, bool IsTail, const MCSymbol *PCAddr, const MCExpr *PCOffset, unsigned CallReg)
Construct a call site entry DIE describing a call within Scope to a callee described by CalleeSP...
void constructContainingTypeDIEs()
Construct DIEs for types that contain vtables.
void setDWOId(uint64_t DwoId)
virtual void EmitInt8(uint8_t Byte, const Twine &Comment="")=0
void addAccelName(const DICompileUnit &CU, StringRef Name, const DIE &Die)
DenseMap< LexicalScope *, ScopeVars > & getScopeVariables()
Holds a DIExpression and keeps track of how many operands have been consumed so far.
uint64_t computeCUSignature(StringRef DWOName, const DIE &Die)
Computes the CU signature.
AccelTableKind
The kind of accelerator tables we should emit.
#define clEnumVal(ENUMVAL, DESC)
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
StringRef getFilename() const
DwarfExpression implementation for .debug_loc entries.
This file implements a class to represent arbitrary precision integral constant values and operations...
DIE * getOrCreateTypeDIE(const MDNode *TyNode)
Find existing DIE or create new DIE for the given type.
void createAbstractEntity(const DINode *Node, LexicalScope *Scope)
static Optional< DebugNameTableKind > getNameTableKind(StringRef Str)
void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str)
Add a string attribute data and value.
bool regsOverlap(Register regA, Register regB) const
Returns true if the two registers are equal or alias each other.
void addWasmLocation(unsigned Index, int64_t Offset)
Emit location information expressed via WebAssembly location + offset The Index is an identifier for ...
AddressPool & getAddressPool()
Describes an entry of the various gnu_pub* debug sections.
unsigned getUniqueID() const
MCSymbol * getFunctionBegin() const
MachineBasicBlock::instr_iterator getBundleStart(MachineBasicBlock::instr_iterator I)
Returns an iterator to the first instruction in the bundle containing I.
static bool validThroughout(LexicalScopes &LScopes, const MachineInstr *DbgValue, const MachineInstr *RangeEnd)
Determine whether a singular DBG_VALUE is valid for the entirety of its enclosing lexical scope...
DenseMap< const MDNode *, DIE * > & getAbstractSPDies()
This class is used to track local variable information.
static MCSymbol * emitRnglistsTableHeader(AsmPrinter *Asm, const DwarfFile &Holder)
const DILocalVariable * getVariable() const
static AccelTableKind computeAccelTableKind(unsigned DwarfVersion, bool GenerateTypeUnits, DebuggerKind Tuning, const Triple &TT)
DIMacroNodeArray getElements() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool isLittleEndian() const
Layout endianness...
.apple_names, .apple_namespaces, .apple_types, .apple_objc.
static Optional< FragmentInfo > getFragmentInfo(expr_op_iterator Start, expr_op_iterator End)
Retrieve the details of this fragment expression.
bool isFPImm() const
isFPImm - Tests if this is a MO_FPImmediate operand.
debug_compile_units_iterator debug_compile_units_begin() const
LexicalScope * findLexicalScope(const DILocation *DL)
findLexicalScope - Find lexical scope, either regular or inlined, for the given DebugLoc.
const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & getUnits()
virtual const TargetInstrInfo * getInstrInfo() const
static cl::opt< DefaultOnOff > DwarfInlinedStrings("dwarf-inlined-strings", cl::Hidden, cl::desc("Use inlined strings rather than string section."), cl::values(clEnumVal(Default, "Default for platform"), clEnumVal(Enable, "Enabled"), clEnumVal(Disable, "Disabled")), cl::init(Default))
MCSection * getDwarfAccelTypesSection() const
DIE & addChild(DIE *Child)
Add a child to the DIE.
static cl::opt< bool > GenerateDwarfTypeUnits("generate-type-units", cl::Hidden, cl::desc("Generate DWARF4 type units."), cl::init(false))
void EmitLabelDifferenceAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo) const
Emit something like ".uleb128 Hi-Lo".
static cl::opt< bool > UseDwarfRangesBaseAddressSpecifier("use-dwarf-ranges-base-address-specifier", cl::Hidden, cl::desc("Use base address specifiers in debug_ranges"), cl::init(false))
MCSection * getDwarfAbbrevSection() const
const DwarfCompileUnit * CU
const DIExpression * Expr
MCSection * getDwarfAbbrevDWOSection() const
const DIExpression * getExpression() const
TargetInstrInfo - Interface to description of machine instruction set.
dwarf::Attribute getDwarf5OrGNUAttr(dwarf::Attribute Attr) const
This takes a DWARF 5 attribute and returns it or a GNU analog.
iterator find(const_arg_type_t< KeyT > Val)
LexicalScope * findAbstractScope(const DILocalScope *N)
findAbstractScope - Find an abstract scope or return null.
static void forBothCUs(DwarfCompileUnit &CU, Func F)
MCSymbol * getStringOffsetsStartSym() const
MCSection * getDwarfGnuPubTypesSection() const
DebuggerKind DebuggerTuning
Which debugger to tune for.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata *> MDs)
This dwarf writer support class manages information associated with a source file.
DwarfStringPool & getStringPool()
Returns the string pool.
initializer< Ty > init(const Ty &Val)
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
void endModule() override
Emit all Dwarf sections that should come after the content.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const MachineBasicBlock * PrevInstBB
const MCAsmInfo * MAI
Target Asm Printer information.
static void getObjCClassCategory(StringRef In, StringRef &Class, StringRef &Category)
static cl::opt< LinkageNameOption > DwarfLinkageNames("dwarf-linkage-names", cl::Hidden, cl::desc("Which DWARF linkage-name attributes to emit."), cl::values(clEnumValN(DefaultLinkageNames, "Default", "Default for platform"), clEnumValN(AllLinkageNames, "All", "All"), clEnumValN(AbstractLinkageNames, "Abstract", "Abstract subprograms")), cl::init(DefaultLinkageNames))
MCSection * getDwarfAddrSection() const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
DISubprogram * getSubprogram() const
Get the attached subprogram.
void EmitULEB128(uint64_t Value, const char *Desc=nullptr, unsigned PadTo=0) const
Emit the specified unsigned leb128 value.
const DILocation * getInlinedAt() const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const GlobalValue * getGlobal() const
A structured debug information entry.
AsmPrinter * Asm
Target of debug info emission.
std::pair< iterator, bool > insert(const ValueT &V)
void setEntryValueFlag()
Lock this down to become an entry value location.
ArrayRef< char > getBytes(const Entry &E) const
TargetMachine & TM
Target machine description.
This class is intended to be used as a driving class for all asm writers.
LLVM_NODISCARD size_t find(char C, size_t From=0) const
Search for the first character C in the string.
bool isCImm() const
isCImm - Test if this is a MO_CImmediate operand.
void addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier, DIE &Die, const DICompositeType *CTy)
Add a DIE to the set of types that we're going to pull into type units.
unsigned getOrCreateSourceID(const DIFile *File) override
Look up the source ID for the given file.
virtual void EmitULEB128(uint64_t DWord, const Twine &Comment="", unsigned PadTo=0)=0
void finishEntityDefinition(const DbgEntity *Entity)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
DIImportedEntityArray getImportedEntities() const
Encoding
Size and signedness of expression operations' operands.
MCSection * getDwarfLineDWOSection() const
bool isPS4CPU() const
Tests whether the target is the PS4 CPU.
static cl::opt< DefaultOnOff > UnknownLocations("use-unknown-locations", cl::Hidden, cl::desc("Make an absence of debug location information explicit."), cl::values(clEnumVal(Default, "At top of block or after label"), clEnumVal(Enable, "In all cases"), clEnumVal(Disable, "Never")), cl::init(Default))
Only used in LLVM metadata.
DwarfDebug(AsmPrinter *A, Module *M)
void addAccelType(const DICompileUnit &CU, StringRef Name, const DIE &Die, char Flags)
void EmitLabelReference(const MCSymbol *Label, unsigned Size, bool IsSectionRelative=false) const
Emit something like ".long Label" where the size in bytes of the directive is specified by Size and L...
const Triple & getTargetTriple() const
void computeSizeAndOffsets()
Compute the size and offset of all the DIEs.
bool useSegmentedStringOffsetsTable() const
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU ...
ArrayRef< Entry > getEntries(const List &L) const
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
bool addScopeVariable(LexicalScope *LS, DbgVariable *Var)
void beginInstruction(const MachineInstr *MI) override
Process beginning of an instruction.
auto remove_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly...
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
GDBIndexEntryLinkage Linkage
MDNode * getScope() const
A pair of GlobalVariable and DIExpression.
void emitDWARF5AccelTable(AsmPrinter *Asm, AccelTable< DWARF5AccelTableData > &Contents, const DwarfDebug &DD, ArrayRef< std::unique_ptr< DwarfCompileUnit >> CUs)
Helper used to pair up a symbol and its DWARF compile unit.
static void collectCallSiteParameters(const MachineInstr *CallMI, ParamSet &Params)
Try to interpret values loaded into registers that forward parameters for CallMI. ...
void emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry, const DwarfCompileUnit *CU)
Emit the location for a debug loc entry, including the size header.
StringRef getDirectory() const
iterator erase(const_iterator CI)
bool useAllLinkageNames() const
Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
MCSymbol * getLabelAfterInsn(const MachineInstr *MI)
Return Label immediately following the instruction.
bool hasDwarfPubSections() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
StringRef RangeListEncodingString(unsigned Encoding)
static void emitListsTableHeaderStart(AsmPrinter *Asm, MCSymbol *TableStart, MCSymbol *TableEnd)
static void emitLocList(DwarfDebug &DD, AsmPrinter *Asm, const DebugLocStream::List &List)
unsigned getDwarfVersion() const
Returns the Dwarf Version by checking module flags.
const DILocation * getInlinedAt() const
bool isDebugInstr() const
MCSymbol * getSym() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef OperationEncodingString(unsigned Encoding)
const DIExpression * getDebugExpression() const
Return the complex address expression referenced by this DBG_VALUE instruction.
static const char *const DWARFGroupDescription
Triple - Helper class for working with autoconf configuration names.
ArrayRef< FrameIndexExpr > getFrameIndexExprs() const
Get the FI entries, sorted by fragment offset.
An imported module (C++ using directive or similar).
DILocalScope * getNonLexicalBlockFileScope() const
Get the first non DILexicalBlockFile scope of this scope.
void initializeDbgValue(DbgValueLoc Value)
bool useLocSection() const
Returns whether .debug_loc section should be emitted.
void sort(IteratorTy Start, IteratorTy End)
DIE * constructImportedEntityDIE(const DIImportedEntity *Module)
Construct import_module DIE.
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
const APFloat & getValueAPF() const
void addExpression(DIExpressionCursor &&Expr, unsigned FragmentOffsetInBits=0)
Emit all remaining operations in the DIExpressionCursor.
uint16_t getLanguage() const
SmallVector< RangeSpan, 2 > takeRanges()
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope)
void addScopeLabel(LexicalScope *LS, DbgLabel *Label)
static DebugLoc findPrologueEndLoc(const MachineFunction *MF)
LexicalScope * findInlinedScope(const DILocalScope *N, const DILocation *IA)
findInlinedScope - Find an inlined scope for the given scope/inlined-at.
bool useSectionsAsReferences() const
Returns whether to use sections as labels rather than temp symbols.
DenseMap< LexicalScope *, LabelList > & getScopeLabels()
MCSymbol * getMacroLabelBegin() const
static bool hasObjCCategory(StringRef Name)
void beginInstruction(const MachineInstr *MI) override
Process beginning of an instruction.
const StringMap< const DIE * > & getGlobalNames() const
void addAccelNamespace(const DICompileUnit &CU, StringRef Name, const DIE &Die)
void setDebugInfoAvailability(bool avail)
static DbgValueLoc getDebugLocValue(const MachineInstr *MI)
Get .debug_loc entry for the instruction range starting at MI.
Align max(MaybeAlign Lhs, Align Rhs)
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
StringRef getName() const
MCSection * getSection() const
Return the section that this DIEUnit will be emitted into.
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
virtual void EmitSLEB128(uint64_t DWord, const Twine &Comment="")=0
Module.h This file contains the declarations for the Module class.
virtual Register getFrameRegister(const MachineFunction &MF) const =0
Debug information queries.
void beginModule()
Emit all Dwarf sections that should come prior to the content.
static MCSymbol * emitLoclistsTableHeader(AsmPrinter *Asm, const DwarfDebug &DD)
Optional< MD5::MD5Result > getMD5AsBytes(const DIFile *File) const
If the File has an MD5 checksum, return it as an MD5Result allocated in the MCContext.
MCSymbol * getBeginSymbol()
void finishSubprogramDefinition(const DISubprogram *SP)
bool isTargetIndexLocation() const
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void emitDebugLocEntry(ByteStreamer &Streamer, const DebugLocStream::Entry &Entry, const DwarfCompileUnit *CU)
Emit an entry for the debug loc section.
MCSection * getDwarfInfoSection() const
bool useAppleExtensionAttributes() const
void emitInt32(int Value) const
Emit a long directive and value.
MCSection * getDwarfStrOffDWOSection() const
virtual bool isTailCall(const MachineInstr &Inst) const
Determines whether Inst is a tail call instruction.
MCSymbol * getFunctionEnd() const
void finalize(const AsmPrinter &AP, DebugLocStream::ListBuilder &List, const DIBasicType *BT, DwarfCompileUnit &TheCU)
Lower this entry into a DWARF expression.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
unsigned getSourceLanguage() const
static cl::opt< DefaultOnOff > DwarfSectionsAsReferences("dwarf-sections-as-references", cl::Hidden, cl::desc("Use sections+offset as references rather than labels."), cl::values(clEnumVal(Default, "Default for platform"), clEnumVal(Enable, "Enabled"), clEnumVal(Disable, "Disabled")), cl::init(Default))
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
This file contains constants used for implementing Dwarf debug support.
Class for arbitrary precision integers.
ArrayRef< std::string > getComments(const Entry &E) const
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
MCSection * getDwarfPubTypesSection() const
void setSym(MCSymbol *Sym)
DebugLoc PrologEndLoc
This location indicates end of function prologue and beginning of function body.
const SmallVectorImpl< RangeSpan > & getRanges() const
getRanges - Get the list of ranges for this unit.
dwarf::Tag getTag() const
String pool entry reference.
void createBaseTypeDIEs()
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
const MachineBasicBlock * getParent() const
void emitStringOffsetsTableHeader(AsmPrinter &Asm, MCSection *OffsetSection, MCSymbol *StartSym)
static constexpr unsigned ULEB128PadSize
DIE * getOrCreateContextDIE(const DIScope *Context)
Get context owner's DIE.
void requestLabelAfterInsn(const MachineInstr *MI)
Ensure that a label will be emitted after MI.
MCSection * getDwarfStrDWOSection() const
Representation of each machine instruction.
static StringRef getObjCMethodName(StringRef In)
bool getSplitDebugInlining() const
void setSection(MCSection *Section)
Set the section that this DIEUnit will be emitted into.
reverse_self_iterator getReverseIterator()
unsigned getEncoding() const
EntryRef getEntry(AsmPrinter &Asm, StringRef Str)
Get a reference to an entry in the string pool.
void EmitDwarfOffset(const MCSymbol *Label, uint64_t Offset) const
Emit something like ".long Label + Offset".
DIE * getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
Get or create global variable DIE.
void addAccelObjC(const DICompileUnit &CU, StringRef Name, const DIE &Die)
LexicalScopes - This class provides interface to collect and use lexical scoping information from mac...
Linkage
Describes symbol linkage.
LLVM_NODISCARD bool empty() const
bool useRangesSection() const
Returns whether ranges section should be emitted.
StringRef getName() const
Return a constant reference to the value's name.
void endFunctionImpl(const MachineFunction *MF) override
Gather and emit post-function debug information.
bool isUndefDebugValue() const
Return true if the instruction is a debug value which describes a part of a variable as unavailable...
iterator_range< debug_compile_units_iterator > debug_compile_units() const
Return an iterator for all DICompileUnits listed in this Module's llvm.dbg.cu named metadata node and...
bool shareAcrossDWOCUs() const
MCSection * getDwarfGnuPubNamesSection() const
Optional< StringRef > getSource() const
void EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) const
Emit something like ".long Hi-Lo" where the size in bytes of the directive is specified by Size and H...
static void emitRangeList(DwarfDebug &DD, AsmPrinter *Asm, MCSymbol *Sym, const Ranges &R, const DwarfCompileUnit &CU, unsigned BaseAddressx, unsigned OffsetPair, unsigned StartxLength, unsigned EndOfList, StringRef(*StringifyEnum)(unsigned), bool ShouldUseBaseAddress, PayloadEmitter EmitPayload)
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
Base class for debug information backends.
static uint64_t makeTypeSignature(StringRef Identifier)
Perform an MD5 checksum of Identifier and return the lower 64 bits.
unsigned getMacinfoType() const
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
StringRef getValue() const
MachineLocation getLoc() const
DwarfCompileUnit * getSkeleton() const
void skippedNonDebugFunction() override
const Module * getModule() const
void emitStrings(MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
Emit all of the strings to the section given.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
const bool GenerateComments
Only verbose textual output needs comments.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
void addDIETypeSignature(DIE &Die, uint64_t Signature)
Add a type's DW_AT_signature and set the declaration flag.
DIScopeArray getRetainedTypes() const
DIEValue findAttribute(dwarf::Attribute Attribute) const
Find a value in the DIE with the attribute given.
MCSection * getDwarfLoclistsDWOSection() const
ArrayRef< LexicalScope * > getAbstractScopesList() const
getAbstractScopesList - Return a reference to list of abstract scopes.
SmallVector< RangeSpan, 2 > Ranges
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
void addFragmentOffset(const DIExpression *Expr)
If applicable, emit an empty DW_OP_piece / DW_OP_bit_piece to advance to the fragment described by Ex...
DILocalScope * getScope() const
Get the local scope for this label.
MCSymbol * getLabelBeforeInsn(const MachineInstr *MI)
Return Label preceding the instruction.
StringRef LocListEncodingString(unsigned Encoding)
reverse_iterator rbegin()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCSection * getDwarfAccelNamespaceSection() const
static const char *const DWARFGroupName
void stable_sort(R &&Range)
const MCSymbol * getSectionLabel(const MCSection *S)
void emitInt8(int Value) const
Emit a byte directive and value.
LLVM Value Representation.
void addStringOffsetsStart()
Add the DW_AT_str_offsets_base attribute to the unit DIE.
const DILocalVariable * getDebugVariable() const
Return the debug variable referenced by this DBG_VALUE instruction.
friend class NonTypeUnitContext
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
void emitAbbrevs(MCSection *)
Emit a set of abbreviations to the specific section.
void addSignedConstant(int64_t Value)
Emit a signed constant.
void addUInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer)
Add an unsigned integer attribute data and value.
const DataLayout & getDataLayout() const
Return information about data layout.
MachineModuleInfo * MMI
Collected machine module information.
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
void setTagOffset(uint8_t TO)
void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
iterator_range< global_iterator > globals()
StringRef - Represent a constant reference to a string, i.e.
APInt bitcastToAPInt() const
void emitUnits(bool UseOffsets)
Emit all of the units to the section listed with the given abbreviation section.
MCSection * getDwarfRangesSection() const
Register getReg() const
getReg - Returns the register number.
bool TimePassesIsEnabled
If the user specifies the -time-passes argument on an LLVM tool command line then the value of this b...
static bool isObjCClass(StringRef Name)
void beginFunctionImpl(const MachineFunction *MF) override
Gather pre-function debug information.
DILocalScope * getScope() const
Get the local scope for this variable.
Builder for DebugLocStream entries.
for(unsigned i=Desc.getNumOperands(), e=OldMI.getNumOperands();i !=e;++i)
const MachineOperand & getOperand(unsigned i) const
This struct describes target specific location.
bool isFragment() const
Return whether this is a piece of an aggregate variable.
bool isCPlusPlus(SourceLanguage S)
const ConstantInt * getCImm() const
MCSymbol * getLabelBegin() const
static void emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT, const DbgValueLoc &Value, DwarfExpression &DwarfExpr)
MCSymbol * createTempSymbol(const Twine &Name) const
bool addMachineRegExpression(const TargetRegisterInfo &TRI, DIExpressionCursor &Expr, unsigned MachineReg, unsigned FragmentOffsetInBits=0)
Emit a machine register location.
bool getFlag(MIFlag Flag) const
Return whether an MI flag is set.
ArrayRef< List > getLists() const
bool empty()
empty - Return true if there is any lexical scope information available.
Wrapper class representing virtual and physical registers.
LexicalScope * getCurrentFunctionScope() const
getCurrentFunctionScope - Return lexical scope for the current function.
void emitInt16(int Value) const
Emit a short directive and value.
detail::enumerator< R > enumerate(R &&TheRange)
Given an input range, returns a new range whose values are are pair (A,B) such that A is the 0-based ...
StringRef getName() const
This file describes how to lower LLVM code to machine code.
MCSection * getDwarfLoclistsSection() const
A single location or constant.
Basic type, like 'int' or 'float'.
unsigned getIndex(const MCSymbol *Sym, bool TLS=false)
Returns the index into the address pool with the given label/symbol.