[-cxx-abi microsoft] Add commentary for mangleStaticGuardVariable
We will need to do some work here if we want to play nice with MSVC2013.
Add a TODO indicating what changed and why this matters.
llvm-svn: 197193
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index 24eac84..8a2357d 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -2048,6 +2048,15 @@
void MicrosoftMangleContextImpl::mangleStaticGuardVariable(const VarDecl *VD,
raw_ostream &Out) {
+ // TODO: This is not correct, especially with respect to MSVC2013. MSVC2013
+ // utilizes thread local variables to implement thread safe, re-entrant
+ // initialization for statics. They no longer differentiate between an
+ // externally visible and non-externally visible static with respect to
+ // mangling, they all get $TSS <number>.
+ //
+ // N.B. This means that they can get more than 32 static variable guards in a
+ // scope. It also means that they broke compatibility with their own ABI.
+
// <guard-name> ::= ?_B <postfix> @51
// ::= ?$S <guard-num> @ <postfix> @4IA