<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;">On Mar 8, 2013, at 12:12 PM, Armand Leclercq <<a href="mailto:marman.email@gmail.com">marman.email@gmail.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">I have another question.<br><br>I am currently using PPCallbacks in order to check coding-style in macros.<br>In order to do so, I'm using MacroDefined callback and I correctly get<br>the macro name, but I cannot figure out how to get the macro arguments<br>locations.<br><br>I get the macro argument string with<br>clang::MacroInfo::arg_begin()::getNameStart()<br><br>And then, I can figure out the offset with the getLength() method, but<br>it cannot help me to handle correctly the following example :<br><br>#define MAX(Arg, Arg)<br>#define MAX(Arg, Arg)<br></div></blockquote><div><br></div><div>We don't keep track of the argument locations.</div><div><br></div><div>We could either:</div><div>1) Store the argument source locations in MacroInfo</div><div>2) Lazily re-lex and cache the argument locations of a MacroInfo when they are requested.</div><div><br></div><div>I personally am leaning towards 2) since the argument locations don't have any use for the compiler currently.</div><div><br></div><div>Are you interested in working on a patch ?</div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><br>--<span class="Apple-converted-space"> </span><br>Armand Leclercq<br>EPITA 2013 Assistant C/Unix<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br></body></html>