#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/MC/MCSectionELF.h"
using namespace llvm;
MCObjectStreamer::MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB,
// When bundling is enabled, we don't want to add data to a fragment that
// already has instructions (see MCELFStreamer::EmitInstToData for details)
if (!F || (Assembler->isBundlingEnabled() && F->hasInstructions())) {
- F = new MCDataFragment();
+ const auto *Sec = dyn_cast<MCSectionELF>(&getCurrentSectionData()->getSection());
+ if (Sec && Sec->getSectionName().startswith(".zdebug_"))
+ F = new MCCompressedFragment();
+ else
+ F = new MCDataFragment();
insert(F);
}
return F;
void MCObjectStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
getAssembler().getOrCreateSymbolData(*Symbol);
- Symbol->setVariableValue(AddValueSymbols(Value));
+ AddValueSymbols(Value);
+ MCStreamer::EmitAssignment(Symbol, Value);
}
void MCObjectStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) {
void MCObjectStreamer::FinishImpl() {
// Dump out the dwarf file & directory tables and line tables.
const MCSymbol *LineSectionSymbol = NULL;
- if (!getContext().getMCLineTableSymbols().empty() ||
- getContext().hasDwarfFiles())
- LineSectionSymbol = MCDwarfFileTable::Emit(this);
+ if (getContext().hasMCLineSections())
+ LineSectionSymbol = MCDwarfLineTable::Emit(this);
// If we are generating dwarf for assembly source files dump out the sections.
if (getContext().getGenDwarfForAssembly())