Move DWARFImporterDelegate into ClangImporter and remove DWARFImporter.

This refactors DWARFImporter to become a part of ClangImporter, since
it needs access to many of its implementation details anyway. The
DWARFImporterDelegate is just another mechanism for deserializing
Clang ASTs and once we have a Clang AST, the processing is effectively
the same.
This commit is contained in:
Adrian Prantl
2019-08-13 17:12:00 -07:00
parent 5adac047b6
commit c08a62764a
24 changed files with 277 additions and 568 deletions

View File

@@ -23,7 +23,6 @@
#include "swift/Basic/FileTypes.h"
#include "swift/Basic/SourceManager.h"
#include "swift/Basic/Statistic.h"
#include "swift/DWARFImporter/DWARFImporter.h"
#include "swift/Frontend/ParseableInterfaceModuleLoader.h"
#include "swift/Parse/DelayedParsingCallbacks.h"
#include "swift/Parse/Lexer.h"
@@ -380,17 +379,6 @@ bool CompilerInstance::setUpModuleLoaders() {
Context->addModuleLoader(std::move(SML));
Context->addModuleLoader(std::move(clangImporter), /*isClang*/ true);
if (Invocation.getLangOptions().EnableDWARFImporter) {
auto dwarfImporter =
DWARFImporter::create(*Context, Invocation.getClangImporterOptions(),
nullptr, getDependencyTracker());
if (!dwarfImporter) {
Diagnostics.diagnose(SourceLoc(), diag::error_clang_importer_create_fail);
return true;
}
Context->addModuleLoader(std::move(dwarfImporter));
}
return false;
}