[clang-tools-extra] [clang] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (PR #71417)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 20 06:15:42 PST 2024


AaronBallman wrote:

> > I had an offline discussion with @Endilll during my morning office hours today, and our current plan is:
> > 
> > 1. Remove `Implicit` from the enumeration, rename `Call` and `List` to `ParenList` and `BraceList`, respectively
> > 2. Add a new bit to the bit-field for `CXXNewExpr` to track "has an initializer" instead of encoding it as in-band information in the initialization style.
> > 3. Use that new bit internally in `CXXNewExpr`, update serialization and whatnot accordingly.
> > 
> > This should bring us back to the enumeration mapping directly to syntax but removes the strange in-band nature of how the original enumeration was being used.
> 
> Thank you! I really like how this direction, that both keeps the benefit of simplified implementation and makes the enumeration values cleaner. Of course this resolves, all concerns that we have with this change.

Thank you for raising the concern, I think we ended up with a cleaner solution in the end!

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


More information about the cfe-commits mailing list