[cfe-dev] Switching terminology from 'instantiation' to 'expansion' for macros?

Chandler Carruth chandlerc at google.com
Fri Jul 8 01:15:37 PDT 2011

On Fri, Jul 8, 2011 at 12:30 AM, John McCall <rjmccall at apple.com> wrote:

> On Jul 7, 2011, at 9:10 PM, Chandler Carruth wrote:
> > The only other term I've thought about is 'replacement' as that's what
> the standard uses in most cases. However, for diagnostics and thinking about
> how the preprocessor works, I actually find 'expansion' much more helpful.
> However, if others like the C standard's 'replacement' terminology, I'd be
> down with that. =]
> I like 'expansion'.  Specifically, I like "expanded from macro here", or
> something like that.  I wouldn't try to call out specific cases of where the
> text came from;  there's a lot of value in having a consistent message for
> these, because users can recognize the shape of a macro-expansion note at a
> glance without having to actually read it.

John and I chatted on IRC about various wordings for these notes. He was
particularly concerned about keeping them short and concise, which I agree
with, and hopefully the macro name itself won't negatively impact that too
much. Based on your suggestion my two candidate wordings would be:

"note: expanded from macro 'foo':"


"note: expanded from macro 'foo' defined here:"

The latter is a bit wordy, but helps give context to the snippet that
follows, and has good structural similarity to the template message:
"note: in instantiation of template class 'foo' requested here:"

One concern with just removing "defined" is the ambiguity of "here"
referring to either where the expansion occurs or the definition. Without
the "here", the snippet would hopefully associate with the "macro 'foo'",
but it's still a touch vague...

More thoughts on wording welcome!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110708/47e8eac3/attachment.html>

More information about the cfe-dev mailing list