[all-commits] [llvm/llvm-project] 6de19e: Thread safety analysis: Drop special block handling
Aaron Puchert via All-commits
all-commits at lists.llvm.org
Mon Sep 20 06:36:32 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6de19ea4b6264e64cea145e00ab66fe1530fc0a0
https://github.com/llvm/llvm-project/commit/6de19ea4b6264e64cea145e00ab66fe1530fc0a0
Author: Aaron Puchert <aaron.puchert at sap.com>
Date: 2021-09-20 (Mon, 20 Sep 2021)
Changed paths:
M clang/lib/Analysis/ThreadSafety.cpp
M clang/test/PCH/thread-safety-attrs.cpp
M clang/test/SemaCXX/warn-thread-safety-analysis.cpp
Log Message:
-----------
Thread safety analysis: Drop special block handling
Previous changes like D101202 and D104261 have eliminated the special
status that break and continue once had, since now we're making
decisions purely based on the structure of the CFG without regard for
the underlying source code constructs.
This means we don't gain anything from defering handling for these
blocks. Dropping it moves some diagnostics, though arguably into a
better place. We're working around a "quirk" in the CFG that perhaps
wasn't visible before: while loops have an empty "transition block"
where continue statements and the regular loop exit meet, before
continuing to the loop entry. To get a source location for that, we
slightly extend our handling for empty blocks. The source location for
the transition ends up to be the loop entry then, but formally this
isn't a back edge. We pretend it is anyway. (This is safe: we can always
treat edges as back edges, it just means we allow less and don't modify
the lock set. The other way around it wouldn't be safe.)
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D106715
More information about the All-commits
mailing list