Skip to content

Commit 6ae04f7

Browse files
authored
[NFC] Remove ModuleDecl::isClangModule in favor of isNonSwiftModule. (#33202)
Fixes SR-13237.
1 parent de4872b commit 6ae04f7

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

include/swift/AST/Module.h

-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ class ModuleDecl : public DeclContext, public TypeDecl {
367367
return { Files.begin(), Files.size() };
368368
}
369369

370-
bool isClangModule() const;
371370
void addFile(FileUnit &newFile);
372371

373372
/// Creates a map from \c #filePath strings to corresponding \c #fileID

lib/AST/Module.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,6 @@ ArrayRef<ImplicitImport> ModuleDecl::getImplicitImports() const {
493493
{});
494494
}
495495

496-
bool ModuleDecl::isClangModule() const {
497-
return findUnderlyingClangModule() != nullptr;
498-
}
499496

500497
void ModuleDecl::addFile(FileUnit &newFile) {
501498
// If this is a LoadedFile, make sure it loaded without error.

lib/Index/IndexSymbol.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ SymbolInfo index::getSymbolInfoForModule(ModuleEntity Mod) {
143143
info.SubKind = SymbolSubKind::None;
144144
info.Properties = SymbolPropertySet();
145145
if (auto *D = Mod.getAsSwiftModule()) {
146-
if (!D->isClangModule()) {
146+
if (!D->isNonSwiftModule()) {
147147
info.Lang = SymbolLanguage::Swift;
148148
} else {
149149
info.Lang = SymbolLanguage::C;

tools/swift-ide-test/swift-ide-test.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3191,7 +3191,7 @@ static int doPrintModuleImports(const CompilerInvocation &InitInvok,
31913191
SmallVector<ModuleDecl::ImportedModule, 16> scratch;
31923192
for (auto next : namelookup::getAllImports(M)) {
31933193
llvm::outs() << next.importedModule->getName();
3194-
if (next.importedModule->isClangModule())
3194+
if (next.importedModule->isNonSwiftModule())
31953195
llvm::outs() << " (Clang)";
31963196
llvm::outs() << ":\n";
31973197

@@ -3205,7 +3205,7 @@ static int doPrintModuleImports(const CompilerInvocation &InitInvok,
32053205
llvm::outs() << "." << accessPathPiece.Item;
32063206
}
32073207

3208-
if (import.importedModule->isClangModule())
3208+
if (import.importedModule->isNonSwiftModule())
32093209
llvm::outs() << " (Clang)";
32103210
llvm::outs() << "\n";
32113211
}

0 commit comments

Comments
 (0)