On Tue, May 29, 2012 at 5:34 PM, Anna Zaks <[email protected]> wrote: > + // If the function is defined as a builtin macro, do not show > macro > + // expansion. > + SourceLocation SL = SizeOfArg->getExprLoc(); > + SourceRange DSR = Dest->getSourceRange(); > + SourceRange SSR = SizeOfArg->getSourceRange(); > + SourceManager &SM = PP.getSourceManager(); > + > + if (SM.isMacroArgExpansion(SL)) { > + ReadableName = Lexer::getImmediateMacroName(SL, SM, LangOpts); > + SL = SM.getSpellingLoc(SL); > + DSR = SourceRange(SM.getSpellingLoc(DSR.getBegin()), > + SM.getSpellingLoc(DSR.getEnd())); > + SSR = SourceRange(SM.getSpellingLoc(SSR.getBegin()), > + SM.getSpellingLoc(SSR.getEnd())); > + } >
I'm not terribly fond of this kind of highly customized printing logic when we may not even emit the diagnostic. 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?
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
