Introduce a limit on the depth of the template instantiation backtrace
we will print with each error that occurs during template
instantiation. When the backtrace is longer than that, we will print
N/2 of the innermost backtrace entries and N/2 of the outermost
backtrace entries, then skip the middle entries with a note such as:

  note: suppressed 2 template instantiation contexts; use
  -ftemplate-backtrace-limit=N to change the number of template
  instantiation entries shown

This should eliminate some excessively long backtraces that aren't
providing any value.

llvm-svn: 101882
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 755fbed..1870195 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -224,7 +224,8 @@
   ErrorOccurred = false;
   FatalErrorOccurred = false;
   ErrorLimit = 0;
-  
+  TemplateBacktraceLimit = 0;
+
   NumWarnings = 0;
   NumErrors = 0;
   NumErrorsSuppressed = 0;