clang-tools
7.0.0
|
A wrapper around GlobalCompilationDatabase that caches the compile commands. More...
#include <GlobalCompilationDatabase.h>
Public Member Functions | |
CachingCompilationDb (const GlobalCompilationDatabase &InnerCDB) | |
llvm::Optional< tooling::CompileCommand > | getCompileCommand (PathRef File) const override |
Gets compile command for File from cache or CDB if it's not in the cache. More... | |
tooling::CompileCommand | getFallbackCommand (PathRef File) const override |
Forwards to the inner CDB. Results of this function are not cached. More... | |
void | invalidate (PathRef File) |
Removes an entry for File if it's present in the cache. More... | |
void | clear () |
Removes all cached compile commands. More... | |
![]() | |
virtual | ~GlobalCompilationDatabase ()=default |
A wrapper around GlobalCompilationDatabase that caches the compile commands.
Note that only results of getCompileCommand are cached.
Definition at line 91 of file GlobalCompilationDatabase.h.
|
explicit |
Definition at line 122 of file GlobalCompilationDatabase.cpp.
void clang::clangd::CachingCompilationDb::clear | ( | ) |
Removes all cached compile commands.
Definition at line 150 of file GlobalCompilationDatabase.cpp.
|
overridevirtual |
Gets compile command for File
from cache or CDB if it's not in the cache.
Implements clang::clangd::GlobalCompilationDatabase.
Definition at line 127 of file GlobalCompilationDatabase.cpp.
References clang::clangd::GlobalCompilationDatabase::getCompileCommand().
|
overridevirtual |
Forwards to the inner CDB. Results of this function are not cached.
Reimplemented from clang::clangd::GlobalCompilationDatabase.
Definition at line 141 of file GlobalCompilationDatabase.cpp.
References clang::clangd::GlobalCompilationDatabase::getFallbackCommand().
void clang::clangd::CachingCompilationDb::invalidate | ( | PathRef | File | ) |
Removes an entry for File
if it's present in the cache.
Definition at line 145 of file GlobalCompilationDatabase.cpp.