[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Tue May 28 11:11:43 PDT 2024
mizvekov wrote:
> That's the opposite of my view. Mutation needs to be justified. "What if we need it later" can be used to justify anything, and if we do need it later then we change the code then. Until that point, readers can see `const` and know that things aren't being changed out from under them while reasoning about what the code does.
I agree that works well for small code bases, but in LLVM some of these changes lead to so much churn, I start to question their benefit. Speaking from a been there, done that POV.
https://github.com/llvm/llvm-project/pull/93493
More information about the cfe-commits
mailing list