[clang] beb5a3a - Correct some thread safety analysis diagnostics; NFC.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu May 20 08:30:37 PDT 2021


Author: Aaron Ballman
Date: 2021-05-20T11:30:21-04:00
New Revision: beb5a3a298a1bb2687b421cb960d36a5e9b3ad43

URL: https://github.com/llvm/llvm-project/commit/beb5a3a298a1bb2687b421cb960d36a5e9b3ad43
DIFF: https://github.com/llvm/llvm-project/commit/beb5a3a298a1bb2687b421cb960d36a5e9b3ad43.diff

LOG: Correct some thread safety analysis diagnostics; NFC.

The diagnostics were not following the usual style rules.

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticSemaKinds.td
    clang/test/SemaCXX/warn-thread-safety-verbose.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 9dd9b1b5118b..fff6b62f3b7f 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -3634,13 +3634,13 @@ def warn_fun_requires_lock_precise :
 def note_found_mutex_near_match : Note<"found near match '%0'">;
 
 // Verbose thread safety warnings
-def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">,
+def warn_thread_safety_verbose : Warning<"thread safety verbose warning">,
   InGroup<ThreadSafetyVerbose>, DefaultIgnore;
-def note_thread_warning_in_fun : Note<"Thread warning in function %0">;
-def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
+def note_thread_warning_in_fun : Note<"thread warning in function %0">;
+def note_guarded_by_declared_here : Note<"guarded_by declared here">;
 
 // Dummy warning that will trigger "beta" warnings from the analysis if enabled.
-def warn_thread_safety_beta : Warning<"Thread safety beta warning.">,
+def warn_thread_safety_beta : Warning<"thread safety beta warning">,
   InGroup<ThreadSafetyBeta>, DefaultIgnore;
 
 // Consumed warnings

diff  --git a/clang/test/SemaCXX/warn-thread-safety-verbose.cpp b/clang/test/SemaCXX/warn-thread-safety-verbose.cpp
index 2f892cd1e175..e8b229f3373b 100644
--- a/clang/test/SemaCXX/warn-thread-safety-verbose.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-verbose.cpp
@@ -21,41 +21,41 @@ class LOCKABLE Mutex {
 
 class Test {
   Mutex mu;
-  int a GUARDED_BY(mu);  // expected-note3 {{Guarded_by declared here.}}
+  int a GUARDED_BY(mu);  // expected-note3 {{guarded_by declared here}}
 
   void foo1() EXCLUSIVE_LOCKS_REQUIRED(mu);
   void foo2() SHARED_LOCKS_REQUIRED(mu);
   void foo3() LOCKS_EXCLUDED(mu);
 
-  void test1() {  // expected-note {{Thread warning in function 'test1'}}
+  void test1() {  // expected-note {{thread warning in function 'test1'}}
     a = 0;        // expected-warning {{writing variable 'a' requires holding mutex 'mu' exclusively}}
   }
 
-  void test2() {  // expected-note {{Thread warning in function 'test2'}}
+  void test2() {  // expected-note {{thread warning in function 'test2'}}
     int b = a;    // expected-warning {{reading variable 'a' requires holding mutex 'mu'}}
   }
 
-  void test3() {  // expected-note {{Thread warning in function 'test3'}}
+  void test3() {  // expected-note {{thread warning in function 'test3'}}
     foo1();       // expected-warning {{calling function 'foo1' requires holding mutex 'mu' exclusively}}
   }
 
-  void test4() {  // expected-note {{Thread warning in function 'test4'}}
+  void test4() {  // expected-note {{thread warning in function 'test4'}}
     foo2();       // expected-warning {{calling function 'foo2' requires holding mutex 'mu'}}
   }
 
-  void test5() {  // expected-note {{Thread warning in function 'test5'}}
+  void test5() {  // expected-note {{thread warning in function 'test5'}}
     mu.ReaderLock();
     foo1();       // expected-warning {{calling function 'foo1' requires holding mutex 'mu' exclusively}}
     mu.Unlock();
   }
 
-  void test6() {  // expected-note {{Thread warning in function 'test6'}}
+  void test6() {  // expected-note {{thread warning in function 'test6'}}
     mu.ReaderLock();
     a = 0;        // expected-warning {{writing variable 'a' requires holding mutex 'mu' exclusively}}
     mu.Unlock();
   }
 
-  void test7() {  // expected-note {{Thread warning in function 'test7'}}
+  void test7() {  // expected-note {{thread warning in function 'test7'}}
     mu.Lock();
     foo3();       // expected-warning {{cannot call function 'foo3' while mutex 'mu' is held}}
     mu.Unlock();


        


More information about the cfe-commits mailing list