<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Oct 4, 2017, at 2:21 PM, Roman Popov <<a href="mailto:ripopov@gmail.com" class="">ripopov@gmail.com</a>> wrote:</div><div class=""><div dir="ltr" class="">In conclusion: <div class="">Should AST matchers should return non-const pointers to comply with Clang coding standard for immutable objects?<br class=""></div></div></div></blockquote><div><br class=""></div>I think it is more likely than not that the Clang ASTs will gradually standardize on taking non-const pointers.  Given that AST matchers tend to create out-of-tree dependencies, I think it would be better for them to go ahead and work primarily with non-const pointers.</div><div><br class=""></div><div>If you want to do some of the work to make the ASTs traffic in non-const pointers, that would be good, too, although we should first get consensus that that's the direction we want to go in.</div><div><br class=""></div><div>John.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">2017-10-04 11:14 GMT-07:00 John McCall via cfe-dev <span dir="ltr" class=""><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br class="">
> On Oct 4, 2017, at 3:30 AM, Csaba Raduly via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class="">
><br class="">
> On Wed, Oct 4, 2017 at 2:20 AM, John McCall via cfe-dev<br class="">
> <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class="">
>><br class="">
>> The AST is largely immutable by design, and the best solution would probably<br class="">
>> be to adopt what LLVM did to Type and just mass-refactor code to stop<br class="">
>> passing around const pointers at all.<br class="">
><br class="">
> If the AST is meant to be immutable, why not pass const<br class="">
> {pointers,references} around?<br class="">
<br class="">
</span>If the objects are actually immutable, const is just noise repeated everywhere, because a non-const object is basically a useless type.<br class="">
<br class="">
John.<br class="">
<div class="HOEnZb"><div class="h5">______________________________<wbr class="">_________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/cfe-dev</a><br class="">
</div></div></blockquote></div><br class=""></div></div></div>
</div></blockquote></div><br class=""></body></html>