rjmccall added a comment.

Please add a comment something like this:

The semantics of dynamic initialization of thread-local variables depends 
subtly on whether they are block-scope. The initialization of block-scope 
thread locals can be aborted with an exception and later retried (<cite>), and 
recursive entry to the initialization has undefined behavior (<cite>). For 
non-block thread locals, exceptions lead to termination (<cite>), and recursive 
references to the variables are governed only by the lifetime rules (<cite>), 
which means they’re perfectly fine as long as they avoid touching memory. As a 
result, we need to avoid marking block-scope variables as initialized until 
after initialization completes (or be prepared revert the mark after an 
exception), but we need to mark non-block-scope variables as initialized 
immediately so that non-memory-accessing uses will succeed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135919/new/

https://reviews.llvm.org/D135919

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to