if (SP->getUnit()->getEmissionKind() == DICompileUnit::NoDebug)
return;
+ SectionLabels.insert(std::make_pair(&Asm->getFunctionBegin()->getSection(),
+ Asm->getFunctionBegin()));
+
DwarfCompileUnit &CU = getOrCreateDwarfCompileUnit(SP->getUnit());
// Set DwarfDwarfCompileUnitID in MCContext to the Compile Unit this function
if (!Base && (P.second.size() > 1 || DwarfVersion < 5) &&
(CU.getCUNode()->getRangesBaseAddress() || DwarfVersion >= 5)) {
BaseIsSet = true;
- // FIXME/use care: This may not be a useful base address if it's not
- // the lowest address/range in this object.
- Base = P.second.front()->getStart();
+ Base = DD.getSectionLabel(&P.second.front()->getStart()->getSection());
if (DwarfVersion >= 5) {
- Base = DD.getSectionLabel(&Base->getSection());
Asm->OutStreamer->AddComment("DW_RLE_base_addressx");
Asm->OutStreamer->EmitIntValue(dwarf::DW_RLE_base_addressx, 1);
Asm->OutStreamer->AddComment(" base address index");
return Asm->OutStreamer->getContext().getDwarfVersion();
}
-void DwarfDebug::addSectionLabel(const MCSymbol *Sym) {
- SectionLabels.insert(std::make_pair(&Sym->getSection(), Sym));
-}
-
const MCSymbol *DwarfDebug::getSectionLabel(const MCSection *S) {
return SectionLabels.find(S)->second;
}