[clang] [MS] Add /Zc:tlsGuards option to control tls guard emission (PR #113830)

Maurice Heumann via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 1 02:37:06 PDT 2024


================
@@ -4063,6 +4063,11 @@ defm threadsafe_statics : BoolFOption<"threadsafe-statics",
   NegFlag<SetFalse, [], [ClangOption, CC1Option],
           "Do not emit code to make initialization of local statics thread safe">,
   PosFlag<SetTrue>>;
+defm tls_guards : BoolFOption<"tls-guards",
+  LangOpts<"TlsGuards">, DefaultTrue,
----------------
momo5502 wrote:

Ah I see :D i have never added an option before.

I removed it as a clang option and renamed it to `-fms-tls-guards` (& `-fno-ms-tls-guards`).
It applies to all tls variables in general, whether they are defined inside a function or not should not be relevant, from what I understand from Microsoft's documentation

https://github.com/llvm/llvm-project/pull/113830


More information about the cfe-commits mailing list