[PATCH] D153305: [MemoryEffects][NFCI] Make the MemoryEffects class reusable

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 00:26:24 PDT 2023


nikic added a comment.

Looks fine to me, apart from the question about reinterpret_cast.



================
Comment at: llvm/include/llvm/Support/ModRef.h:58
 
-/// Summary of how a function affects memory in the program.
-///
-/// Loads from constant globals are not considered memory accesses for this
-/// interface. Also, functions may freely modify stack space local to their
-/// invocation without having to report it through these interfaces.
-class MemoryEffects {
-public:
   /// The locations at which a function might access memory.
+enum IRMemLocation {
----------------
Broken indentation?


================
Comment at: llvm/include/llvm/Support/ModRef.h:234
     Data &= Other.Data;
-    return *this;
+    return reinterpret_cast<MemoryEffectsBase &>(*this);
   }
----------------
Why does this need a reinterpret_cast?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153305/new/

https://reviews.llvm.org/D153305



More information about the llvm-commits mailing list