mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cxx-interop] Re-enable debug mangling.
This commit is contained in:
@@ -1735,12 +1735,6 @@ private:
|
|||||||
|
|
||||||
/// Determine if there exists a name mangling for the given type.
|
/// Determine if there exists a name mangling for the given type.
|
||||||
static bool canMangle(TypeBase *Ty) {
|
static bool canMangle(TypeBase *Ty) {
|
||||||
// TODO: C++ types are not yet supported (SR-13223).
|
|
||||||
if (Ty->getStructOrBoundGenericStruct() &&
|
|
||||||
isa_and_nonnull<clang::CXXRecordDecl>(
|
|
||||||
Ty->getStructOrBoundGenericStruct()->getClangDecl()))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
switch (Ty->getKind()) {
|
switch (Ty->getKind()) {
|
||||||
case TypeKind::GenericFunction: // Not yet supported.
|
case TypeKind::GenericFunction: // Not yet supported.
|
||||||
case TypeKind::SILBlockStorage: // Not supported at all.
|
case TypeKind::SILBlockStorage: // Not supported at all.
|
||||||
@@ -2866,14 +2860,9 @@ void IRGenDebugInfoImpl::emitGlobalVariableDeclaration(
|
|||||||
if (Opts.DebugInfoLevel <= IRGenDebugInfoLevel::LineTables)
|
if (Opts.DebugInfoLevel <= IRGenDebugInfoLevel::LineTables)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: fix demangling for C++ types (SR-13223).
|
|
||||||
if (swift::TypeBase *ty = DbgTy.getType()) {
|
if (swift::TypeBase *ty = DbgTy.getType()) {
|
||||||
if (MetatypeType *metaTy = dyn_cast<MetatypeType>(ty))
|
if (MetatypeType *metaTy = dyn_cast<MetatypeType>(ty))
|
||||||
ty = metaTy->getInstanceType().getPointer();
|
ty = metaTy->getInstanceType().getPointer();
|
||||||
if (ty->getStructOrBoundGenericStruct() &&
|
|
||||||
isa_and_nonnull<clang::CXXRecordDecl>(
|
|
||||||
ty->getStructOrBoundGenericStruct()->getClangDecl()))
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::DIType *DITy = getOrCreateType(DbgTy);
|
llvm::DIType *DITy = getOrCreateType(DbgTy);
|
||||||
|
|||||||
@@ -1087,14 +1087,9 @@ public:
|
|||||||
const SILDebugScope *DS, SILLocation VarLoc, SILDebugVariable VarInfo,
|
const SILDebugScope *DS, SILLocation VarLoc, SILDebugVariable VarInfo,
|
||||||
IndirectionKind Indirection,
|
IndirectionKind Indirection,
|
||||||
AddrDbgInstrKind DbgInstrKind = AddrDbgInstrKind::DbgDeclare) {
|
AddrDbgInstrKind DbgInstrKind = AddrDbgInstrKind::DbgDeclare) {
|
||||||
// TODO: fix demangling for C++ types (SR-13223).
|
|
||||||
if (swift::TypeBase *ty = SILTy.getASTType().getPointer()) {
|
if (swift::TypeBase *ty = SILTy.getASTType().getPointer()) {
|
||||||
if (MetatypeType *metaTy = dyn_cast<MetatypeType>(ty))
|
if (MetatypeType *metaTy = dyn_cast<MetatypeType>(ty))
|
||||||
ty = metaTy->getRootClass().getPointer();
|
ty = metaTy->getRootClass().getPointer();
|
||||||
if (ty->getStructOrBoundGenericStruct() &&
|
|
||||||
isa_and_nonnull<clang::CXXRecordDecl>(
|
|
||||||
ty->getStructOrBoundGenericStruct()->getClangDecl()))
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(IGM.DebugInfo && "debug info not enabled");
|
assert(IGM.DebugInfo && "debug info not enabled");
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// RUN: %target-swiftxx-frontend -I %S/Inputs %s -emit-ir -g | %FileCheck %s
|
// RUN: %target-swiftxx-frontend -I %S/Inputs %s -emit-ir -g | %FileCheck %s
|
||||||
|
|
||||||
// Validate that we don't crash when trying to deserialize C++ type debug info.
|
// Validate that we don't crash when trying to deserialize C++ type debug info.
|
||||||
// Note, however, that the actual debug info is not generated, see SR-13223.
|
|
||||||
|
|
||||||
import DebugInfo
|
import DebugInfo
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user