r197193 - [-cxx-abi microsoft] Add commentary for mangleStaticGuardVariable
David Majnemer
david.majnemer at gmail.com
Thu Dec 12 16:52:45 PST 2013
Author: majnemer
Date: Thu Dec 12 18:52:45 2013
New Revision: 197193
URL: http://llvm.org/viewvc/llvm-project?rev=197193&view=rev
Log:
[-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.
Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=197193&r1=197192&r2=197193&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Thu Dec 12 18:52:45 2013
@@ -2048,6 +2048,15 @@ void MicrosoftMangleContextImpl::mangleR
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
More information about the cfe-commits
mailing list