]> granicus.if.org Git - clang/commitdiff
Modify tree printing mode for template type diffing. If a diagnostic has
authorRichard Trieu <rtrieu@google.com>
Fri, 13 Jul 2012 21:18:32 +0000 (21:18 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 13 Jul 2012 21:18:32 +0000 (21:18 +0000)
multiple %diff's, only print the first tree and fallback to inline printing
for the rest of the diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160193 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Diagnostic.cpp

index 6e79b85a99421a700d0b0a242462d48b02c489bd..cfc07b8b4e6730d18a0fd284f3f096f6a140be77 100644 (file)
@@ -844,8 +844,9 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       const char *ArgumentEnd = Argument + ArgumentLen;
       const char *Pipe = ScanFormat(Argument, ArgumentEnd, '|');
 
-      // Print the tree.
-      if (getDiags()->PrintTemplateTree) {
+      // Print the tree.  If this diagnostic already has a tree, skip the
+      // second tree.
+      if (getDiags()->PrintTemplateTree && Tree.empty()) {
         TDT.PrintFromType = true;
         TDT.PrintTree = true;
         getDiags()->ConvertArgToString(Kind, val,