Skip to content

Commit 4c0ac78

Browse files
committed
Revert "PrintAsClang: Intro and use getKnownType for C compatibility"
This reverts commit e65a1fb.
1 parent a5ffe36 commit 4c0ac78

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

lib/PrintAsClang/DeclAndTypePrinter.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,14 +2289,6 @@ class DeclAndTypePrinter::Implementation
22892289
return false;
22902290
}
22912291

2292-
std::optional<PrimitiveTypeMapping::ClangTypeInfo>
2293-
getKnownType(const TypeDecl *typeDecl) {
2294-
if (outputLang == OutputLanguageMode::C)
2295-
return owningPrinter.typeMapping.getKnownCTypeInfo(typeDecl);
2296-
2297-
return owningPrinter.typeMapping.getKnownObjCTypeInfo(typeDecl);
2298-
}
2299-
23002292
/// If \p typeDecl is one of the standard library types used to map in Clang
23012293
/// primitives and basic types, print out the appropriate spelling and
23022294
/// return true.
@@ -2305,7 +2297,8 @@ class DeclAndTypePrinter::Implementation
23052297
/// for interfacing with C and Objective-C.
23062298
bool printIfKnownSimpleType(const TypeDecl *typeDecl,
23072299
std::optional<OptionalTypeKind> optionalKind) {
2308-
auto knownTypeInfo = getKnownType(typeDecl);
2300+
auto knownTypeInfo =
2301+
owningPrinter.typeMapping.getKnownObjCTypeInfo(typeDecl);
23092302
if (!knownTypeInfo)
23102303
return false;
23112304
os << knownTypeInfo->name;

lib/PrintAsClang/OutputLanguageMode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace swift {
1717

18-
enum class OutputLanguageMode { ObjC, Cxx, C };
18+
enum class OutputLanguageMode { ObjC, Cxx };
1919

2020
} // end namespace swift
2121

0 commit comments

Comments
 (0)