Skip to content

Commit

Permalink
Merge pull request swiftlang#9835 from adrian-prantl/32327266
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-ci authored May 22, 2017
2 parents 7593f29 + f344e53 commit 94e4c37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/IRGen/IRGenDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
/// A list of replaceable fwddecls that need to be RAUWed at the end.
std::vector<std::pair<TypeBase *, llvm::TrackingMDRef>> ReplaceMap;
/// The set of imported modules.
llvm::DenseSet<ModuleDecl::ImportedModule> ImportedModules;
llvm::DenseSet<ModuleDecl *> ImportedModules;

llvm::BumpPtrAllocator DebugInfoNames;
StringRef CWDName; /// The current working directory.
Expand Down Expand Up @@ -1558,7 +1558,7 @@ void IRGenDebugInfoImpl::finalize() {
IGM.getSwiftModule()->getImportedModules(ModuleWideImports,
ModuleDecl::ImportFilter::All);
for (auto M : ModuleWideImports)
if (!ImportedModules.count(M))
if (!ImportedModules.count(M.second))
DBuilder.createImportedModule(MainFile, getOrCreateModule(M), 0);

// Finalize all replaceable forward declarations.
Expand Down Expand Up @@ -1731,7 +1731,7 @@ void IRGenDebugInfoImpl::emitImport(ImportDecl *D) {
auto DIMod = getOrCreateModule(Imported);
auto L = getDebugLoc(*this, D);
DBuilder.createImportedModule(getOrCreateFile(L.Filename), DIMod, L.Line);
ImportedModules.insert(Imported);
ImportedModules.insert(Imported.second);
}

llvm::DISubprogram *IRGenDebugInfoImpl::emitFunction(SILFunction &SILFn,
Expand Down
2 changes: 2 additions & 0 deletions test/DebugInfo/ImportClangSubmodule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import ClangModule.SubModule

// The Swift compiler uses an ugly hack that auto-imports a
// submodule's top-level-module, even if we didn't ask for it.
// CHECK-NOT: !DIImportedEntity({{.*}}, entity: ![[SUBMODULE]]
// CHECK: !DIImportedEntity({{.*}}, entity: ![[CLANGMODULE]])
// CHECK-NOT: !DIImportedEntity({{.*}}, entity: ![[SUBMODULE]]

let bar = Bar()

0 comments on commit 94e4c37

Please sign in to comment.