[PATCH] D50877: [MS] Mangle a hash of the main file path into anonymous namespaces

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 16 17:16:42 PDT 2018


rnk created this revision.
rnk added reviewers: majnemer, inglorion, hans.
Herald added subscribers: dexonsmith, JDevlieghere, aprantl, mehdi_amini.

This is needed to avoid conflicts in mangled names for codeview types in
anonymous namespaces. In CodeView, types refer to each other typically
through forward declarations, which contain mangled names. These names
have to be unique, otherwise the debugger will look up the mangled name
and find the wrong definition.

Furthermore, ThinLTO will deduplicate the types, and debug info
verification can fail when the types have the wrong sizes. This is
PR38608.

Fixes PR38609.


https://reviews.llvm.org/D50877

Files:
  clang/lib/AST/MicrosoftMangle.cpp
  clang/test/CodeGenCXX/cfi-cross-dso.cpp
  clang/test/CodeGenCXX/cfi-icall.cpp
  clang/test/CodeGenCXX/debug-info-thunk.cpp
  clang/test/CodeGenCXX/dllexport.cpp
  clang/test/CodeGenCXX/mangle-ms.cpp
  clang/test/CodeGenCXX/microsoft-abi-structors.cpp
  clang/test/CodeGenCXX/microsoft-abi-throw.cpp
  clang/test/CodeGenCXX/microsoft-abi-thunks.cpp
  clang/test/CodeGenCXX/microsoft-abi-vftables.cpp
  clang/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
  clang/test/CodeGenCXX/msabi-swiftcall-cc.cpp
  clang/test/CodeGenCXX/pragma-init_seg.cpp
  clang/test/CodeGenCXX/type-metadata.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50877.161147.patch
Type: text/x-patch
Size: 16759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180817/fd895e0d/attachment-0001.bin>


More information about the cfe-commits mailing list