On Mon, Jul 2, 2012 at 1:20 AM, Enea Zaffanella <[email protected]>wrote:
> Hello Richard. > > The commit below has removed a couple of FieldDecl public methods > (setBitWidth and removeBitWidth) that are used in one of our applications. > I understand that you removed them because they are unused in the clang > sources, thereby looking useless, so the questions are: > > 1) OK to reintroduce them? (we need to modify some AST nodes in place and > one of the changes has to do with bitfield size expressions) > We generally try to keep the AST immutable, but I appreciate this is a regression for you, so I think it's OK to add these back. I do wonder if there's another way of approaching your use case that would remove the need for these mutators, such as creating a new FieldDecl rather than modifying the existing one. I assume you're aware that changing the bitwidth can have a non-trivial effect on the semantic properties of expressions which use the bitfield (so you probably shouldn't do this if you already have expressions referencing the field). > 2) is there any convention for flagging this kind of "unused" methods as > "used", so as to avoid future removals? > Not that I know of. A comment would be useful. On 06/10/2012 05:12 AM, Richard Smith wrote: > >> Author: rsmith >> Date: Sat Jun 9 22:12:00 2012 >> New Revision: 158288 >> >> URL: >> http://llvm.org/viewvc/llvm-**project?rev=158288&view=rev<http://llvm.org/viewvc/llvm-project?rev=158288&view=rev> >> Log: >> PR13064: Store whether an in-class initializer uses direct or copy >> initialization, and use that information to produce the right kind of >> initialization during template instantiation. >> > > [...] > > > - void setBitWidth(Expr *BW) { >> - assert(!InitializerOrBitWidth.**getPointer() && >> - "bit width or initializer already set"); >> - InitializerOrBitWidth.**setPointer(BW); >> - InitializerOrBitWidth.setInt(**1); >> - } >> - /// removeBitWidth - Remove the bitfield width from this member. >> - void removeBitWidth() { >> - assert(isBitField() && "no bit width to remove"); >> - InitializerOrBitWidth.**setPointer(0); >> >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
