]> gcc.gnu.org Git - gcc.git/commitdiff
borrowck: Avoid overloading issues on 32bit architectures
authorArthur Cohen <arthur.cohen@embecosm.com>
Fri, 2 Aug 2024 09:18:51 +0000 (11:18 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 12 Aug 2024 13:07:01 +0000 (15:07 +0200)
On architectures where `size_t` is `unsigned int`, such as 32bit x86,
we encounter an issue with `PlaceId` and `FreeRegion` being aliases to
the same types. This poses an issue for overloading functions for these
two types, such as `push_subset` in that case. This commit renames one
of these `push_subset` functions to avoid the issue, but this should be
fixed with a newtype pattern for these two types.

gcc/rust/ChangeLog:

* checks/errors/borrowck/rust-bir-fact-collector.h (points): Rename
`push_subset(PlaceId, PlaceId)` to `push_subset_place(PlaceId, PlaceId)`

gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h

index bb8fedaf3db7b0899eb02a98ab1b315aaf685b39..6601c981779f9c7f4f25e85f79d128616d739b93 100644 (file)
@@ -334,7 +334,7 @@ protected: // Main collection entry points (for different categories).
                expr.get_rhs () - 1, current_bb, current_stmt);
 
     issue_read_move (expr.get_rhs ());
-    push_subset (lhs, expr.get_rhs ());
+    push_place_subset (lhs, expr.get_rhs ());
   }
 
   void visit (const CallExpr &expr) override
@@ -660,7 +660,7 @@ protected: // Subset helpers.
       }
   }
 
-  void push_subset (PlaceId lhs, PlaceId rhs)
+  void push_place_subset (PlaceId lhs, PlaceId rhs)
   {
     auto &lhs_place = place_db[lhs];
     auto &rhs_place = place_db[rhs];
This page took 0.066837 seconds and 5 git commands to generate.