aboutsummaryrefslogtreecommitdiff
path: root/clang/docs
diff options
context:
space:
mode:
authorTom Honermann <tom.honermann@intel.com>2024-03-15 16:12:19 -0700
committerGitHub <noreply@github.com>2024-03-15 19:12:19 -0400
commitf128607b89b4818a2265f5ebd09313408277d975 (patch)
tree300581f2c12c14c13872561795470dcd0f226037 /clang/docs
parent8d7ee4691dadd3a9d831108f77d1f4e511191a44 (diff)
downloadllvm-f128607b89b4818a2265f5ebd09313408277d975.zip
llvm-f128607b89b4818a2265f5ebd09313408277d975.tar.gz
llvm-f128607b89b4818a2265f5ebd09313408277d975.tar.bz2
[clang][MSVC] Correct mangling of thread-safe static initialization variables. (#85300)
Static local variables with dynamic initializers depend on implicitly defined guard variables to synchronize thread-safe initialization. These guard variables may have external linkage and therefore require a stable name for linkage purposes. The Microsoft ABI assigns these variables a local name of '$TSS' followed by a discriminator and mangles them as a static local variable of type 'int'. Previously, the '$TSS<discriminator>' portion of the name was not registered as a back reference candidate and this resulted in incorrect back references for enclosing class and/or namespace scopes that might be referenced in the signature of the enclosing function. This change adds the previously missing back reference registration. This matches the mangling performed by MSVC and resolves incompatibilities when inline functions with static local variables are inlined across DLL boundaries. This is an ABI change and has the potential to cause backward compatibility issues with previous Clang releases. Fixes #83616
Diffstat (limited to 'clang/docs')
-rw-r--r--clang/docs/ReleaseNotes.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 623a4b3..1ae35e6 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -47,6 +47,12 @@ C++ Specific Potentially Breaking Changes
ABI Changes in This Version
---------------------------
+- Fixed Microsoft name mangling of implicitly defined variables used for thread
+ safe static initialization of static local variables. This change resolves
+ incompatibilities with code compiled by MSVC but might introduce
+ incompatibilities with code compiled by earlier versions of Clang when an
+ inline member function that contains a static local variable with a dynamic
+ initializer is declared with ``__declspec(dllimport)``. (#GH83616).
AST Dumping Potentially Breaking Changes
----------------------------------------