mirror of
https://github.com/MaskRay/ccls.git
synced 2025-08-17 20:22:23 +00:00
Accomate changes of LLVM 21 & 22 to make build pass
This commit is contained in:
parent
3799e38920
commit
2aedb544db
@ -116,11 +116,18 @@ std::unique_ptr<CompilerInvocation> buildCompilerInvocation(const std::string &m
|
|||||||
args.insert(args.begin() + 1, std::begin(arr), std::end(arr));
|
args.insert(args.begin() + 1, std::begin(arr), std::end(arr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (LLVM_VERSION_MAJOR == 21 && LLVM_VERSION_MINOR >= 1) || \
|
||||||
|
(LLVM_VERSION_MAJOR >= 22) // 13e1a2cb
|
||||||
|
DiagnosticOptions DiagOpt;
|
||||||
|
#else
|
||||||
|
DiagnosticOptions *DiagOpt = new DiagnosticOptions;
|
||||||
|
#endif
|
||||||
|
|
||||||
IntrusiveRefCntPtr<DiagnosticsEngine> diags(CompilerInstance::createDiagnostics(
|
IntrusiveRefCntPtr<DiagnosticsEngine> diags(CompilerInstance::createDiagnostics(
|
||||||
#if LLVM_VERSION_MAJOR >= 20
|
#if LLVM_VERSION_MAJOR >= 20
|
||||||
*vfs,
|
*vfs,
|
||||||
#endif
|
#endif
|
||||||
new DiagnosticOptions, new IgnoringDiagConsumer, true));
|
DiagOpt, new IgnoringDiagConsumer, true));
|
||||||
#if LLVM_VERSION_MAJOR < 12 // llvmorg-12-init-5498-g257b29715bb
|
#if LLVM_VERSION_MAJOR < 12 // llvmorg-12-init-5498-g257b29715bb
|
||||||
driver::Driver d(args[0], llvm::sys::getDefaultTargetTriple(), *diags, vfs);
|
driver::Driver d(args[0], llvm::sys::getDefaultTargetTriple(), *diags, vfs);
|
||||||
#else
|
#else
|
||||||
|
@ -350,7 +350,7 @@ public:
|
|||||||
if (fd->getTemplatedDecl()->getKind() == Decl::CXXDeductionGuide)
|
if (fd->getTemplatedDecl()->getKind() == Decl::CXXDeductionGuide)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (auto *rd = dyn_cast<RecordDecl>(r.Declaration))
|
if (auto *rd = dyn_cast<CXXRecordDecl>(r.Declaration))
|
||||||
if (rd->isInjectedClassName())
|
if (rd->isInjectedClassName())
|
||||||
continue;
|
continue;
|
||||||
auto nk = r.Declaration->getDeclName().getNameKind();
|
auto nk = r.Declaration->getDeclName().getNameKind();
|
||||||
|
@ -352,7 +352,13 @@ void buildPreamble(Session &session, CompilerInvocation &ci, IntrusiveRefCntPtr<
|
|||||||
#if LLVM_VERSION_MAJOR >= 20
|
#if LLVM_VERSION_MAJOR >= 20
|
||||||
*fs,
|
*fs,
|
||||||
#endif
|
#endif
|
||||||
&ci.getDiagnosticOpts(), &dc, false);
|
#if (LLVM_VERSION_MAJOR == 21 && LLVM_VERSION_MINOR >= 1) || \
|
||||||
|
(LLVM_VERSION_MAJOR >= 22) // 13e1a2cb
|
||||||
|
ci.getDiagnosticOpts(),
|
||||||
|
#else
|
||||||
|
&ci.getDiagnosticOpts(),
|
||||||
|
#endif
|
||||||
|
&dc, false);
|
||||||
if (oldP) {
|
if (oldP) {
|
||||||
std::lock_guard lock(session.wfiles->mutex);
|
std::lock_guard lock(session.wfiles->mutex);
|
||||||
for (auto &include : oldP->includes)
|
for (auto &include : oldP->includes)
|
||||||
@ -362,7 +368,13 @@ void buildPreamble(Session &session, CompilerInvocation &ci, IntrusiveRefCntPtr<
|
|||||||
}
|
}
|
||||||
|
|
||||||
CclsPreambleCallbacks pc;
|
CclsPreambleCallbacks pc;
|
||||||
if (auto newPreamble = PrecompiledPreamble::Build(ci, buf.get(), bounds, *de, fs, session.pch, true,
|
if (auto newPreamble = PrecompiledPreamble::Build(ci, buf.get(), bounds,
|
||||||
|
#if LLVM_VERSION_MAJOR >= 22 // c7f34375
|
||||||
|
de,
|
||||||
|
#else
|
||||||
|
*de,
|
||||||
|
#endif
|
||||||
|
fs, session.pch, true,
|
||||||
#if LLVM_VERSION_MAJOR >= 17 // llvmorg-17-init-4072-gcc929590ad30
|
#if LLVM_VERSION_MAJOR >= 17 // llvmorg-17-init-4072-gcc929590ad30
|
||||||
"",
|
"",
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user