aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>2020-04-24 16:43:10 -0400
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>2020-04-24 16:43:10 -0400
commit65fe71be48d6b4a98a711a867d42e09c5868f1d6 (patch)
treebad38e9005642b97404dc968d38a4211b260e017 /llvm/lib/MC/MCObjectStreamer.cpp
parent03aa967c0d38313ac124f7550314879dbae9ba9d (diff)
downloadllvm-65fe71be48d6b4a98a711a867d42e09c5868f1d6.zip
llvm-65fe71be48d6b4a98a711a867d42e09c5868f1d6.tar.gz
llvm-65fe71be48d6b4a98a711a867d42e09c5868f1d6.tar.bz2
Revert "[MC] Fix quadratic behavior in addPendingLabel()"
This reverts commit e98f73a629075ae3b9c4d5317bead5a122d69865.
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index fd4422f..5bb8e76 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -59,8 +59,12 @@ void MCObjectStreamer::addPendingLabel(MCSymbol* S) {
CurSection->addPendingLabel(S, CurSubsectionIdx);
// Add this Section to the list of PendingLabelSections.
- PendingLabelSections.insert(CurSection);
- } else
+ auto SecIt = std::find(PendingLabelSections.begin(),
+ PendingLabelSections.end(), CurSection);
+ if (SecIt == PendingLabelSections.end())
+ PendingLabelSections.push_back(CurSection);
+ }
+ else
// There is no Section / Subsection for this label yet.
PendingLabels.push_back(S);
}