[compiler-rt] [NFC][TSan] Use in-class member initializers for ReportDesc (PR #228780)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 3 17:01:45 PDT 2026
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/228780
>From aa951dc11a041956ed4c7afef3fbea156ae2590a Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Sat, 3 Oct 2026 15:34:40 -0700
Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=
=?UTF-8?q?itial=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.7
---
compiler-rt/lib/tsan/rtl/tsan_report.cpp | 16 ----------------
compiler-rt/lib/tsan/rtl/tsan_report.h | 10 ++++------
2 files changed, 4 insertions(+), 22 deletions(-)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
index 17fd3064fb85a..82ca89705f8d1 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
@@ -29,22 +29,6 @@ class Decorator: public __sanitizer::SanitizerCommonDecorator {
const char *Mutex() { return Magenta(); }
};
-ReportDesc::ReportDesc()
- : tag(kExternalTagNone)
- , stacks()
- , mops()
- , locs()
- , mutexes()
- , threads()
- , unique_tids()
- , sleep()
- , count() {
-}
-
-ReportMop::ReportMop()
- : mset() {
-}
-
ReportDesc::~ReportDesc() {
// FIXME(dvyukov): it must be leaking a lot of memory.
}
diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.h b/compiler-rt/lib/tsan/rtl/tsan_report.h
index 53bb21964dbba..e444f4204d36c 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_report.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_report.h
@@ -60,8 +60,6 @@ struct ReportMop {
Vector<ReportMopMutex> mset;
StackTrace stack_trace;
ReportStack *stack;
-
- ReportMop();
};
enum ReportLocationType {
@@ -113,7 +111,7 @@ struct AddedLocationAddr {
class ReportDesc {
public:
ReportType typ;
- uptr tag;
+ uptr tag = kExternalTagNone;
Vector<ReportStack*> stacks;
Vector<ReportMop*> mops;
Vector<ReportLocation*> locs;
@@ -121,11 +119,11 @@ class ReportDesc {
Vector<ReportMutex*> mutexes;
Vector<ReportThread*> threads;
Vector<Tid> unique_tids;
- ReportStack *sleep;
- int count;
+ ReportStack* sleep = nullptr;
+ int count = 0;
int signum = 0;
- ReportDesc();
+ ReportDesc() = default;
~ReportDesc();
private:
>From c1014e1ca45d713c759b6d8f336f14e6ad2694e8 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Sat, 3 Oct 2026 16:58:07 -0700
Subject: [PATCH 2/3] Keep ReportDesc::ReportDesc() = default in
tsan_report.cpp
Created using spr 1.3.7
---
compiler-rt/lib/tsan/rtl/tsan_report.cpp | 2 ++
compiler-rt/lib/tsan/rtl/tsan_report.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
index 82ca89705f8d1..56db6a826fa4f 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
@@ -29,6 +29,8 @@ class Decorator: public __sanitizer::SanitizerCommonDecorator {
const char *Mutex() { return Magenta(); }
};
+ReportDesc::ReportDesc() = default;
+
ReportDesc::~ReportDesc() {
// FIXME(dvyukov): it must be leaking a lot of memory.
}
diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.h b/compiler-rt/lib/tsan/rtl/tsan_report.h
index e444f4204d36c..2a6209aea0b7b 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_report.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_report.h
@@ -123,7 +123,7 @@ class ReportDesc {
int count = 0;
int signum = 0;
- ReportDesc() = default;
+ ReportDesc();
~ReportDesc();
private:
>From 82910d7bab83cfaf9ab7e4db8011c13a094eb07c Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Sat, 3 Oct 2026 17:01:31 -0700
Subject: [PATCH 3/3] Revert ReportMop changes
Created using spr 1.3.7
---
compiler-rt/lib/tsan/rtl/tsan_report.cpp | 4 ++++
compiler-rt/lib/tsan/rtl/tsan_report.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
index 56db6a826fa4f..11e0ccf396984 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
@@ -31,6 +31,10 @@ class Decorator: public __sanitizer::SanitizerCommonDecorator {
ReportDesc::ReportDesc() = default;
+ReportMop::ReportMop()
+ : mset() {
+}
+
ReportDesc::~ReportDesc() {
// FIXME(dvyukov): it must be leaking a lot of memory.
}
diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.h b/compiler-rt/lib/tsan/rtl/tsan_report.h
index 2a6209aea0b7b..e847b119c6039 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_report.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_report.h
@@ -60,6 +60,8 @@ struct ReportMop {
Vector<ReportMopMutex> mset;
StackTrace stack_trace;
ReportStack *stack;
+
+ ReportMop();
};
enum ReportLocationType {
More information about the llvm-commits
mailing list