Module interface printing: don't print declarations from the Swift overlay when printing a submodule

rdar://16559404


Swift SVN r16117
This commit is contained in:
Dmitri Hrybenko
2014-04-09 14:22:56 +00:00
parent f90e0c153b
commit 7ac0db93a9

View File

@@ -154,7 +154,10 @@ void swift::ide::printSubmoduleInterface(
}
continue;
}
SwiftDecls.push_back(D);
if (FullModuleName.empty()) {
// Add Swift decls if we are printing the top-level module.
SwiftDecls.push_back(D);
}
}
auto &ClangSourceManager = Importer.getClangASTContext().getSourceManager();
@@ -163,8 +166,7 @@ void swift::ide::printSubmoduleInterface(
for (auto &P : ClangDecls) {
std::sort(P.second.begin(), P.second.end(),
[&](std::pair<Decl *, clang::SourceLocation> LHS,
std::pair<Decl *, clang::SourceLocation> RHS)
-> bool {
std::pair<Decl *, clang::SourceLocation> RHS) -> bool {
return ClangSourceManager.isBeforeInTranslationUnit(LHS.second,
RHS.second);
});