[llvm] r264026 - Rename DenseMap::resize() into DenseMap::reserve() (NFC)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 22 00:20:01 PDT 2016
Author: mehdi_amini
Date: Tue Mar 22 02:20:00 2016
New Revision: 264026
URL: http://llvm.org/viewvc/llvm-project?rev=264026&view=rev
Log:
Rename DenseMap::resize() into DenseMap::reserve() (NFC)
This is more coherent with usual containers.
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/include/llvm/ADT/DenseMap.h
llvm/trunk/include/llvm/Transforms/InstCombine/InstCombineWorklist.h
llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=264026&r1=264025&r2=264026&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Tue Mar 22 02:20:00 2016
@@ -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();
Modified: llvm/trunk/include/llvm/Transforms/InstCombine/InstCombineWorklist.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/InstCombine/InstCombineWorklist.h?rev=264026&r1=264025&r2=264026&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/InstCombine/InstCombineWorklist.h (original)
+++ llvm/trunk/include/llvm/Transforms/InstCombine/InstCombineWorklist.h Tue Mar 22 02:20:00 2016
@@ -64,7 +64,7 @@ public:
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)) {
Modified: llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp?rev=264026&r1=264025&r2=264026&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp Tue Mar 22 02:20:00 2016
@@ -916,7 +916,7 @@ CFLAAResult::FunctionInfo CFLAAResult::b
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));
More information about the llvm-commits
mailing list