Skip to content

Commit 8e9a896

Browse files
authored
Merge pull request #60539 from zoecarver/two-misc-fixes
[cxx-interop] Re-enable debug mangling for C++ value types.
2 parents 3f4170d + 39af79f commit 8e9a896

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,12 +1735,6 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
17351735

17361736
/// Determine if there exists a name mangling for the given type.
17371737
static bool canMangle(TypeBase *Ty) {
1738-
// TODO: C++ types are not yet supported (SR-13223).
1739-
if (Ty->getStructOrBoundGenericStruct() &&
1740-
isa_and_nonnull<clang::CXXRecordDecl>(
1741-
Ty->getStructOrBoundGenericStruct()->getClangDecl()))
1742-
return false;
1743-
17441738
switch (Ty->getKind()) {
17451739
case TypeKind::GenericFunction: // Not yet supported.
17461740
case TypeKind::SILBlockStorage: // Not supported at all.
@@ -2866,14 +2860,9 @@ void IRGenDebugInfoImpl::emitGlobalVariableDeclaration(
28662860
if (Opts.DebugInfoLevel <= IRGenDebugInfoLevel::LineTables)
28672861
return;
28682862

2869-
// TODO: fix demangling for C++ types (SR-13223).
28702863
if (swift::TypeBase *ty = DbgTy.getType()) {
28712864
if (MetatypeType *metaTy = dyn_cast<MetatypeType>(ty))
28722865
ty = metaTy->getInstanceType().getPointer();
2873-
if (ty->getStructOrBoundGenericStruct() &&
2874-
isa_and_nonnull<clang::CXXRecordDecl>(
2875-
ty->getStructOrBoundGenericStruct()->getClangDecl()))
2876-
return;
28772866
}
28782867

28792868
llvm::DIType *DITy = getOrCreateType(DbgTy);

lib/IRGen/IRGenSIL.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,14 +1087,9 @@ class IRGenSILFunction :
10871087
const SILDebugScope *DS, SILLocation VarLoc, SILDebugVariable VarInfo,
10881088
IndirectionKind Indirection,
10891089
AddrDbgInstrKind DbgInstrKind = AddrDbgInstrKind::DbgDeclare) {
1090-
// TODO: fix demangling for C++ types (SR-13223).
10911090
if (swift::TypeBase *ty = SILTy.getASTType().getPointer()) {
10921091
if (MetatypeType *metaTy = dyn_cast<MetatypeType>(ty))
10931092
ty = metaTy->getRootClass().getPointer();
1094-
if (ty->getStructOrBoundGenericStruct() &&
1095-
isa_and_nonnull<clang::CXXRecordDecl>(
1096-
ty->getStructOrBoundGenericStruct()->getClangDecl()))
1097-
return;
10981093
}
10991094

11001095
assert(IGM.DebugInfo && "debug info not enabled");

test/Interop/Cxx/class/debug-info-irgen.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %target-swiftxx-frontend -I %S/Inputs %s -emit-ir -g | %FileCheck %s
22

33
// Validate that we don't crash when trying to deserialize C++ type debug info.
4-
// Note, however, that the actual debug info is not generated, see SR-13223.
54

65
import DebugInfo
76

0 commit comments

Comments
 (0)