[cfe-dev] Re-setting a bitfield width expression.

John McCall rjmccall at apple.com
Fri Jul 8 00:32:13 PDT 2011


On Jul 7, 2011, at 11:22 PM, Enea Zaffanella wrote:
> In our application (working at the source code level) we sometimes
> replace expressions in the AST by equivalent ones and this also happens
> for bitfield width expressions.
> Would it be OK if we add in a method such as the following:
> 
> void removeBitWidth() {
>  assert(isBitField() && "no bitwidth to remove");
>  InitializerOrBitWidth.setPointer(0);
> }
> 
> As an alternative (which is enough for our purposes), we could weaken
> the assertion in setBitWidth as follows:

I like the remove option.

> While at it, we noted a naming mismatch between methods isBitField
> (Field is capitalized here) and isUnnamedBitfield (field is not
> capitalized). It looks like elsewhere the second form was preferred.
> Is it OK if we change isBitField to isBitfield for consistency?

Fine by me.

John.



More information about the cfe-dev mailing list