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.

llvm-svn: 132143
This commit is contained in:
Richard Trieu 2011-05-26 20:49:16 +00:00
parent 46fbc60f63
commit 17afcbe5de
3 changed files with 13 additions and 1 deletions

View File

@ -343,7 +343,7 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(Diagnostic::Level Level,
// "included from" lines.
if (LastWarningLoc != PLoc.getIncludeLoc()) {
LastWarningLoc = PLoc.getIncludeLoc();
PrintIncludeStack(Level, LastWarningLoc, SM);
PrintIncludeStack(Diagnostic::Note, LastWarningLoc, SM);
}
if (DiagOpts->ShowLocation) {

View File

@ -1 +1,3 @@
#define EQUALS(a,b) a == b
int foo(int x) { return x; }

View File

@ -9,10 +9,20 @@ int test() {
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: