llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Ziqing Luo (ziqingluo-90)

<details>
<summary>Changes</summary>

This is a follow-up commit to #<!-- -->178952 for indentation and comments 
cleanups.

---
Full diff: https://github.com/llvm/llvm-project/pull/181896.diff


2 Files Affected:

- (modified) clang/lib/Analysis/ThreadSafety.cpp (-3) 
- (modified) clang/test/SemaCXX/warn-thread-safety-analysis.cpp (+10-10) 


``````````diff
diff --git a/clang/lib/Analysis/ThreadSafety.cpp 
b/clang/lib/Analysis/ThreadSafety.cpp
index 901624acd6f75..2c5976af9f61d 100644
--- a/clang/lib/Analysis/ThreadSafety.cpp
+++ b/clang/lib/Analysis/ThreadSafety.cpp
@@ -1727,9 +1727,6 @@ class BuildLockset : public 
ConstStmtVisitor<BuildLockset> {
   FactSet FSet;
   // The fact set for the function on exit.
   const FactSet &FunctionExitFSet;
-  // Use `LVarCtx` to keep track of the context at each program point, which
-  // will be used to translate variables (by `SExprBuilder::translateVariable`)
-  // to their canonical definitions:
   LocalVariableMap::Context LVarCtx;
   unsigned CtxIndex;
 
diff --git a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp 
b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
index b878a37747f2f..a6c9a2236fc45 100644
--- a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
@@ -7487,20 +7487,20 @@ void testPointerAliasEscapeAndReset(Foo *f) {
 // A function that may do anything to the objects referred to by the inputs.
 void escapeAliasMultiple(void *, void *, void *);
 void testPointerAliasEscapeMultiple(Foo *F) {
-    Foo *L;
-    F->mu.Lock(); // expected-note{{mutex acquired here}}
-    Foo *Fp = F;
-    escapeAliasMultiple(&L, &L, &Fp);
-    Fp->mu.Unlock(); // expected-warning{{releasing mutex 'Fp->mu' that was 
not held}}
+  Foo *L;
+  F->mu.Lock(); // expected-note{{mutex acquired here}}
+  Foo *Fp = F;
+  escapeAliasMultiple(&L, &L, &Fp);
+  Fp->mu.Unlock(); // expected-warning{{releasing mutex 'Fp->mu' that was not 
held}}
 } // expected-warning{{mutex 'F->mu' is still held at the end of function}}
 
 void unlockFooWithEscapablePointer(Foo **Fp) 
EXCLUSIVE_UNLOCK_FUNCTION((*Fp)->mu);
 void testEscapeInvalidationHappensRightAfterTheCall(Foo* F) {
-    Foo* L;
-    L = F;
-    L->mu.Lock();
-    // Release the lock held by 'L' before clearing its definition.
-    unlockFooWithEscapablePointer(&L);
+  Foo* L;
+  L = F;
+  L->mu.Lock();
+  // Release the lock held by 'L' before clearing its definition.
+  unlockFooWithEscapablePointer(&L);
 }
 
 void testEscapeInvalidationHappensRightAfterTheCtorCall(Foo* F) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/181896
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to