File tree Expand file tree Collapse file tree 6 files changed +13
-12
lines changed Expand file tree Collapse file tree 6 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -101,14 +101,14 @@ CFPointeeInfo::classifyTypedef(const clang::TypedefNameDecl *typedefDecl) {
101
101
return forInvalid ();
102
102
}
103
103
104
- bool ClangImporter::Implementation ::isCFTypeDecl (
104
+ bool importer ::isCFTypeDecl (
105
105
const clang::TypedefNameDecl *Decl) {
106
106
if (CFPointeeInfo::classifyTypedef (Decl))
107
107
return true ;
108
108
return false ;
109
109
}
110
110
111
- StringRef ClangImporter::Implementation ::getCFTypeName (
111
+ StringRef importer ::getCFTypeName (
112
112
const clang::TypedefNameDecl *decl) {
113
113
if (auto pointee = CFPointeeInfo::classifyTypedef (decl)) {
114
114
auto name = decl->getName ();
Original file line number Diff line number Diff line change @@ -104,6 +104,13 @@ class CFPointeeInfo {
104
104
return Decl.get <const clang::TypedefNameDecl *>();
105
105
}
106
106
};
107
+
108
+ // / Determine whether this typedef is a CF type.
109
+ bool isCFTypeDecl (const clang::TypedefNameDecl *Decl);
110
+
111
+ // / Determine the imported CF type for the given typedef-name, or the empty
112
+ // / string if this is not an imported CF type name.
113
+ llvm::StringRef getCFTypeName (const clang::TypedefNameDecl *decl);
107
114
}
108
115
}
109
116
Original file line number Diff line number Diff line change @@ -503,8 +503,7 @@ class IAMInference {
503
503
static StringRef getTypeName (clang::QualType qt) {
504
504
if (auto typedefTy = qt->getAs <clang::TypedefType>()) {
505
505
// Check for a CF type name (drop the "Ref")
506
- auto cfName = ClangImporter::Implementation::getCFTypeName (
507
- typedefTy->getDecl ()->getCanonicalDecl ());
506
+ auto cfName = getCFTypeName (typedefTy->getDecl ()->getCanonicalDecl ());
508
507
if (cfName != StringRef ())
509
508
return cfName;
510
509
}
Original file line number Diff line number Diff line change 15
15
//
16
16
// ===----------------------------------------------------------------------===//
17
17
18
+ #include " CFTypeInfo.h"
18
19
#include " IAMInference.h"
19
20
#include " ImporterImpl.h"
20
21
#include " ClangDiagnosticConsumer.h"
Original file line number Diff line number Diff line change 14
14
//
15
15
// ===----------------------------------------------------------------------===//
16
16
17
+ #include " CFTypeInfo.h"
17
18
#include " ImporterImpl.h"
18
19
#include " ClangDiagnosticConsumer.h"
19
20
#include " swift/Strings.h"
@@ -573,7 +574,7 @@ namespace {
573
574
ImportHint hint = ImportHint::None;
574
575
575
576
if (Impl.getSwiftNewtypeAttr (type->getDecl (), /* useSwift2Name=*/ false )) {
576
- if (ClangImporter::Implementation:: isCFTypeDecl (type->getDecl ()))
577
+ if (isCFTypeDecl (type->getDecl ()))
577
578
hint = ImportHint::SwiftNewtypeFromCFPointer;
578
579
else
579
580
hint = ImportHint::SwiftNewtype;
Original file line number Diff line number Diff line change @@ -717,13 +717,6 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
717
717
// / or a null type if the DeclContext does not have a corresponding type.
718
718
static clang::QualType getClangDeclContextType (const clang::DeclContext *dc);
719
719
720
- // / Determine whether this typedef is a CF type.
721
- static bool isCFTypeDecl (const clang::TypedefNameDecl *Decl);
722
-
723
- // / Determine the imported CF type for the given typedef-name, or the empty
724
- // / string if this is not an imported CF type name.
725
- static StringRef getCFTypeName (const clang::TypedefNameDecl *decl);
726
-
727
720
// / Retrieve the type name of a Clang type for the purposes of
728
721
// / omitting unneeded words.
729
722
static OmissionTypeName getClangTypeNameForOmission (clang::ASTContext &ctx,
You can’t perform that action at this time.
0 commit comments