MCPcopy Create free account
hub / github.com/MaskRay/ccls / openFileForRead

Method openFileForRead

src/sema_manager.cc:52–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 VFS(IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs, PreambleStatCache &cache)
51 : ProxyFileSystem(std::move(fs)), cache(cache) {}
52 llvm::ErrorOr<std::unique_ptr<llvm::vfs::File>> openFileForRead(const Twine &path) override {
53 auto file = getUnderlyingFS().openFileForRead(path);
54 if (!file || !*file)
55 return file;
56 cache.update(path, file->get()->status());
57 return file;
58 }
59 llvm::ErrorOr<llvm::vfs::Status> status(const Twine &path) override {
60 auto s = getUnderlyingFS().status(path);
61 cache.update(path, s);

Callers

nothing calls this directly

Calls 3

statusMethod · 0.80
updateMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected