<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, May 24, 2014 at 8:28 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">
> My first idea is to add a tablegen property like "HasPrettyPrinter = 0 or 1"<br>
> that supresses emission of the default printPretty method. Then again, we<br>
> kind of want the default version when the GNU and C++11 spellings of the<br>
> attribute are used.<br>
<br>
</div>That seems like the wrong way to go about it though, since this is a<br>
new *spelling*, not a wholly new semantic kind of attribute (which I<br>
think we really want to avoid). We could possibly attach a custom<br>
pretty printer to the spelling itself (a la a code block), but that<br>
seems a bit skeezy because the arguments are rather important and the<br>
spelling shouldn't have to care about the arguments.<br></blockquote><div><br></div><div>How about this: when generating the prettyPrint implementation, if there is a pragma spelling, call MyAttr::printPrettyPragma(...). Any attribute with a pragma spelling will have to provide this method in lib/AST/AttrImpl.cpp. </div>
</div></div></div>