ClangImporter: refactor ClangImporterOptions to be ASTContext-owned. NFC

We need ClangImporterOptions to be persistent for several scenarios: (1)
when creating a sub-ASTContext to build Swift modules from interfaces; and
(2) when creating a new Clang instance to invoke Clang dependencies scanner.

This change is NFC.
This commit is contained in:
Xi Ge
2020-08-27 23:00:51 -07:00
parent b7d5ea844a
commit c403b140e1
19 changed files with 184 additions and 215 deletions

View File

@@ -2355,8 +2355,7 @@ static bool readBreakageAllowlist(SDKContext &Ctx, llvm::StringSet<> &lines) {
invok.setModuleName("ForClangImporter");
if (instance.setup(invok))
return 1;
ClangImporterOptions impOpts;
auto importer = ClangImporter::create(instance.getASTContext(), impOpts);
auto importer = ClangImporter::create(instance.getASTContext());
SmallString<128> preprocessedFilePath;
if (auto error = llvm::sys::fs::createTemporaryFile(
"breakage-allowlist-", "txt", preprocessedFilePath)) {