diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-05-28 14:54:49 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-05-28 14:54:49 +0000 |
commit | 88ab281b4d57d2ae965b335afb74d73407c233c7 (patch) | |
tree | f73800c0495dafde40d9aea52302fd6ec0565b21 | |
parent | eb006d3268cb8e2c2d005b45402204d6a203101b (diff) | |
download | bcm5719-llvm-88ab281b4d57d2ae965b335afb74d73407c233c7.tar.gz bcm5719-llvm-88ab281b4d57d2ae965b335afb74d73407c233c7.zip |
llvm-undname: Add support for local static thread guards
llvm-svn: 361835
-rw-r--r-- | llvm/include/llvm/Demangle/MicrosoftDemangle.h | 2 | ||||
-rw-r--r-- | llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h | 1 | ||||
-rw-r--r-- | llvm/lib/Demangle/MicrosoftDemangle.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Demangle/MicrosoftDemangleNodes.cpp | 5 | ||||
-rw-r--r-- | llvm/test/Demangle/ms-operators.test | 3 |
5 files changed, 14 insertions, 4 deletions
diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangle.h b/llvm/include/llvm/Demangle/MicrosoftDemangle.h index 6b3c7c9967f..423fc2eac85 100644 --- a/llvm/include/llvm/Demangle/MicrosoftDemangle.h +++ b/llvm/include/llvm/Demangle/MicrosoftDemangle.h @@ -223,7 +223,7 @@ private: demangleSpecialTableSymbolNode(StringView &MangledName, SpecialIntrinsicKind SIK); LocalStaticGuardVariableNode * - demangleLocalStaticGuard(StringView &MangledName); + demangleLocalStaticGuard(StringView &MangledName, bool IsThread); VariableSymbolNode *demangleUntypedVariable(ArenaAllocator &Arena, StringView &MangledName, StringView VariableName); diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h index dde9ae7bca6..63111bc5591 100644 --- a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h +++ b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h @@ -408,6 +408,7 @@ struct LocalStaticGuardIdentifierNode : public IdentifierNode { void output(OutputStream &OS, OutputFlags Flags) const override; + bool IsThread = false; uint32_t ScopeIndex = 0; }; diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp index e596f0cea1c..4abb48e5757 100644 --- a/llvm/lib/Demangle/MicrosoftDemangle.cpp +++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp @@ -293,9 +293,10 @@ Demangler::demangleSpecialTableSymbolNode(StringView &MangledName, } LocalStaticGuardVariableNode * -Demangler::demangleLocalStaticGuard(StringView &MangledName) { +Demangler::demangleLocalStaticGuard(StringView &MangledName, bool IsThread) { LocalStaticGuardIdentifierNode *LSGI = Arena.alloc<LocalStaticGuardIdentifierNode>(); + LSGI->IsThread = IsThread; QualifiedNameNode *QN = demangleNameScopeChain(MangledName, LSGI); LocalStaticGuardVariableNode *LSGVN = Arena.alloc<LocalStaticGuardVariableNode>(); @@ -443,7 +444,9 @@ SymbolNode *Demangler::demangleSpecialIntrinsic(StringView &MangledName) { case SpecialIntrinsicKind::VcallThunk: return demangleVcallThunkNode(MangledName); case SpecialIntrinsicKind::LocalStaticGuard: - return demangleLocalStaticGuard(MangledName); + return demangleLocalStaticGuard(MangledName, /*IsThread=*/false); + case SpecialIntrinsicKind::LocalStaticThreadGuard: + return demangleLocalStaticGuard(MangledName, /*IsThread=*/true); case SpecialIntrinsicKind::RttiTypeDescriptor: { TypeNode *T = demangleType(MangledName, QualifierMangleMode::Result); if (Error) diff --git a/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp b/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp index a3ee5f9d91d..2c1e5f44f42 100644 --- a/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp +++ b/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp @@ -349,7 +349,10 @@ void IntrinsicFunctionIdentifierNode::output(OutputStream &OS, void LocalStaticGuardIdentifierNode::output(OutputStream &OS, OutputFlags Flags) const { - OS << "`local static guard'"; + if (IsThread) + OS << "`local static thread guard'"; + else + OS << "`local static guard'"; if (ScopeIndex > 0) OS << "{" << ScopeIndex << "}"; } diff --git a/llvm/test/Demangle/ms-operators.test b/llvm/test/Demangle/ms-operators.test index d18c2794d2d..6a22ebda171 100644 --- a/llvm/test/Demangle/ms-operators.test +++ b/llvm/test/Demangle/ms-operators.test @@ -230,6 +230,9 @@ ??__F_decisionToDFA@XPathLexer@@0V?$vector@VDFA@dfa@antlr4@@V?$allocator@VDFA@dfa@antlr4@@@std@@@std@@A@YAXXZ ; CHECK: void __cdecl `dynamic atexit destructor for `private: static class std::vector<class antlr4::dfa::DFA, class std::allocator<class antlr4::dfa::DFA>> XPathLexer::_decisionToDFA''(void) +??__J?1??f@@YAAAUS@@XZ@51 +; CHECK: `struct S & __cdecl f(void)'::`2'::`local static thread guard'{2} + ??__K_deg@@YAHO@Z ; CHECK: int __cdecl operator ""_deg(long double) |