erichkeane wrote:

> > > > Let's just increase to 9 bits.
> > > > Have you checked whether the size of `Stmt` or `Expr` changes when you 
> > > > do this?
> > > 
> > > 
> > > @rjmccall I've changed it to 9 bits and checked that `Stmt` and `Expr` 
> > > are still 8 bytes and 16 bytes resp..
> > 
> > 
> > I think checking just those two isn't sufficient, as this is used as a 
> > 'base' type for a few other types. We probably need to ensure that other 
> > types that use bitfields don't have this problem as well. Basically any of 
> > the other bitfield types here that implicitly use `StmtBitfields` in the 
> > mask. `NullStmt`, `CompoundStmt`, and `LabelStmt`, (and every other use of 
> > `NumStmtBits`) are all ones that need checking.
> 
> The way this works is that all of these class-specific bitfields are union'ed 
> into a single field in `Stmt`, so actually the layout of the subclasses won't 
> change as long as the size of `Stmt` doesn't.

OH! I see!  I misremembered how this works.  Disregard the above then.

https://github.com/llvm/llvm-project/pull/120341
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to