Skip to content

Commit 7a7663e

Browse files
committed
Expose "isKnownCFTypeName" through ClangImporter
LLDB needs to know if a type was specially handled by the compiler, so expose "isKnownCFTypeName" so LLDB can call it.
1 parent 3daa875 commit 7a7663e

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

include/swift/ClangImporter/ClangImporter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ class ClangImporter final : public ClangModuleLoader {
194194
IntermoduleDepTrackingMode Mode,
195195
std::shared_ptr<llvm::FileCollectorBase> FileCollector);
196196

197+
static bool isKnownCFTypeName(llvm::StringRef name);
198+
197199
/// Append visible module names to \p names. Note that names are possibly
198200
/// duplicated, and not guaranteed to be ordered in any way.
199201
void collectVisibleTopLevelModuleNames(

lib/ClangImporter/CFTypeInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static constexpr const llvm::StringLiteral KnownCFTypes[] = {
4343
const size_t NumKnownCFTypes = sizeof(KnownCFTypes) / sizeof(*KnownCFTypes);
4444

4545
/// Maintain a set of known CF types.
46-
static bool isKnownCFTypeName(StringRef name) {
46+
bool CFPointeeInfo::isKnownCFTypeName(StringRef name) {
4747
return std::binary_search(KnownCFTypes, KnownCFTypes + NumKnownCFTypes,
4848
name, SortByLengthComparator());
4949
}

lib/ClangImporter/CFTypeInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ class CFPointeeInfo {
7777
public:
7878
static CFPointeeInfo classifyTypedef(const clang::TypedefNameDecl *decl);
7979

80+
static bool isKnownCFTypeName(llvm::StringRef name);
81+
8082
bool isValid() const { return IsValid; }
8183
explicit operator bool() const { return isValid(); }
8284

lib/ClangImporter/ClangImporter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616
#include "swift/ClangImporter/ClangImporter.h"
17+
#include "CFTypeInfo.h"
1718
#include "ClangDerivedConformances.h"
1819
#include "ClangDiagnosticConsumer.h"
1920
#include "ClangIncludePaths.h"
@@ -402,6 +403,10 @@ ClangImporter::createDependencyCollector(
402403
FileCollector);
403404
}
404405

406+
bool ClangImporter::isKnownCFTypeName(llvm::StringRef name) {
407+
return CFPointeeInfo::isKnownCFTypeName(name);
408+
}
409+
405410
void ClangImporter::Implementation::addBridgeHeaderTopLevelDecls(
406411
clang::Decl *D) {
407412
if (shouldIgnoreBridgeHeaderTopLevelDecl(D))

0 commit comments

Comments
 (0)