diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-04-24 16:43:10 -0400 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-04-24 16:43:10 -0400 |
commit | 65fe71be48d6b4a98a711a867d42e09c5868f1d6 (patch) | |
tree | bad38e9005642b97404dc968d38a4211b260e017 /llvm/lib/MC/MCObjectStreamer.cpp | |
parent | 03aa967c0d38313ac124f7550314879dbae9ba9d (diff) | |
download | llvm-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.cpp | 8 |
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); } |