@@ -30,37 +30,27 @@ class TypeDecl;
30
30
// / but to something like `intptr_t` or `swift::Int` for C and C++ declarations.
31
31
class PrimitiveTypeMapping {
32
32
public:
33
- struct ObjCClangTypeInfo {
33
+ struct ClangTypeInfo {
34
34
StringRef name;
35
35
bool canBeNullable;
36
36
};
37
37
38
38
// / Returns the Objective-C type name and nullability for the given Swift
39
39
// / 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);
46
41
47
42
// / Returns the C type name and nullability for the given Swift
48
43
// / 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);
55
45
56
46
// / Returns the C++ type name and nullability for the given Swift
57
47
// / 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);
59
49
60
50
private:
61
51
void initialize (ASTContext &ctx);
62
52
63
- struct ClangTypeInfo {
53
+ struct FullClangTypeInfo {
64
54
// The Objective-C name of the Swift type.
65
55
StringRef objcName;
66
56
// The C name of the Swift type.
@@ -70,15 +60,15 @@ class PrimitiveTypeMapping {
70
60
bool canBeNullable;
71
61
};
72
62
73
- ClangTypeInfo *getMappedTypeInfoOrNull (const TypeDecl *typeDecl);
63
+ FullClangTypeInfo *getMappedTypeInfoOrNull (const TypeDecl *typeDecl);
74
64
75
65
// / A map from {Module, TypeName} pairs to {C name, C nullability} pairs.
76
66
// /
77
67
// / This is populated on first use with a list of known Swift types that are
78
68
// / translated directly by the ObjC printer instead of structurally, allowing
79
69
// / it to do things like map 'Int' to 'NSInteger' and 'Float' to 'float'.
80
70
// / 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 >
82
72
mappedTypeNames;
83
73
};
84
74
0 commit comments