Compare commits

..

No commits in common. "master" and "0.20250815.1" have entirely different histories.

3 changed files with 2 additions and 21 deletions

View File

@ -325,9 +325,6 @@ try_again:
switch (tp->getTypeClass()) { switch (tp->getTypeClass()) {
case Type::Typedef: case Type::Typedef:
d = cast<TypedefType>(tp)->getDecl(); d = cast<TypedefType>(tp)->getDecl();
tp = cast<TypedefType>(tp)->getDecl()->getUnderlyingType().getTypePtrOrNull();
if (tp)
goto try_again;
break; break;
case Type::ObjCObject: case Type::ObjCObject:
d = cast<ObjCObjectType>(tp)->getInterface(); d = cast<ObjCObjectType>(tp)->getInterface();
@ -364,11 +361,9 @@ try_again:
// FIXME: Template type parameters! // FIXME: Template type parameters!
#if LLVM_VERSION_MAJOR < 22 // llvmorg-22-init-3166-g91cdd35008e9
case Type::Elaborated: case Type::Elaborated:
tp = cast<ElaboratedType>(tp)->getNamedType().getTypePtrOrNull(); tp = cast<ElaboratedType>(tp)->getNamedType().getTypePtrOrNull();
goto try_again; goto try_again;
#endif
default: default:
break; break;
@ -1268,7 +1263,7 @@ IndexResult index(WorkingFiles *wfiles, VFS *vfs, const std::string &opt_wdir, c
clang->setInvocation(std::move(ci)); clang->setInvocation(std::move(ci));
#endif #endif
clang->createDiagnostics( clang->createDiagnostics(
#if LLVM_VERSION_MAJOR >= 20 && LLVM_VERSION_MAJOR < 22 #if LLVM_VERSION_MAJOR >= 20
*fs, *fs,
#endif #endif
&dc, false); &dc, false);
@ -1281,12 +1276,7 @@ IndexResult index(WorkingFiles *wfiles, VFS *vfs, const std::string &opt_wdir, c
if (!clang->hasTarget()) if (!clang->hasTarget())
return {}; return {};
clang->getPreprocessorOpts().RetainRemappedFileBuffers = true; clang->getPreprocessorOpts().RetainRemappedFileBuffers = true;
#if LLVM_VERSION_MAJOR >= 22
clang->setVirtualFileSystem(fs);
clang->createFileManager();
#else
clang->createFileManager(fs); clang->createFileManager(fs);
#endif
clang->setSourceManager(new SourceManager(clang->getDiagnostics(), clang->getFileManager(), true)); clang->setSourceManager(new SourceManager(clang->getDiagnostics(), clang->getFileManager(), true));
IndexParam param(*vfs, no_linkage); IndexParam param(*vfs, no_linkage);

View File

@ -345,11 +345,7 @@ void do_initialize(MessageHandler *m, InitializeParam &param, ReplyOnce &reply)
if (g_config->cache.directory.size()) { if (g_config->cache.directory.size()) {
SmallString<256> path(g_config->cache.directory); SmallString<256> path(g_config->cache.directory);
#if LLVM_VERSION_MAJOR >= 22
sys::path::make_absolute(project_path, path);
#else
sys::fs::make_absolute(project_path, path); sys::fs::make_absolute(project_path, path);
#endif
// Use upper case for the Driver letter on Windows. // Use upper case for the Driver letter on Windows.
g_config->cache.directory = normalizePath(path.str()); g_config->cache.directory = normalizePath(path.str());
ensureEndsInSlash(g_config->cache.directory); ensureEndsInSlash(g_config->cache.directory);

View File

@ -268,7 +268,7 @@ std::unique_ptr<CompilerInstance> buildCompilerInstance(Session &session, std::u
clang->setInvocation(std::move(ci)); clang->setInvocation(std::move(ci));
#endif #endif
clang->createDiagnostics( clang->createDiagnostics(
#if LLVM_VERSION_MAJOR >= 20 && LLVM_VERSION_MAJOR < 22 #if LLVM_VERSION_MAJOR >= 20
*fs, *fs,
#endif #endif
&dc, false); &dc, false);
@ -283,12 +283,7 @@ std::unique_ptr<CompilerInstance> buildCompilerInstance(Session &session, std::u
// Construct SourceManager with UserFilesAreVolatile: true because otherwise // Construct SourceManager with UserFilesAreVolatile: true because otherwise
// RequiresNullTerminator: true may cause out-of-bounds read when a file is // RequiresNullTerminator: true may cause out-of-bounds read when a file is
// mmap'ed but is saved concurrently. // mmap'ed but is saved concurrently.
#if LLVM_VERSION_MAJOR >= 22
clang->setVirtualFileSystem(fs);
clang->createFileManager();
#else
clang->createFileManager(fs); clang->createFileManager(fs);
#endif
clang->setSourceManager(new SourceManager(clang->getDiagnostics(), clang->getFileManager(), true)); clang->setSourceManager(new SourceManager(clang->getDiagnostics(), clang->getFileManager(), true));
auto &isec = clang->getFrontendOpts().Inputs; auto &isec = clang->getFrontendOpts().Inputs;
if (isec.size()) { if (isec.size()) {