[MS ABI] Fix mangling issue with dynamic initializer stubs.
authorZachary Turner <zturner@google.com>
Thu, 30 Aug 2018 20:53:11 +0000 (20:53 +0000)
committerZachary Turner <zturner@google.com>
Thu, 30 Aug 2018 20:53:11 +0000 (20:53 +0000)
commitf4f767d534b819348d02048ae7610453004d5d84
treeae5582a4a45d3df88fbebb2298f4ab27ed48b3c3
parent2499aeead93a28cff56816c6ce7c093d227a0084
[MS ABI] Fix mangling issue with dynamic initializer stubs.

There are two types of dynamic initializer stubs.  There's

  `dynamic initializer for 'x''(void)

and

  `dynamic initializer for `static Foo::Bar StaticDataMember''(void)

The second case is disambiguated from the first by the presence of
a ? after the operator code.  So the first will appear something like
?__E<name> while the second will appear something like ?__E?<name>.
clang-cl was mangling these both the same though.  This patch
matches behavior with cl.

Differential Revision: https://reviews.llvm.org/D51500

llvm-svn: 341117
clang/lib/AST/MicrosoftMangle.cpp
clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
clang/test/CodeGenCXX/pragma-init_seg.cpp