[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Tue May 28 12:22:05 PDT 2024


Endilll wrote:

> > `const_cast` here is a relatively recent addition, and I checked out with @erichkeane that the use case (pack expansion) is legit. According to the approach you're suggesting, the one who wrote this `const_cast` should instead refactor the MLTAL to use `llvm::MutableArrayRef`.
> 
> Take a guess who that person was 😁
>
> > I tried, pretty hard, but ultimately failed. The change turned out to be touching every corner of our template engine, with no end in sight.
> 
> Oh well, sorry I wasn't around to advise against it.

No worries, I was eliminating `const_cast`s on my own, which resulted in 84aee95124549c5d13e22053af254e3fcc02bc84, 8aa6511f4209bba33a74c4ef6e208fda5c0f3d27, df575be9d864886684e536cd76c5a96bb0d443a6, and f7b0b99c52ee36ed6ca8abcce74a752e483768d6.

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


More information about the cfe-commits mailing list