<div class="gmail_quote">On Mon, Jul 2, 2012 at 1:20 AM, Enea Zaffanella <span dir="ltr"><<a href="mailto:zaffanella@cs.unipr.it" target="_blank">zaffanella@cs.unipr.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Richard.<br>
<br>
The commit below has removed a couple of FieldDecl public methods<br>
(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:<br>
<br>
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)<br></blockquote><div><br></div><div>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).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) is there any convention for flagging this kind of "unused" methods as "used", so as to avoid future removals?<br></blockquote><div><br></div><div>Not that I know of. A comment would be useful.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 06/10/2012 05:12 AM, Richard Smith wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: rsmith<br>
Date: Sat Jun  9 22:12:00 2012<br>
New Revision: 158288<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=158288&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=158288&view=rev</a><br>
Log:<br>
PR13064: Store whether an in-class initializer uses direct or copy<br>
initialization, and use that information to produce the right kind of<br>
initialization during template instantiation.<br>
</blockquote>
<br></div>
[...]<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-  void setBitWidth(Expr *BW) {<br>
-    assert(!InitializerOrBitWidth.<u></u>getPointer() &&<br>
-           "bit width or initializer already set");<br>
-    InitializerOrBitWidth.<u></u>setPointer(BW);<br>
-    InitializerOrBitWidth.setInt(<u></u>1);<br>
-  }<br>
-  /// removeBitWidth - Remove the bitfield width from this member.<br>
-  void removeBitWidth() {<br>
-    assert(isBitField() && "no bit width to remove");<br>
-    InitializerOrBitWidth.<u></u>setPointer(0);<br>
</blockquote>
</div></div></blockquote></div><br>