[llvm] InferAddressSpaces: Factor replacement loop into function (PR #104430)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 04:27:02 PDT 2024


================
@@ -842,8 +846,9 @@ unsigned InferAddressSpacesImpl::joinAddressSpaces(unsigned AS1,
   return (AS1 == AS2) ? AS1 : FlatAddrSpace;
 }
 
-bool InferAddressSpacesImpl::run(Function &F) {
-  DL = &F.getDataLayout();
+bool InferAddressSpacesImpl::run(Function &F_) {
+  F = &F_;
----------------
arsenm wrote:

this convention is followed in maybe half of places? Could also just move setting F to the constructor but that just moves the name collision (to a less bad place, I guess)

https://github.com/llvm/llvm-project/pull/104430


More information about the llvm-commits mailing list