[clang] [analyzer] Improve bug report hashing, merge similar reports (PR #98621)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 22 02:23:37 PDT 2024


================
@@ -2213,7 +2213,7 @@ void BasicBugReport::Profile(llvm::FoldingSetNodeID& hash) const {
 void PathSensitiveBugReport::Profile(llvm::FoldingSetNodeID &hash) const {
   hash.AddInteger(static_cast<int>(getKind()));
   hash.AddPointer(&BT);
-  hash.AddString(Description);
+  hash.AddString(getShortDescription());
----------------
NagyDonat wrote:

Yes, it's intentional, because the method call `getShortDescription()` is equivalent to `ShortDescripton.empty() ? Description : ShortDescription`. (The common case when the short and full descriptions are identical is represented internally by an empty `ShortDescription` and the shared value stored in `Description`.)

https://github.com/llvm/llvm-project/pull/98621


More information about the cfe-commits mailing list