[cfe-commits] r169373 - in /cfe/trunk: lib/Frontend/DiagnosticRenderer.cpp test/Misc/diag-macro-backtrace.c test/Modules/epic-fail.m

NAKAMURA Takumi geek4civic at gmail.com
Wed Dec 5 07:28:52 PST 2012


2012/12/5 Richard Smith <richard-llvm at metafoo.co.uk>:
> Author: rsmith
> Date: Wed Dec  5 05:04:55 2012
> New Revision: 169373
>
> URL: http://llvm.org/viewvc/llvm-project?rev=169373&view=rev
> Log:
> PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
> the LHS of a token paste. Use "expanded from here" instead when we're not sure
> it's actually a macro.
>
> Modified:
>     cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp
>     cfe/trunk/test/Misc/diag-macro-backtrace.c
>     cfe/trunk/test/Modules/epic-fail.m
>
> Modified: cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp?rev=169373&r1=169372&r2=169373&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp (original)
> +++ cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp Wed Dec  5 05:04:55 2012
> @@ -47,6 +47,11 @@
>     while (SM.isMacroArgExpansion(Loc))
>       Loc = SM.getImmediateExpansionRange(Loc).first;
>
> +   // If the macro's spelling has no FileID, then it's actually a token paste
> +   // or stringization (or similar) and not a macro at all.
> +   if (!SM.getFileEntryForID(SM.getFileID(SM.getSpellingLoc(Loc))))
> +     return StringRef();
> +

Richard,

It triggers a new failure in Clang :: Modules/build-fail-notes.m.
I can see
  note: expanded from here
instead of
  note: expanded from macro 'getModuleVersion'

http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/376

As far as I tried, it could be reproduced to remove entire test/Modules/Output.
I have suppressed the failure in r169375.

...Takumi



More information about the cfe-commits mailing list