diff --git a/src/indexer.cc b/src/indexer.cc index d5fe7da2..83b77a20 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1097,7 +1097,9 @@ public: void InclusionDirective(SourceLocation hashLoc, const Token &tok, StringRef included, bool isAngled, CharSourceRange filenameRange, -#if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2 +#if LLVM_VERSION_MAJOR >= 16 // llvmorg-16-init-15080-g854c10f8d185 + OptionalFileEntryRef fileRef, +#elif LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2 llvm::Optional fileRef, #else const FileEntry *file, diff --git a/src/project.cc b/src/project.cc index c02bd6b6..b1b7f557 100644 --- a/src/project.cc +++ b/src/project.cc @@ -391,11 +391,14 @@ void Project::loadDirectory(const std::string &root, Project::Folder &folder) { fwrite(input.c_str(), input.size(), 1, fout); fclose(fout); } - std::array, 3> redir{StringRef(stdinPath), - StringRef(path), StringRef()}; +#if LLVM_VERSION_MAJOR >= 16 // llvmorg-16-init-12589-ge748db0f7f09 + std::array, 3> +#else + std::array, 3> +#endif + redir{StringRef(stdinPath), StringRef(path), StringRef()}; std::vector args{g_config->compilationDatabaseCommand, root}; - if (sys::ExecuteAndWait(args[0], args, llvm::None, redir, 0, 0, &err_msg) < - 0) { + if (sys::ExecuteAndWait(args[0], args, {}, redir, 0, 0, &err_msg) < 0) { LOG_S(ERROR) << "failed to execute " << args[0].str() << " " << args[1].str() << ": " << err_msg; return; diff --git a/src/sema_manager.cc b/src/sema_manager.cc index a7b6f8ca..14f303b5 100644 --- a/src/sema_manager.cc +++ b/src/sema_manager.cc @@ -179,7 +179,9 @@ public: void InclusionDirective(SourceLocation hashLoc, const Token &includeTok, StringRef fileName, bool isAngled, CharSourceRange filenameRange, -#if LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2 +#if LLVM_VERSION_MAJOR >= 16 // llvmorg-16-init-15080-g854c10f8d185 + OptionalFileEntryRef fileRef, +#elif LLVM_VERSION_MAJOR >= 15 // llvmorg-15-init-7692-gd79ad2f1dbc2 llvm::Optional fileRef, #else const FileEntry *file,