adapt changed API for clang::createInvocation

This commit is contained in:
Erik Eckstein
2022-10-31 10:46:47 +01:00
parent e292d17672
commit 9ddd4cd98d
2 changed files with 9 additions and 3 deletions

View File

@@ -1041,8 +1041,12 @@ std::unique_ptr<clang::CompilerInvocation> ClangImporter::createClangInvocation(
clangDiags = clang::CompilerInstance::createDiagnostics(tempDiagOpts.get(), clangDiags = clang::CompilerInstance::createDiagnostics(tempDiagOpts.get(),
&tempDiagClient, &tempDiagClient,
/*owned*/ false); /*owned*/ false);
CI = clang::createInvocationFromCommandLine(invocationArgs, clangDiags, VFS, clang::CreateInvocationOptions CIOpts;
false, CC1Args); CIOpts.VFS = VFS;
CIOpts.Diags = clangDiags;
CIOpts.RecoverOnError = false;
CIOpts.CC1Args = CC1Args;
CI = clang::createInvocation(invocationArgs, std::move(CIOpts));
} }
if (!CI) { if (!CI) {

View File

@@ -278,8 +278,10 @@ bool ide::initInvocationByClangArguments(ArrayRef<const char *> ArgList,
ClangArgList.insert(ClangArgList.end(), ArgList.begin(), ArgList.end()); ClangArgList.insert(ClangArgList.end(), ArgList.begin(), ArgList.end());
// Create a new Clang compiler invocation. // Create a new Clang compiler invocation.
clang::CreateInvocationOptions CIOpts;
CIOpts.Diags = ClangDiags;
std::unique_ptr<clang::CompilerInvocation> ClangInvok = std::unique_ptr<clang::CompilerInvocation> ClangInvok =
clang::createInvocationFromCommandLine(ClangArgList, ClangDiags); clang::createInvocation(ClangArgList, std::move(CIOpts));
if (!ClangInvok || ClangDiags->hasErrorOccurred()) { if (!ClangInvok || ClangDiags->hasErrorOccurred()) {
for (auto I = DiagBuf.err_begin(), E = DiagBuf.err_end(); I != E; ++I) { for (auto I = DiagBuf.err_begin(), E = DiagBuf.err_end(); I != E; ++I) {
Error += I->second; Error += I->second;