&PopUpRanges,
unsigned num, unsigned max) {
// For now, just draw a box above the line in question, and emit the
// warning.
@@ -870,7 +843,7 @@
<< (num - 1)
<< "\" title=\"Previous event ("
<< (num - 1)
- << ")\">←";
+ << ")\">←";
}
os << "";
@@ -947,14 +920,8 @@
// Now highlight the ranges.
ArrayRef Ranges = P.getRanges();
- for (const auto &Range : Ranges) {
- // If we have already highlighted the range as a pop-up there is no work.
- if (std::find(PopUpRanges.begin(), PopUpRanges.end(), Range) !=
- PopUpRanges.end())
- continue;
-
+ for (const auto &Range : Ranges)
HighlightRange(R, LPosInfo.first, Range);
- }
}
static void EmitAlphaCounter(raw_ostream &os, unsigned n) {
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/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:
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:
|