<div class="gmail_quote">On Tue, May 29, 2012 at 5:34 PM, Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":6sb">+          // If the function is defined as a builtin macro, do not show macro<br>
+          // expansion.<br>
+          SourceLocation SL = SizeOfArg->getExprLoc();<br>
+          SourceRange DSR = Dest->getSourceRange();<br>
+          SourceRange SSR = SizeOfArg->getSourceRange();<br>
+          SourceManager &SM  = PP.getSourceManager();<br>
+<br>
+          if (SM.isMacroArgExpansion(SL)) {<br>
+            ReadableName = Lexer::getImmediateMacroName(SL, SM, LangOpts);<br>
+            SL = SM.getSpellingLoc(SL);<br>
+            DSR = SourceRange(SM.getSpellingLoc(DSR.getBegin()),<br>
+                             SM.getSpellingLoc(DSR.getEnd()));<br>
+            SSR = SourceRange(SM.getSpellingLoc(SSR.getBegin()),<br>
+                             SM.getSpellingLoc(SSR.getEnd()));<br>
+          }</div></blockquote></div><br><div>I'm not terribly fond of this kind of highly customized printing logic when we may not even emit the diagnostic.</div><div><br></div><div>I wonder -- can we construct this information from within the diagnostic printer, and get it to fire in more circumstances? If not, is there a way to simply tell the diagnostic engine the intent -- to print the builtin name -- rather than hard coding the logic to get from here to there?</div>