[llvm] [Attributor][FIX] Track returned pointer offsets (PR #110534)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 11:40:48 PDT 2024


================
@@ -1092,13 +1053,34 @@ struct AAPointerInfoImpl
   virtual int64_t numOffsetBins() const override {
     return State::numOffsetBins();
   }
-  virtual bool reachesReturn() const override { return ReachesReturn; }
-  ChangeStatus setReachesReturn(bool Val) {
-    if (ReachesReturn == Val)
-      return ChangeStatus::UNCHANGED;
+  virtual bool reachesReturn() const override {
+    return !ReturnedOffsets.isUnassigned();
+  }
+  virtual void addReturnedOffsets(OffsetInfo &OI) const override {
----------------
shiltian wrote:

I suggest renaming it to `addReturnedOffsetsTo` to make it more clear that this is not to modify its own offset.

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


More information about the llvm-commits mailing list