From: David Majnemer Date: Fri, 13 Dec 2013 00:52:45 +0000 (+0000) Subject: [-cxx-abi microsoft] Add commentary for mangleStaticGuardVariable X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f4ce4c4259bf8faa51497f403eda6ac4ce53c9a;p=clang [-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197193 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index 24eac84cdd..8a2357d057 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -2048,6 +2048,15 @@ void MicrosoftMangleContextImpl::mangleReferenceTemporary(const VarDecl *VD, 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 . + // + // 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. + // ::= ?_B @51 // ::= ?$S @ @4IA