[cfe-commits] r132143 - in /cfe/trunk: lib/Frontend/TextDiagnosticPrinter.cpp test/Misc/Inputs/include.h test/Misc/include-stack-for-note-flag.cpp
Richard Trieu
rtrieu at google.com
Thu May 26 13:49:16 PDT 2011
Author: rtrieu
Date: Thu May 26 15:49:16 2011
New Revision: 132143
URL: http://llvm.org/viewvc/llvm-project?rev=132143&view=rev
Log:
Change the include stack of "instantiated from" notes to fall under the control of f/fno-diagnostics-show-note-include-stack flags. This should help with reducing diagnostic spew from macros instantiations.
Modified:
cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
cfe/trunk/test/Misc/Inputs/include.h
cfe/trunk/test/Misc/include-stack-for-note-flag.cpp
Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=132143&r1=132142&r2=132143&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Thu May 26 15:49:16 2011
@@ -343,7 +343,7 @@
// "included from" lines.
if (LastWarningLoc != PLoc.getIncludeLoc()) {
LastWarningLoc = PLoc.getIncludeLoc();
- PrintIncludeStack(Level, LastWarningLoc, SM);
+ PrintIncludeStack(Diagnostic::Note, LastWarningLoc, SM);
}
if (DiagOpts->ShowLocation) {
Modified: cfe/trunk/test/Misc/Inputs/include.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/Inputs/include.h?rev=132143&r1=132142&r2=132143&view=diff
==============================================================================
--- cfe/trunk/test/Misc/Inputs/include.h (original)
+++ cfe/trunk/test/Misc/Inputs/include.h Thu May 26 15:49:16 2011
@@ -1 +1,3 @@
+#define EQUALS(a,b) a == b
+
int foo(int x) { return x; }
Modified: cfe/trunk/test/Misc/include-stack-for-note-flag.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/include-stack-for-note-flag.cpp?rev=132143&r1=132142&r2=132143&view=diff
==============================================================================
--- cfe/trunk/test/Misc/include-stack-for-note-flag.cpp (original)
+++ cfe/trunk/test/Misc/include-stack-for-note-flag.cpp Thu May 26 15:49:16 2011
@@ -9,10 +9,20 @@
return foo(1, 1);
}
+bool macro(int x, int y) {
+ return EQUALS(&x, y);
+}
+
// STACK: error: no matching function for call to 'foo'
// STACK: In file included from
// STACK: note: candidate function not viable
+// STACK: error: comparison between pointer and integer
+// STACK: In file included from
+// STACK: note: instantiated from:
// STACKLESS: error: no matching function for call to 'foo'
// STACKLESS-NOT: In file included from
// STACKLESS: note: candidate function not viable
+// STACKLESS: error: comparison between pointer and integer
+// STACKLESS-NOT: In file included from
+// STACKLESS: note: instantiated from:
More information about the cfe-commits
mailing list