[PATCH] D125387: Build fix for ValueMap:resize

Pedro Olsen Ferreira via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 07:08:40 PDT 2022


arkangath created this revision.
arkangath added a reviewer: mehdi_amini.
Herald added a project: All.
arkangath requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The underlying map type (DenseMap) has had its resize() function renamed to reserve() as part of c04fc7a60ff4ea4610ea157be006c9771224a7b6 (SVN 264026).

This is only visible when the member function is called, as it is template type name dependent.

It could be argued that the function being fixed here should also be renamed to reserve(), but that's an interface change, and I'd rather get a build fix in first.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125387

Files:
  llvm/include/llvm/IR/ValueMap.h


Index: llvm/include/llvm/IR/ValueMap.h
===================================================================
--- llvm/include/llvm/IR/ValueMap.h
+++ llvm/include/llvm/IR/ValueMap.h
@@ -141,7 +141,7 @@
   size_type size() const { return Map.size(); }
 
   /// Grow the map so that it has at least Size buckets. Does not shrink
-  void resize(size_t Size) { Map.resize(Size); }
+  void resize(size_t Size) { Map.reserve(Size); }
 
   void clear() {
     Map.clear();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125387.428651.patch
Type: text/x-patch
Size: 463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220511/da9154fa/attachment.bin>


More information about the llvm-commits mailing list