From 6ae04f749b3d92c6aa292f5669311ea81d57d756 Mon Sep 17 00:00:00 2001 From: Matei Oprea Date: Tue, 4 Aug 2020 06:01:17 +0300 Subject: [PATCH] [NFC] Remove ModuleDecl::isClangModule in favor of isNonSwiftModule. (#33202) Fixes SR-13237. --- include/swift/AST/Module.h | 1 - lib/AST/Module.cpp | 3 --- lib/Index/IndexSymbol.cpp | 2 +- tools/swift-ide-test/swift-ide-test.cpp | 4 ++-- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/swift/AST/Module.h b/include/swift/AST/Module.h index f66cbc34e89d2..0a1ff8f42ba2a 100644 --- a/include/swift/AST/Module.h +++ b/include/swift/AST/Module.h @@ -367,7 +367,6 @@ class ModuleDecl : public DeclContext, public TypeDecl { return { Files.begin(), Files.size() }; } - bool isClangModule() const; void addFile(FileUnit &newFile); /// Creates a map from \c #filePath strings to corresponding \c #fileID diff --git a/lib/AST/Module.cpp b/lib/AST/Module.cpp index 9a5830743bd5a..6749fdc8b8802 100644 --- a/lib/AST/Module.cpp +++ b/lib/AST/Module.cpp @@ -493,9 +493,6 @@ ArrayRef ModuleDecl::getImplicitImports() const { {}); } -bool ModuleDecl::isClangModule() const { - return findUnderlyingClangModule() != nullptr; -} void ModuleDecl::addFile(FileUnit &newFile) { // If this is a LoadedFile, make sure it loaded without error. diff --git a/lib/Index/IndexSymbol.cpp b/lib/Index/IndexSymbol.cpp index caa333508999a..f8d1e756b2d7d 100644 --- a/lib/Index/IndexSymbol.cpp +++ b/lib/Index/IndexSymbol.cpp @@ -143,7 +143,7 @@ SymbolInfo index::getSymbolInfoForModule(ModuleEntity Mod) { info.SubKind = SymbolSubKind::None; info.Properties = SymbolPropertySet(); if (auto *D = Mod.getAsSwiftModule()) { - if (!D->isClangModule()) { + if (!D->isNonSwiftModule()) { info.Lang = SymbolLanguage::Swift; } else { info.Lang = SymbolLanguage::C; diff --git a/tools/swift-ide-test/swift-ide-test.cpp b/tools/swift-ide-test/swift-ide-test.cpp index 29bff878cf9da..691318b4885db 100644 --- a/tools/swift-ide-test/swift-ide-test.cpp +++ b/tools/swift-ide-test/swift-ide-test.cpp @@ -3191,7 +3191,7 @@ static int doPrintModuleImports(const CompilerInvocation &InitInvok, SmallVector scratch; for (auto next : namelookup::getAllImports(M)) { llvm::outs() << next.importedModule->getName(); - if (next.importedModule->isClangModule()) + if (next.importedModule->isNonSwiftModule()) llvm::outs() << " (Clang)"; llvm::outs() << ":\n"; @@ -3205,7 +3205,7 @@ static int doPrintModuleImports(const CompilerInvocation &InitInvok, llvm::outs() << "." << accessPathPiece.Item; } - if (import.importedModule->isClangModule()) + if (import.importedModule->isNonSwiftModule()) llvm::outs() << " (Clang)"; llvm::outs() << "\n"; }