File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -2289,6 +2289,14 @@ class DeclAndTypePrinter::Implementation
2289
2289
return false ;
2290
2290
}
2291
2291
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
+
2292
2300
// / If \p typeDecl is one of the standard library types used to map in Clang
2293
2301
// / primitives and basic types, print out the appropriate spelling and
2294
2302
// / return true.
@@ -2297,8 +2305,7 @@ class DeclAndTypePrinter::Implementation
2297
2305
// / for interfacing with C and Objective-C.
2298
2306
bool printIfKnownSimpleType (const TypeDecl *typeDecl,
2299
2307
std::optional<OptionalTypeKind> optionalKind) {
2300
- auto knownTypeInfo =
2301
- owningPrinter.typeMapping .getKnownObjCTypeInfo (typeDecl);
2308
+ auto knownTypeInfo = getKnownType (typeDecl);
2302
2309
if (!knownTypeInfo)
2303
2310
return false ;
2304
2311
os << knownTypeInfo->name ;
Original file line number Diff line number Diff line change 15
15
16
16
namespace swift {
17
17
18
- enum class OutputLanguageMode { ObjC, Cxx };
18
+ enum class OutputLanguageMode { ObjC, Cxx, C };
19
19
20
20
} // end namespace swift
21
21
You can’t perform that action at this time.
0 commit comments