[PATCH] D84843: [Analyzer] Remove inclusion of uniqueing decl from diagnostic profile.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 30 00:50:00 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1745ba41b196: [Analyzer] Remove inclusion of uniqueing decl from diagnostic profile. (authored by balazske).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84843

Files:
  clang/lib/Analysis/PathDiagnostic.cpp
  clang/test/Analysis/report-uniqueing.cpp


Index: clang/test/Analysis/report-uniqueing.cpp
===================================================================
--- /dev/null
+++ clang/test/Analysis/report-uniqueing.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_analyze_cc1 -verify %s \
+// RUN:   -analyzer-checker=security
+
+void bzero(void *, unsigned long);
+
+template <typename T> void foo(T l) {
+  // The warning comes from multiple instances and with
+  // different declarations that have same source location.
+  // One instance should be shown.
+  bzero(l, 1); // expected-warning{{The bzero() function is obsoleted}}
+}
+
+void p(int *p, unsigned *q) {
+  foo(p);
+  foo(q);
+}
Index: clang/lib/Analysis/PathDiagnostic.cpp
===================================================================
--- clang/lib/Analysis/PathDiagnostic.cpp
+++ clang/lib/Analysis/PathDiagnostic.cpp
@@ -1134,7 +1134,6 @@
 void PathDiagnostic::Profile(llvm::FoldingSetNodeID &ID) const {
   ID.Add(getLocation());
   ID.Add(getUniqueingLoc());
-  ID.AddPointer(getUniqueingLoc().isValid() ? getUniqueingDecl() : nullptr);
   ID.AddString(BugType);
   ID.AddString(VerboseDesc);
   ID.AddString(Category);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84843.281815.patch
Type: text/x-patch
Size: 1140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200730/d9d260dc/attachment-0001.bin>


More information about the cfe-commits mailing list