mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ClangImporter, IDETool: Conservatively adjust uses of clang::CompilerInstance::createDiagnostics (parameter added)
Per df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55 (llvm-project).
This commit is contained in:
@@ -276,9 +276,11 @@ bool ide::initInvocationByClangArguments(ArrayRef<const char *> ArgList,
|
||||
new clang::DiagnosticOptions()
|
||||
};
|
||||
|
||||
const auto VFS = llvm::vfs::getRealFileSystem();
|
||||
|
||||
clang::TextDiagnosticBuffer DiagBuf;
|
||||
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> ClangDiags =
|
||||
clang::CompilerInstance::createDiagnostics(DiagOpts.get(), &DiagBuf,
|
||||
clang::CompilerInstance::createDiagnostics(*VFS, DiagOpts.get(), &DiagBuf,
|
||||
/*ShouldOwnClient=*/false);
|
||||
|
||||
// Clang expects this to be like an actual command line. So we need to pass in
|
||||
@@ -356,7 +358,7 @@ bool ide::initInvocationByClangArguments(ArrayRef<const char *> ArgList,
|
||||
|
||||
if (!PPOpts.ImplicitPCHInclude.empty()) {
|
||||
clang::FileSystemOptions FileSysOpts;
|
||||
clang::FileManager FileMgr(FileSysOpts);
|
||||
clang::FileManager FileMgr(FileSysOpts, VFS);
|
||||
auto PCHContainerOperations =
|
||||
std::make_shared<clang::PCHContainerOperations>();
|
||||
std::string HeaderFile = clang::ASTReader::getOriginalSourceFile(
|
||||
|
||||
Reference in New Issue
Block a user