clang-tools
8.0.0
|
Provides compilation arguments used for parsing C and C++ files. More...
#include <GlobalCompilationDatabase.h>
Public Types | |
using | CommandChanged = Event< std::vector< std::string > > |
Public Member Functions | |
virtual | ~GlobalCompilationDatabase ()=default |
virtual llvm::Optional< tooling::CompileCommand > | getCompileCommand (PathRef File, ProjectInfo *=nullptr) const =0 |
If there are any known-good commands for building this file, returns one. More... | |
virtual tooling::CompileCommand | getFallbackCommand (PathRef File) const |
Makes a guess at how to build a file. More... | |
CommandChanged::Subscription | watch (CommandChanged::Listener L) const |
The callback is notified when files may have new compile commands. More... | |
Protected Attributes | |
CommandChanged | OnCommandChanged |
Provides compilation arguments used for parsing C and C++ files.
Definition at line 39 of file GlobalCompilationDatabase.h.
using clang::clangd::GlobalCompilationDatabase::CommandChanged = Event<std::vector<std::string> > |
Definition at line 53 of file GlobalCompilationDatabase.h.
|
virtualdefault |
|
pure virtual |
If there are any known-good commands for building this file, returns one.
If the ProjectInfo pointer is set, it will also be populated.
Implemented in clang::clangd::OverlayCDB, and clang::clangd::DirectoryBasedGlobalCompilationDatabase.
Referenced by clang::clangd::ClangdServer::findHover().
|
virtual |
Makes a guess at how to build a file.
The default implementation just runs clang on the file. Clangd should treat the results as unreliable.
Reimplemented in clang::clangd::OverlayCDB.
Definition at line 54 of file GlobalCompilationDatabase.cpp.
References clang::clangd::DirectoryBasedGlobalCompilationDatabase::DirectoryBasedGlobalCompilationDatabase(), and clang::clangd::getFallbackClangPath().
Referenced by clang::clangd::ClangdServer::findHover(), and clang::clangd::OverlayCDB::getFallbackCommand().
|
inline |
The callback is notified when files may have new compile commands.
The argument is a list of full file paths.
Definition at line 56 of file GlobalCompilationDatabase.h.
Referenced by clang::clangd::OverlayCDB::OverlayCDB().
|
mutableprotected |
Definition at line 61 of file GlobalCompilationDatabase.h.
Referenced by clang::clangd::OverlayCDB::OverlayCDB().