Go to the documentation of this file.
12 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_TESTFS_H
13 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_TESTFS_H
17 #include "llvm/ADT/IntrusiveRefCntPtr.h"
18 #include "llvm/ADT/Optional.h"
19 #include "llvm/Support/Path.h"
20 #include "llvm/Support/VirtualFileSystem.h"
27 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>
29 llvm::StringMap<time_t>
const &Timestamps = {});
34 IntrusiveRefCntPtr<llvm::vfs::FileSystem>
viewImpl()
const override {
38 llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFileSystem =
39 new llvm::vfs::OverlayFileSystem(llvm::vfs::getRealFileSystem());
40 OverlayFileSystem->pushOverlay(MemFS);
41 return OverlayFileSystem;
45 llvm::StringMap<std::string>
Files;
61 StringRef RelPathPrefix = StringRef());
63 llvm::Optional<tooling::CompileCommand>
72 StringRef RelPathPrefix;
80 llvm::sys::path::Style = llvm::sys::path::Style::native);
std::string testPath(PathRef File, llvm::sys::path::Style Style)
IntrusiveRefCntPtr< llvm::vfs::FileSystem > viewImpl() const override
Overridden by implementations to provide a vfs::FileSystem.
Provides compilation arguments used for parsing C and C++ files.
volatile int UnittestSchemeAnchorSource
llvm::Optional< tooling::CompileCommand > getCompileCommand(PathRef File) const override
If there are any known-good commands for building this file, returns one.
MockCompilationDatabase(StringRef Directory=StringRef(), StringRef RelPathPrefix=StringRef())
If Directory is not empty, use that as the Directory field of the CompileCommand, and as project Sour...
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > buildTestFS(llvm::StringMap< std::string > const &Files, llvm::StringMap< time_t > const &Timestamps)
llvm::StringMap< time_t > Timestamps
llvm::Optional< ProjectInfo > getProjectInfo(PathRef File) const override
Finds the closest project to File.
bool OverlayRealFileSystemForModules
llvm::DenseSet< FileID > Files
llvm::StringRef PathRef
A typedef to represent a ref to file path.
Wrapper for vfs::FileSystem for use in multithreaded programs like clangd.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::StringMap< std::string > Files
std::vector< std::string > ExtraClangFlags