Skip to content

Commit c84d8c4

Browse files
authored
Merge pull request #5074 from milseman/import_name
[Clang Importer] Restore shouldIgnoreMacro API
2 parents 6f456af + 7a1a6af commit c84d8c4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/swift/ClangImporter/ClangImporter.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ class ClangImporter final : public ClangModuleLoader {
231231
/// Otherwise, return nullptr.
232232
Decl *importDeclCached(const clang::NamedDecl *ClangDecl);
233233

234+
// Returns true if it is expected that the macro is ignored.
235+
bool shouldIgnoreMacro(StringRef Name, const clang::MacroInfo *Macro);
236+
234237
/// Returns the name of the given enum element as it would be imported into
235238
/// Swift.
236239
///

lib/ClangImporter/ImportName.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,11 @@ static bool shouldIgnoreMacro(StringRef name, const clang::MacroInfo *macro) {
16211621
return false;
16221622
}
16231623

1624+
bool ClangImporter::shouldIgnoreMacro(StringRef Name,
1625+
const clang::MacroInfo *Macro) {
1626+
return ::shouldIgnoreMacro(Name, Macro);
1627+
}
1628+
16241629
Identifier importer::importMacroName(
16251630
const clang::IdentifierInfo *clangIdentifier, const clang::MacroInfo *macro,
16261631
clang::ASTContext &clangCtx, ASTContext &SwiftContext) {

0 commit comments

Comments
 (0)