Skip to content

Commit 773a2aa

Browse files
committed
Revert "Print the Swift mangled name as a field in C++ interop generated classes"
This reverts commit 5b12a15.
1 parent 6adc27e commit 773a2aa

File tree

4 files changed

+0
-26
lines changed

4 files changed

+0
-26
lines changed

lib/PrintAsClang/ClangSyntaxPrinter.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -435,16 +435,3 @@ void ClangSyntaxPrinter::printKnownCType(
435435
if (info->canBeNullable)
436436
os << " _Null_unspecified";
437437
}
438-
439-
void ClangSyntaxPrinter::printSwiftMangledNameForDebugger(
440-
const NominalTypeDecl *typeDecl) {
441-
printIgnoredCxx17ExtensionDiagnosticBlock([&]() {
442-
auto mangled_name = mangler.mangleTypeForDebugger(
443-
typeDecl->getDeclaredInterfaceType(), nullptr);
444-
if (!mangled_name.empty()) {
445-
os << " typedef char " << mangled_name << ";\n";
446-
os << " static inline constexpr " << mangled_name
447-
<< " $__swift_mangled_name = 0;\n";
448-
}
449-
});
450-
}

lib/PrintAsClang/ClangSyntaxPrinter.h

-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndef SWIFT_PRINTASCLANG_CLANGSYNTAXPRINTER_H
1414
#define SWIFT_PRINTASCLANG_CLANGSYNTAXPRINTER_H
1515

16-
#include "swift/AST/ASTMangler.h"
1716
#include "swift/AST/Type.h"
1817
#include "swift/Basic/LLVM.h"
1918
#include "swift/ClangImporter/ClangImporter.h"
@@ -231,14 +230,8 @@ class ClangSyntaxPrinter {
231230
/// Print the given **known** type as a C type.
232231
void printKnownCType(Type t, PrimitiveTypeMapping &typeMapping) const;
233232

234-
/// Print the nominal type's Swift mangled name as a typedef from a char to
235-
/// the mangled name, and a static constexpr variable declaration, whose type
236-
/// is the aforementioned typedef, and whose name is known to the debugger.
237-
void printSwiftMangledNameForDebugger(const NominalTypeDecl *typeDecl);
238-
239233
protected:
240234
raw_ostream &os;
241-
swift::Mangle::ASTMangler mangler;
242235
};
243236

244237
} // end namespace swift

lib/PrintAsClang/PrintClangClassType.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ void ClangClassTypePrinter::printClassTypeDecl(
7777
os << " friend class " << cxx_synthesis::getCxxImplNamespaceName() << "::";
7878
printCxxImplClassName(os, typeDecl);
7979
os << ";\n";
80-
81-
printer.printSwiftMangledNameForDebugger(typeDecl);
82-
8380
os << "};\n\n";
8481

8582
// Print out the "hidden" _impl class.

lib/PrintAsClang/PrintClangValueType.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,6 @@ void ClangValueTypePrinter::printValueTypeDecl(
383383
printCxxImplClassName(os, typeDecl);
384384
printGenericParamRefs(os);
385385
os << ";\n";
386-
387-
printer.printSwiftMangledNameForDebugger(typeDecl);
388-
389386
os << "};\n";
390387
os << '\n';
391388

0 commit comments

Comments
 (0)