git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237913
91177308-0d34-0410-b5e6-
96231b3b80d8
bool emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo,
unsigned Size) override;
- bool mayHaveInstructions() const override {
- return getCurrentSectionData()->hasInstructions();
+ bool mayHaveInstructions(const MCSection &Sec) const override {
+ return Assembler->getOrCreateSectionData(Sec).hasInstructions();
}
};
/// \brief Finish emission of machine code.
void Finish();
- virtual bool mayHaveInstructions() const { return true; }
+ virtual bool mayHaveInstructions(const MCSection &Sec) const { return true; }
};
/// Create a dummy machine code streamer, which does nothing. This is useful for
void MCContext::finalizeDwarfSections(MCStreamer &MCOS) {
std::vector<const MCSection *> Keep;
for (const MCSection *Sec : SectionsForRanges) {
- MCOS.SwitchSection(Sec); // FIXME: pass the section to mayHaveInstructions
- if (MCOS.mayHaveInstructions())
+ if (MCOS.mayHaveInstructions(*Sec))
Keep.push_back(Sec);
}
SectionsForRanges.clear();