This is more coherent with usual containers.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 264026
/// Grow the densemap so that it can contain at least Size items before
/// resizing again. This means somewhat more than Size buckets because
/// densemap resizes upon reaching 3/4 full.
- void resize(size_type Size) {
+ void reserve(size_type Size) {
// Size *= (4/3), rounding up.
Size = (Size * 4 + 2) / 3;
incrementEpoch();
void AddInitialGroup(ArrayRef<Instruction *> List) {
assert(Worklist.empty() && "Worklist must be empty to add initial group");
Worklist.reserve(List.size()+16);
- WorklistMap.resize(List.size());
+ WorklistMap.reserve(List.size());
DEBUG(dbgs() << "IC: ADDING: " << List.size() << " instrs to worklist\n");
unsigned Idx = 0;
for (Instruction *I : reverse(List)) {
buildGraphFrom(*this, Fn, ReturnedValues, Map, Graph);
DenseMap<GraphT::Node, Value *> NodeValueMap;
- NodeValueMap.resize(Map.size());
+ NodeValueMap.reserve(Map.size());
for (const auto &Pair : Map)
NodeValueMap.insert(std::make_pair(Pair.second, Pair.first));