mirror of
https://github.com/MaskRay/ccls.git
synced 2025-06-13 03:32:14 +00:00
Add namespace alias clang::vfs = llvm::vfs to adapt D52783
This commit is contained in:
parent
e29056b2db
commit
e8317bd538
@ -114,11 +114,11 @@ struct PreambleStatCache {
|
||||
return new VFS(std::move(FS), *this);
|
||||
}
|
||||
|
||||
IntrusiveRefCntPtr<vfs::FileSystem>
|
||||
Consumer(IntrusiveRefCntPtr<vfs::FileSystem> FS) {
|
||||
struct VFS : vfs::ProxyFileSystem {
|
||||
IntrusiveRefCntPtr<llvm::vfs::FileSystem>
|
||||
Consumer(IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS) {
|
||||
struct VFS : llvm::vfs::ProxyFileSystem {
|
||||
const PreambleStatCache &Cache;
|
||||
VFS(IntrusiveRefCntPtr<vfs::FileSystem> FS,
|
||||
VFS(IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS,
|
||||
const PreambleStatCache &Cache)
|
||||
: ProxyFileSystem(std::move(FS)), Cache(Cache) {}
|
||||
llvm::ErrorOr<vfs::Status> status(const Twine &Path) override {
|
||||
|
@ -63,8 +63,8 @@ struct CompletionSession
|
||||
bool inferred = false;
|
||||
|
||||
// TODO share
|
||||
llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> FS =
|
||||
clang::vfs::getRealFileSystem();
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS =
|
||||
llvm::vfs::getRealFileSystem();
|
||||
std::shared_ptr<clang::PCHContainerOperations> PCH;
|
||||
|
||||
CompletionSession(const Project::Entry &file, WorkingFiles *wfiles,
|
||||
|
@ -83,7 +83,7 @@ Range FromTokenRange(const SourceManager &SM, const LangOptions &LangOpts,
|
||||
|
||||
std::unique_ptr<CompilerInvocation>
|
||||
BuildCompilerInvocation(std::vector<const char *> args,
|
||||
IntrusiveRefCntPtr<vfs::FileSystem> VFS) {
|
||||
IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) {
|
||||
std::string save = "-resource-dir=" + g_config->clang.resourceDir;
|
||||
args.push_back(save.c_str());
|
||||
IntrusiveRefCntPtr<DiagnosticsEngine> Diags(
|
||||
|
@ -22,6 +22,13 @@ limitations under the License.
|
||||
#include <clang/Basic/SourceManager.h>
|
||||
#include <clang/Frontend/CompilerInstance.h>
|
||||
|
||||
#if LLVM_VERSION_MAJOR < 8
|
||||
// D52783 Lift VFS from clang to llvm
|
||||
namespace llvm {
|
||||
namespace vfs = clang::vfs;
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string PathFromFileEntry(const clang::FileEntry &file);
|
||||
|
||||
Range FromCharSourceRange(const clang::SourceManager &SM,
|
||||
@ -39,6 +46,6 @@ Range FromTokenRange(const clang::SourceManager &SM,
|
||||
|
||||
std::unique_ptr<clang::CompilerInvocation>
|
||||
BuildCompilerInvocation(std::vector<const char *> args,
|
||||
llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> VFS);
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS);
|
||||
|
||||
const char *ClangBuiltinTypeName(int);
|
||||
|
@ -1225,7 +1225,7 @@ Index(CompletionManager *completion, WorkingFiles *wfiles, VFS *vfs,
|
||||
const std::vector<std::pair<std::string, std::string>> &remapped, bool &ok) {
|
||||
ok = true;
|
||||
auto PCH = std::make_shared<PCHContainerOperations>();
|
||||
llvm::IntrusiveRefCntPtr<vfs::FileSystem> FS = vfs::getRealFileSystem();
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS = llvm::vfs::getRealFileSystem();
|
||||
std::shared_ptr<CompilerInvocation> CI = BuildCompilerInvocation(args, FS);
|
||||
// e.g. .s
|
||||
if (!CI)
|
||||
|
Loading…
Reference in New Issue
Block a user