From 45fe376dbd1f195dc81b770b54b124bddbba9c88 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 16 Jun 2016 01:21:28 +0000 Subject: [PATCH] [DebugInfo] Enable generation of unique identifiers for externally visible MS ABI types We implemented the mangling for this a long time ago. llvm-svn: 272862 --- clang/lib/CodeGen/CGDebugInfo.cpp | 4 ---- clang/test/CodeGenCXX/debug-info-ms-abi.cpp | 13 +++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 clang/test/CodeGenCXX/debug-info-ms-abi.cpp diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 0e756d348c45..36d224067275 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -649,10 +649,6 @@ static SmallString<256> getUniqueTagTypeName(const TagType *Ty, if (!hasCXXMangling(TD, TheCU) || !TD->isExternallyVisible()) return FullName; - // Microsoft Mangler does not have support for mangleCXXRTTIName yet. - if (CGM.getTarget().getCXXABI().isMicrosoft()) - return FullName; - // TODO: This is using the RTTI name. Is there a better way to get // a unique string for a type? llvm::raw_svector_ostream Out(FullName); diff --git a/clang/test/CodeGenCXX/debug-info-ms-abi.cpp b/clang/test/CodeGenCXX/debug-info-ms-abi.cpp new file mode 100644 index 000000000000..78979952b444 --- /dev/null +++ b/clang/test/CodeGenCXX/debug-info-ms-abi.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 %s -triple=i686-pc-windows-msvc -debug-info-kind=limited -emit-llvm -o - | FileCheck %s + +// Tests that certain miscellaneous features work in the MS ABI. + +struct Foo { + struct Nested {}; +}; +Foo f; +Foo::Nested n; +// CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", +// CHECK-SAME: identifier: ".?AUFoo@@" +// CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested", +// CHECK-SAME: identifier: ".?AUNested@Foo@@"