swift-ide-test: Add a -skip-unavailable option to skip unavailable declarations

Swift SVN r16056
This commit is contained in:
Doug Gregor
2014-04-08 16:34:44 +00:00
parent 5d20720e87
commit 9e75a46c8c
3 changed files with 12 additions and 1 deletions

View File

@@ -131,6 +131,10 @@ void swift::ide::printSubmoduleInterface(
// Separate the declarations that we are going to print into different
// buckets.
for (Decl *D : Decls) {
// If requested, skip unavailable declarations.
if (Options.SkipUnavailable && D->getAttrs().isUnavailable())
continue;
if (auto ID = dyn_cast<ImportDecl>(D)) {
ImportDecls.push_back(ID);
continue;
@@ -145,8 +149,9 @@ void swift::ide::printSubmoduleInterface(
auto *OwningModule = Importer.getClangOwningModule(CN);
auto I = ClangDecls.find(OwningModule);
if (I != ClangDecls.end())
if (I != ClangDecls.end()) {
I->second.push_back({ D, Loc });
}
continue;
}
SwiftDecls.push_back(D);