@@ -30,37 +30,27 @@ class TypeDecl;
3030// / but to something like `intptr_t` or `swift::Int` for C and C++ declarations.
3131class PrimitiveTypeMapping {
3232public:
33- struct ObjCClangTypeInfo {
33+ struct ClangTypeInfo {
3434 StringRef name;
3535 bool canBeNullable;
3636 };
3737
3838 // / Returns the Objective-C type name and nullability for the given Swift
3939 // / primitive type declaration, or \c None if no such type name exists.
40- Optional<ObjCClangTypeInfo> getKnownObjCTypeInfo (const TypeDecl *typeDecl);
41-
42- struct CClangTypeInfo {
43- StringRef name;
44- bool canBeNullable;
45- };
40+ Optional<ClangTypeInfo> getKnownObjCTypeInfo (const TypeDecl *typeDecl);
4641
4742 // / Returns the C type name and nullability for the given Swift
4843 // / primitive type declaration, or \c None if no such type name exists.
49- Optional<CClangTypeInfo> getKnownCTypeInfo (const TypeDecl *typeDecl);
50-
51- struct CxxClangTypeInfo {
52- StringRef name;
53- bool canBeNullable;
54- };
44+ Optional<ClangTypeInfo> getKnownCTypeInfo (const TypeDecl *typeDecl);
5545
5646 // / Returns the C++ type name and nullability for the given Swift
5747 // / primitive type declaration, or \c None if no such type name exists.
58- Optional<CxxClangTypeInfo > getKnownCxxTypeInfo (const TypeDecl *typeDecl);
48+ Optional<ClangTypeInfo > getKnownCxxTypeInfo (const TypeDecl *typeDecl);
5949
6050private:
6151 void initialize (ASTContext &ctx);
6252
63- struct ClangTypeInfo {
53+ struct FullClangTypeInfo {
6454 // The Objective-C name of the Swift type.
6555 StringRef objcName;
6656 // The C name of the Swift type.
@@ -70,15 +60,15 @@ class PrimitiveTypeMapping {
7060 bool canBeNullable;
7161 };
7262
73- ClangTypeInfo *getMappedTypeInfoOrNull (const TypeDecl *typeDecl);
63+ FullClangTypeInfo *getMappedTypeInfoOrNull (const TypeDecl *typeDecl);
7464
7565 // / A map from {Module, TypeName} pairs to {C name, C nullability} pairs.
7666 // /
7767 // / This is populated on first use with a list of known Swift types that are
7868 // / translated directly by the ObjC printer instead of structurally, allowing
7969 // / it to do things like map 'Int' to 'NSInteger' and 'Float' to 'float'.
8070 // / In some sense it's the reverse of the ClangImporter's MappedTypes.def.
81- llvm::DenseMap<std::pair<Identifier, Identifier>, ClangTypeInfo >
71+ llvm::DenseMap<std::pair<Identifier, Identifier>, FullClangTypeInfo >
8272 mappedTypeNames;
8373};
8474
0 commit comments