1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Rename DenseMap::resize() into DenseMap::reserve() (NFC)

This is more coherent with usual containers.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 264026
This commit is contained in:
Mehdi Amini 2016-03-22 07:20:00 +00:00
parent e99410735e
commit c95ffc2050
3 changed files with 3 additions and 3 deletions

View File

@ -84,7 +84,7 @@ public:
/// Grow the densemap so that it can contain at least Size items before /// Grow the densemap so that it can contain at least Size items before
/// resizing again. This means somewhat more than Size buckets because /// resizing again. This means somewhat more than Size buckets because
/// densemap resizes upon reaching 3/4 full. /// densemap resizes upon reaching 3/4 full.
void resize(size_type Size) { void reserve(size_type Size) {
// Size *= (4/3), rounding up. // Size *= (4/3), rounding up.
Size = (Size * 4 + 2) / 3; Size = (Size * 4 + 2) / 3;
incrementEpoch(); incrementEpoch();

View File

@ -64,7 +64,7 @@ public:
void AddInitialGroup(ArrayRef<Instruction *> List) { void AddInitialGroup(ArrayRef<Instruction *> List) {
assert(Worklist.empty() && "Worklist must be empty to add initial group"); assert(Worklist.empty() && "Worklist must be empty to add initial group");
Worklist.reserve(List.size()+16); Worklist.reserve(List.size()+16);
WorklistMap.resize(List.size()); WorklistMap.reserve(List.size());
DEBUG(dbgs() << "IC: ADDING: " << List.size() << " instrs to worklist\n"); DEBUG(dbgs() << "IC: ADDING: " << List.size() << " instrs to worklist\n");
unsigned Idx = 0; unsigned Idx = 0;
for (Instruction *I : reverse(List)) { for (Instruction *I : reverse(List)) {

View File

@ -916,7 +916,7 @@ CFLAAResult::FunctionInfo CFLAAResult::buildSetsFrom(Function *Fn) {
buildGraphFrom(*this, Fn, ReturnedValues, Map, Graph); buildGraphFrom(*this, Fn, ReturnedValues, Map, Graph);
DenseMap<GraphT::Node, Value *> NodeValueMap; DenseMap<GraphT::Node, Value *> NodeValueMap;
NodeValueMap.resize(Map.size()); NodeValueMap.reserve(Map.size());
for (const auto &Pair : Map) for (const auto &Pair : Map)
NodeValueMap.insert(std::make_pair(Pair.second, Pair.first)); NodeValueMap.insert(std::make_pair(Pair.second, Pair.first));