Skip to content

Commit

Permalink
[NFC] Remove ModuleDecl::isClangModule in favor of isNonSwiftModule. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mateioprea committed Aug 4, 2020
1 parent de4872b commit 6ae04f7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion include/swift/AST/Module.h
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions lib/AST/Module.cpp
Expand Up @@ -493,9 +493,6 @@ ArrayRef<ImplicitImport> 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.
Expand Down
2 changes: 1 addition & 1 deletion lib/Index/IndexSymbol.cpp
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tools/swift-ide-test/swift-ide-test.cpp
Expand Up @@ -3191,7 +3191,7 @@ static int doPrintModuleImports(const CompilerInvocation &InitInvok,
SmallVector<ModuleDecl::ImportedModule, 16> 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";

Expand All @@ -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";
}
Expand Down

0 comments on commit 6ae04f7

Please sign in to comment.