[PATCH] D73993: [analyzer] Fix a couple of bugs in HTML report generation.

2020-02-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ marked an inline comment as done.
NoQ added inline comments.



Comment at: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp:612
+  return !(Range.getBegin().isMacroID() || Range.getEnd().isMacroID());
+}
+

Charusso wrote:
> Side note: I like the other form of De Morgan's laws because here I have to 
> apply it in my head every time I see such a construct. Also we are using this 
> function in negation, so I would write:
> ```lang=c
> static bool isMacro(const SourceRange &Range) {
>   return Range.getBegin().isMacroID() || Range.getEnd().isMacroID();
> }
> ```
> 
> The idiom is to write code for readability so that understandability over 
> everything else.
Objection :) I want this function to figure out if a pop-up range should be 
displayed, not whether the range is in a macro. Like, if we come up with other 
excuses for not displaying a range, we'll update this function, not make a new 
one. And if we need to check whether something is a macro in another place, 
we'll make a new function, not re-use this one.

I could do something like `shouldSkipPopUpRange()` but that'd move the 
confusing negation into the function name, making call sites harder to read.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73993/new/

https://reviews.llvm.org/D73993



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73993: [analyzer] Fix a couple of bugs in HTML report generation.

2020-02-05 Thread Artem Dergachev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG482e236e569e: [analyzer] Fix a couple of bugs in HTML report 
generation. (authored by dergachev.a).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73993/new/

https://reviews.llvm.org/D73993

Files:
  clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
  clang/test/Analysis/html_diagnostics/td-hotfix.c
  clang/test/Analysis/html_diagnostics/variable-popups-macro.c
  clang/test/Analysis/html_diagnostics/variable-popups-multiple.c
  clang/test/Analysis/html_diagnostics/variable-popups-simple.c

Index: clang/test/Analysis/html_diagnostics/variable-popups-simple.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/variable-popups-simple.c
@@ -0,0 +1,23 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo2() {
+  int a;
+  int b = 1;
+  if (b)
+bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK:  b
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   1.1
+// CHECK-SAME: 
+// CHECK-SAME: 'b' is 1
+// CHECK-SAME:   
+// CHECK-SAME: 
Index: clang/test/Analysis/html_diagnostics/variable-popups-multiple.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/variable-popups-multiple.c
@@ -0,0 +1,29 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo() {
+  int a;
+  for (unsigned i = 0; i < 3; ++i)
+if (i)
+  bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK:  i
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   2.1
+// CHECK-SAME: 
+// CHECK-SAME: 'i' is 0
+// CHECK-SAME:   
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   4.1
+// CHECK-SAME: 
+// CHECK-SAME: 'i' is 1
+// CHECK-SAME:   
+// CHECK-SAME: 
Index: clang/test/Analysis/html_diagnostics/variable-popups-macro.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/variable-popups-macro.c
@@ -0,0 +1,28 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+#define MACRO if (b)
+
+void foo2() {
+  int a;
+  int b = 1;
+  MACRO
+bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// For now we don't emit popups inside macros due to UI limitations.
+// Once we do, we should test it thoroughly.
+
+// CHECK-LABEL: 
+// CHECK-NOT:   
+// CHECK-SAME:  
+// CHECK-SAME:MACRO
+// CHECK-SAME:
+// CHECK-SAME:  if (b)
+// CHECK-SAME:
+// CHECK-SAME:  
Index: clang/test/Analysis/html_diagnostics/td-hotfix.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/td-hotfix.c
@@ -0,0 +1,31 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo() {
+  int a;
+  bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK-LABEL:
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-SAME: 2
+// CHECK-SAME:   
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   ←
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-NOT:
+// CHECK-SAME:   
+// CHECK-SAME: 1st function call argument is an uninitialized value
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-SAME: 
Index: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
===
--- clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -607,10 +607,17 @@
 )<<<";
 }
 
+static bool shouldDisplayPopUpRange(const SourceRange &Range) {
+  return !(Range.getBegin().isMacroID() || Range.getEnd().isMacroID());
+}
+
 static void
 HandlePopUpPieceStartTag(Rewriter &R,
  const std::vector &PopUpRanges) {
   for (const auto &Range : PopUpRanges) {
+if (!shouldDisplayPopUpRange(Range))
+  continue;
+
 html::HighlightRange(R, Range.getBegin(), Range.get

[PATCH] D73993: [analyzer] Fix a couple of bugs in HTML report generation.

2020-02-04 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso accepted this revision.
Charusso added a comment.
This revision is now accepted and ready to land.

Cool, thanks you!




Comment at: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp:612
+  return !(Range.getBegin().isMacroID() || Range.getEnd().isMacroID());
+}
+

Side note: I like the other form of De Morgan's laws because here I have to 
apply it in my head every time I see such a construct. Also we are using this 
function in negation, so I would write:
```lang=c
static bool isMacro(const SourceRange &Range) {
  return Range.getBegin().isMacroID() || Range.getEnd().isMacroID();
}
```

The idiom is to write code for readability so that understandability over 
everything else.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73993/new/

https://reviews.llvm.org/D73993



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73993: [analyzer] Fix a couple of bugs in HTML report generation.

2020-02-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 242466.
NoQ added a comment.

Aha, that's what those are! Great. I thought they're only for resolving 
conflicts with range highlights, which seemed kinda redundant.

Addressed all comments :)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73993/new/

https://reviews.llvm.org/D73993

Files:
  clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
  clang/test/Analysis/html_diagnostics/td-hotfix.c
  clang/test/Analysis/html_diagnostics/variable-popups-macro.c
  clang/test/Analysis/html_diagnostics/variable-popups-multiple.c
  clang/test/Analysis/html_diagnostics/variable-popups-simple.c

Index: clang/test/Analysis/html_diagnostics/variable-popups-simple.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/variable-popups-simple.c
@@ -0,0 +1,23 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo2() {
+  int a;
+  int b = 1;
+  if (b)
+bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK:  b
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   1.1
+// CHECK-SAME: 
+// CHECK-SAME: 'b' is 1
+// CHECK-SAME:   
+// CHECK-SAME: 
Index: clang/test/Analysis/html_diagnostics/variable-popups-multiple.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/variable-popups-multiple.c
@@ -0,0 +1,29 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo() {
+  int a;
+  for (unsigned i = 0; i < 3; ++i)
+if (i)
+  bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK:  i
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   2.1
+// CHECK-SAME: 
+// CHECK-SAME: 'i' is 0
+// CHECK-SAME:   
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   4.1
+// CHECK-SAME: 
+// CHECK-SAME: 'i' is 1
+// CHECK-SAME:   
+// CHECK-SAME: 
Index: clang/test/Analysis/html_diagnostics/variable-popups-macro.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/variable-popups-macro.c
@@ -0,0 +1,28 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+#define MACRO if (b)
+
+void foo2() {
+  int a;
+  int b = 1;
+  MACRO
+bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// For now we don't emit popups inside macros due to UI limitations.
+// Once we do, we should test it thoroughly.
+
+// CHECK-LABEL: 
+// CHECK-NOT:   
+// CHECK-SAME:  
+// CHECK-SAME:MACRO
+// CHECK-SAME:
+// CHECK-SAME:  if (b)
+// CHECK-SAME:
+// CHECK-SAME:  
Index: clang/test/Analysis/html_diagnostics/td-hotfix.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/td-hotfix.c
@@ -0,0 +1,31 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo() {
+  int a;
+  bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK-LABEL:
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-SAME: 2
+// CHECK-SAME:   
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   ←
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-NOT:
+// CHECK-SAME:   
+// CHECK-SAME: 1st function call argument is an uninitialized value
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-SAME: 
Index: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
===
--- clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -607,10 +607,17 @@
 )<<<";
 }
 
+static bool shouldDisplayPopUpRange(const SourceRange &Range) {
+  return !(Range.getBegin().isMacroID() || Range.getEnd().isMacroID());
+}
+
 static void
 HandlePopUpPieceStartTag(Rewriter &R,
  const std::vector &PopUpRanges) {
   for (const auto &Range : PopUpRanges) {
+if (!shouldDisplayPopUpRange(Range))
+  continue;
+
 html::HighlightRange(R, Range.getBegin(), Range.getEnd()

[PATCH] D73993: [analyzer] Fix a couple of bugs in HTML report generation.

2020-02-04 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added inline comments.



Comment at: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp:925
 HighlightRange(R, LPosInfo.first, Range);
-  }
 }
 

Here the gray highlighting goes, so the `PopUpRanges` store whether we have 
already highlighted the range and we early-continue. The cool thing is, we do 
not check for intersections because the pop-up range has a smaller scope than 
the entire expression's gray range so the HTML handles the colors/mouse-hover 
for us. In case of macro pop-ups the coloring and-or pop-upping was already 
buggy, they are handled differently, where I have not found such a cool 
workaround.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73993/new/

https://reviews.llvm.org/D73993



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73993: [analyzer] Fix a couple of bugs in HTML report generation.

2020-02-04 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment.

Thanks for the fix! The `PopUpRanges` is very important, please revert it back 
in its original shape. Sorry for the inconvenience.

I have ran a quick scan-build with this patch on LLVM because I wanted to give 
you a real world example (which you cannot visibly see at the test file). Here 
it is:
F11294494: Screenshot_20200204_225522.png 

The idea of ranges was that to add a new entry into a pop-up note as a table so 
you could inject any kind of pop-up information in order on the same range. 
Also if we highlighted the range as a pop-up do not highlight it in gray as 
well (which could break the HTML). Back in the days I did not realize the 
importance of the Doxygen and test files, I did not really know how to do so. 
Here I have adjusted the comments a little-bit:

  + /// Create the pop-up notes' table's start tag.
  static void
  HandlePopUpPieceStartTag(Rewriter &R,
   const std::vector &PopUpRanges) {
for (const auto &Range : PopUpRanges) {
  html::HighlightRange(R, Range.getBegin(), Range.getEnd(), "",
   "",
   /*IsTokenRange=*/true);
}
  }
  
  + /// Inject a new entry into the pop-up notes' table or add the table's end 
tag.
  static void HandlePopUpPieceEndTag(Rewriter &R,
 const PathDiagnosticPopUpPiece &Piece,
 std::vector &PopUpRanges,
 unsigned int LastReportedPieceIndex,
 unsigned int PopUpPieceIndex) {
SmallString<256> Buf;
llvm::raw_svector_ostream Out(Buf);
  
SourceRange Range(Piece.getLocation().asRange());
  
// Write out the path indices with a right arrow and the message as a row.
Out << ""
<< LastReportedPieceIndex;
  
// Also annotate the state transition with extra indices.
Out << '.' << PopUpPieceIndex;
  
Out << "" << Piece.getString() << "";
  
  - // If no report made at this range mark the variable and add the end tags.
  + // If no report made at the current range \c Range we could inject the 
table's end tag as this is the last report on that range. Also this is the 
first encounter of the range, after that it is safe to insert new entries to 
the table.
if (std::find(PopUpRanges.begin(), PopUpRanges.end(), Range) ==
PopUpRanges.end()) {
  // Store that we create a report at this range.
  PopUpRanges.push_back(Range);
  
  Out << "";
  html::HighlightRange(R, Range.getBegin(), Range.getEnd(),
   "", Buf.c_str(),
   /*IsTokenRange=*/true);
} else {
  -// Otherwise inject just the new row at the end of the range.
  +// Otherwise we are working with multiple notes at the same range, so 
inject a new row to the table at the end of the range which is the beginning of 
the table. With that we fill the table "upwards" which is the same order as we 
emit reports.
  html::HighlightRange(R, Range.getBegin(), Range.getEnd(), "", Buf.c_str(),
   /*IsTokenRange=*/true);
}
  }



---

Please rename the `variable-popups.c` to `variable-popups-simple.c`, 
`variable-popups-2.c` to `variable-popups-macro.c`, and here 
`variable-popups-multiple.c` comes:

  // RUN: rm -fR %t
  // RUN: mkdir %t
  // RUN: %clang_analyze_cc1 -analyzer-checker=core \
  // RUN:-analyzer-output=html -o %t -verify %s
  // RUN: cat %t/report-*.html | FileCheck %s
  
  void bar(int);
  
  void foo() {
int a;
for (unsigned i = 0; i < 3; ++i)
  if (i)
bar(a); // expected-warning{{1st function call argument is an 
uninitialized value}}
  }
  
  // CHECK:  i
  // CHECK-SAME:   
  // CHECK-SAME: 
  // CHECK-SAME:   2.1
  // CHECK-SAME: 
  // CHECK-SAME: 'i' is 0
  // CHECK-SAME:   
  // CHECK-SAME:   
  // CHECK-SAME: 
  // CHECK-SAME:   4.1
  // CHECK-SAME: 
  // CHECK-SAME: 'i' is 1
  // CHECK-SAME:   
  // CHECK-SAME: 


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73993/new/

https://reviews.llvm.org/D73993



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D73993: [analyzer] Fix a couple of bugs in HTML report generation.

2020-02-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, Charusso.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, 
mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware.
Herald added a project: clang.

This patch fixes an accidental redundant `` and disables generation of 
variable popups within macro popups due to 
https://bugs.llvm.org/show_bug.cgi?id=44782

I also added some tests for our HTML files because those were pretty much 
non-existent so far. Given that we can now also test scan-build (i actually 
landed D69781  yesterday), there are no more 
excuses for not writing tests. Test `variable-popups.c` was passing previously, 
so it's here just for the sake of finally having a test, while the other two 
tests were failing on their respective `CHECK-NOT` directives.

Another interesting thing i did was apply `tidy-html5` to our HTML files. They 
seem to satisfy the linter now, and btw that's how i found the first issue 
(while trying to reduce the second issue by running `tidy-html5` under 
`creduce`).

@Charusso: I didn't manage to understand how `PopUpRanges` get passed around 
and why, so i removed them. If you have an example of where it matters, please 
send tests :)


Repository:
  rC Clang

https://reviews.llvm.org/D73993

Files:
  clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
  clang/test/Analysis/html_diagnostics/td-hotfix.c
  clang/test/Analysis/html_diagnostics/variable-popups-2.c
  clang/test/Analysis/html_diagnostics/variable-popups.c

Index: clang/test/Analysis/html_diagnostics/variable-popups.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/variable-popups.c
@@ -0,0 +1,23 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo2() {
+  int a;
+  int b = 1;
+  if (b)
+bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK:  b
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   1.1
+// CHECK-SAME: 
+// CHECK-SAME: 'b' is 1
+// CHECK-SAME:   
+// CHECK-SAME: 
Index: clang/test/Analysis/html_diagnostics/variable-popups-2.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/variable-popups-2.c
@@ -0,0 +1,28 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+#define MACRO if (b)
+
+void foo2() {
+  int a;
+  int b = 1;
+  MACRO
+bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// For now we don't emit popups inside macros due to UI limitations.
+// Once we do, we should test it thoroughly.
+
+// CHECK-LABEL: 
+// CHECK-NOT:   
+// CHECK-SAME:  
+// CHECK-SAME:MACRO
+// CHECK-SAME:
+// CHECK-SAME:  if (b)
+// CHECK-SAME:
+// CHECK-SAME:  
Index: clang/test/Analysis/html_diagnostics/td-hotfix.c
===
--- /dev/null
+++ clang/test/Analysis/html_diagnostics/td-hotfix.c
@@ -0,0 +1,31 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN:-analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo() {
+  int a;
+  bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK-LABEL:
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-SAME: 2
+// CHECK-SAME:   
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   ←
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-NOT:
+// CHECK-SAME:   
+// CHECK-SAME: 1st function call argument is an uninitialized value
+// CHECK-SAME:   
+// CHECK-SAME: 
+// CHECK-SAME:   
+// CHECK-SAME: 
Index: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
===
--- clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -91,8 +91,7 @@
  unsigned num);
 
   void HandlePiece(Rewriter &R, FileID BugFileID, const PathDiagnosticPiece &P,
-   const std::vector &PopUpRanges, unsigned num,
-   unsigned max);
+   unsigned num, unsigned max);
 
   void HighlightRange(Rewriter& R, FileID BugFileID, SourceRange Range,
   const char *HighlightStart = "",
@@ -607,50 +606,31 @@
 )<<<";
 }
 
-static void
-Han