[llvm] [NFC] Add `const` for readability (PR #116611)

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 12:20:58 PST 2024


================
@@ -581,30 +581,30 @@ class InnerLoopVectorizer {
   virtual void printDebugTracesAtEnd() {}
 
   /// The original loop.
-  Loop *OrigLoop;
+  Loop *const OrigLoop;
 
   /// A wrapper around ScalarEvolution used to add runtime SCEV checks. Applies
   /// dynamic knowledge to simplify SCEV expressions and converts them to a
   /// more usable form.
   PredicatedScalarEvolution &PSE;
 
   /// Loop Info.
-  LoopInfo *LI;
+  LoopInfo *const LI;
----------------
jrtc27 wrote:

Yes, I know what it does. But is there a big picture here? Are you trying to add const all over LLVM? If so that needs an RFC. If not, well, why are these files so special that it's worth doing? We generally like to avoid churn unless there's a good reason for it.

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


More information about the llvm-commits mailing list