diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 4dee41f1729..5d87990198e 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -84,7 +84,7 @@ public: /// 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(); diff --git a/include/llvm/Transforms/InstCombine/InstCombineWorklist.h b/include/llvm/Transforms/InstCombine/InstCombineWorklist.h index 7961dfc7ad8..32af035d07d 100644 --- a/include/llvm/Transforms/InstCombine/InstCombineWorklist.h +++ b/include/llvm/Transforms/InstCombine/InstCombineWorklist.h @@ -64,7 +64,7 @@ public: void AddInitialGroup(ArrayRef 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)) { diff --git a/lib/Analysis/CFLAliasAnalysis.cpp b/lib/Analysis/CFLAliasAnalysis.cpp index 2c755077996..6e6df987628 100644 --- a/lib/Analysis/CFLAliasAnalysis.cpp +++ b/lib/Analysis/CFLAliasAnalysis.cpp @@ -916,7 +916,7 @@ CFLAAResult::FunctionInfo CFLAAResult::buildSetsFrom(Function *Fn) { buildGraphFrom(*this, Fn, ReturnedValues, Map, Graph); DenseMap NodeValueMap; - NodeValueMap.resize(Map.size()); + NodeValueMap.reserve(Map.size()); for (const auto &Pair : Map) NodeValueMap.insert(std::make_pair(Pair.second, Pair.first));