mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Re-land [MC] Fix quadratic behavior in addPendingLabel
This was discovered when compiling large unity/blob/jumbo files. Differential Revision: https://reviews.llvm.org/D78775
This commit is contained in:
parent
eb1b2706f9
commit
0437c703af
@ -9,6 +9,7 @@
|
||||
#ifndef LLVM_MC_MCOBJECTSTREAMER_H
|
||||
#define LLVM_MC_MCOBJECTSTREAMER_H
|
||||
|
||||
#include "llvm/ADT/SetVector.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCSection.h"
|
||||
@ -38,7 +39,7 @@ class MCObjectStreamer : public MCStreamer {
|
||||
bool EmitEHFrame;
|
||||
bool EmitDebugFrame;
|
||||
SmallVector<MCSymbol *, 2> PendingLabels;
|
||||
SmallVector<MCSection*, 2> PendingLabelSections;
|
||||
SmallSetVector<MCSection *, 4> PendingLabelSections;
|
||||
unsigned CurSubsectionIdx;
|
||||
struct PendingMCFixup {
|
||||
const MCSymbol *Sym;
|
||||
|
@ -59,12 +59,8 @@ void MCObjectStreamer::addPendingLabel(MCSymbol* S) {
|
||||
CurSection->addPendingLabel(S, CurSubsectionIdx);
|
||||
|
||||
// Add this Section to the list of PendingLabelSections.
|
||||
auto SecIt = std::find(PendingLabelSections.begin(),
|
||||
PendingLabelSections.end(), CurSection);
|
||||
if (SecIt == PendingLabelSections.end())
|
||||
PendingLabelSections.push_back(CurSection);
|
||||
}
|
||||
else
|
||||
PendingLabelSections.insert(CurSection);
|
||||
} else
|
||||
// There is no Section / Subsection for this label yet.
|
||||
PendingLabels.push_back(S);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user