2222#include " lld/Common/ErrorHandler.h"
2323#include " llvm/ADT/CachedHashString.h"
2424#include " llvm/ADT/DenseMap.h"
25- #include " llvm/ADT/DenseSet.h"
2625#include " llvm/ADT/MapVector.h"
2726#include " llvm/ADT/SetVector.h"
2827#include " llvm/ADT/SmallSet.h"
3635#include " llvm/Support/VirtualFileSystem.h"
3736#include < memory>
3837#include < optional>
38+ #include < set>
3939
4040#define DEBUG_TYPE " bp-section-orderer"
4141
@@ -61,7 +61,7 @@ template <class D> struct BPOrderer {
6161 bool forDataCompression,
6262 bool compressionSortStartupFunctions, bool verbose,
6363 llvm::ArrayRef<Section *> sections,
64- const DenseMap<CachedHashStringRef, DenseSet <unsigned >>
64+ const DenseMap<CachedHashStringRef, std::set <unsigned >>
6565 &rootSymbolToSectionIdxs)
6666 -> llvm::DenseMap<const Section *, int>;
6767
@@ -78,7 +78,7 @@ static SmallVector<std::pair<unsigned, UtilityNodes>> getUnsForCompression(
7878 ArrayRef<const typename D::Section *> sections,
7979 const DenseMap<const void *, uint64_t > §ionToIdx,
8080 ArrayRef<unsigned > sectionIdxs,
81- DenseMap<unsigned , SmallVector<unsigned >> *duplicateSectionIdxs,
81+ DenseMap<unsigned , SmallVector<unsigned , 0 >> *duplicateSectionIdxs,
8282 BPFunctionNode::UtilityNodeT &maxUN) {
8383 TimeTraceScope timeScope (" Build nodes for compression" );
8484
@@ -162,7 +162,7 @@ auto BPOrderer<D>::computeOrder(
162162 StringRef profilePath, bool forFunctionCompression, bool forDataCompression,
163163 bool compressionSortStartupFunctions, bool verbose,
164164 ArrayRef<Section *> sections,
165- const DenseMap<CachedHashStringRef, DenseSet <unsigned >>
165+ const DenseMap<CachedHashStringRef, std::set <unsigned >>
166166 &rootSymbolToSectionIdxs) -> DenseMap<const Section *, int > {
167167 TimeTraceScope timeScope (" Setup Balanced Partitioning" );
168168 DenseMap<const void *, uint64_t > sectionToIdx;
@@ -186,7 +186,7 @@ auto BPOrderer<D>::computeOrder(
186186 }
187187 auto &traces = reader->getTemporalProfTraces ();
188188
189- DenseMap <unsigned , BPFunctionNode::UtilityNodeT> sectionIdxToFirstUN;
189+ MapVector <unsigned , BPFunctionNode::UtilityNodeT> sectionIdxToFirstUN;
190190 for (size_t traceIdx = 0 ; traceIdx < traces.size (); traceIdx++) {
191191 uint64_t currentSize = 0 , cutoffSize = 1 ;
192192 size_t cutoffTimestamp = 1 ;
@@ -263,7 +263,7 @@ auto BPOrderer<D>::computeOrder(
263263
264264 // Map a section index (order directly) to a list of duplicate section indices
265265 // (not ordered directly).
266- DenseMap<unsigned , SmallVector<unsigned >> duplicateSectionIdxs;
266+ DenseMap<unsigned , SmallVector<unsigned , 0 >> duplicateSectionIdxs;
267267 auto unsForFunctionCompression = getUnsForCompression<D>(
268268 sections, sectionToIdx, sectionIdxsForFunctionCompression,
269269 &duplicateSectionIdxs, maxUN);
0 commit comments