mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-15 17:58:50 +00:00
Avoid unnecessary section switching. NFC.
llvm-svn: 237913
This commit is contained in:
parent
ef656a945b
commit
e11015eff3
@ -147,8 +147,8 @@ public:
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -728,7 +728,7 @@ public:
|
||||
/// \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
|
||||
|
@ -442,8 +442,7 @@ bool MCContext::isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID) {
|
||||
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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user