diff --git a/lld/MachO/UnwindInfoSection.cpp b/lld/MachO/UnwindInfoSection.cpp --- a/lld/MachO/UnwindInfoSection.cpp +++ b/lld/MachO/UnwindInfoSection.cpp @@ -146,7 +146,7 @@ Symbol *canonicalizePersonality(Symbol *); uint64_t unwindInfoSize = 0; - std::vector symbolsVec; + SmallVector symbolsVec; CompactUnwindLayout cuLayout; std::vector> commonEncodings; EncodingMap commonEncodingIndexes; diff --git a/llvm/include/llvm/ADT/MapVector.h b/llvm/include/llvm/ADT/MapVector.h --- a/llvm/include/llvm/ADT/MapVector.h +++ b/llvm/include/llvm/ADT/MapVector.h @@ -10,7 +10,7 @@ /// This file implements a map that provides insertion order iteration. The /// interface is purposefully minimal. The key is assumed to be cheap to copy /// and 2 copies are kept, one for indexing in a DenseMap, one for iteration in -/// a std::vector. +/// a SmallVector. /// //===----------------------------------------------------------------------===// @@ -24,16 +24,15 @@ #include #include #include -#include namespace llvm { /// This class implements a map that also provides access to all stored values -/// in a deterministic order. The values are kept in a std::vector and the +/// in a deterministic order. The values are kept in a SmallVector<*, 0> and the /// mapping is done with DenseMap from Keys to indexes in that vector. -template, - typename VectorType = std::vector>> +template , + typename VectorType = SmallVector, 0>> class MapVector { MapType Map; VectorType Vector; diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -266,7 +266,9 @@ unsigned NumInsts = 0; // Map from callee ValueId to profile count. Used to accumulate profile // counts for all static calls to a given callee. - MapVector CallGraphEdges; + MapVector, + std::vector>> + CallGraphEdges; SetVector RefEdges, LoadRefEdges, StoreRefEdges; SetVector TypeTests; SetVector TypeTestAssumeVCalls, diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -975,8 +975,8 @@ void AliasInitializer::initializeAliases( llvm::MapVector &visitedSymbols, llvm::MapVector &symbolToAlias) { - std::vector> unprocessedAliases = - visitedSymbols.takeVector(); + SmallVector, 0> + unprocessedAliases = visitedSymbols.takeVector(); llvm::stable_sort(unprocessedAliases, [](const auto &lhs, const auto &rhs) { return lhs.second < rhs.second; });