clang-tools  14.0.0git
Public Member Functions | List of all members
clang::clangd::DelegatingCDB Class Reference

#include <GlobalCompilationDatabase.h>

Inheritance diagram for clang::clangd::DelegatingCDB:
Inheritance graph
[legend]
Collaboration diagram for clang::clangd::DelegatingCDB:
Collaboration graph
[legend]

Public Member Functions

 DelegatingCDB (const GlobalCompilationDatabase *Base)
 
 DelegatingCDB (std::unique_ptr< GlobalCompilationDatabase > Base)
 
llvm::Optional< tooling::CompileCommand > getCompileCommand (PathRef File) const override
 If there are any known-good commands for building this file, returns one. More...
 
llvm::Optional< ProjectInfogetProjectInfo (PathRef File) const override
 Finds the closest project to File. More...
 
tooling::CompileCommand getFallbackCommand (PathRef File) const override
 Makes a guess at how to build a file. More...
 
bool blockUntilIdle (Deadline D) const override
 If the CDB does any asynchronous work, wait for it to complete. More...
 
- Public Member Functions inherited from clang::clangd::GlobalCompilationDatabase
virtual ~GlobalCompilationDatabase ()=default
 
CommandChanged::Subscription watch (CommandChanged::Listener L) const
 The callback is notified when files may have new compile commands. More...
 

Additional Inherited Members

- Public Types inherited from clang::clangd::GlobalCompilationDatabase
using CommandChanged = Event< std::vector< std::string > >
 
- Protected Attributes inherited from clang::clangd::GlobalCompilationDatabase
CommandChanged OnCommandChanged
 

Detailed Description

Definition at line 70 of file GlobalCompilationDatabase.h.

Constructor & Destructor Documentation

◆ DelegatingCDB() [1/2]

clang::clangd::DelegatingCDB::DelegatingCDB ( const GlobalCompilationDatabase Base)

◆ DelegatingCDB() [2/2]

clang::clangd::DelegatingCDB::DelegatingCDB ( std::unique_ptr< GlobalCompilationDatabase Base)

Definition at line 804 of file GlobalCompilationDatabase.cpp.

Member Function Documentation

◆ blockUntilIdle()

bool clang::clangd::DelegatingCDB::blockUntilIdle ( Deadline  D) const
overridevirtual

If the CDB does any asynchronous work, wait for it to complete.

For use in tests.

Reimplemented from clang::clangd::GlobalCompilationDatabase.

Definition at line 828 of file GlobalCompilationDatabase.cpp.

References clang::clangd::GlobalCompilationDatabase::blockUntilIdle(), and ns1::ns2::D.

◆ getCompileCommand()

llvm::Optional< tooling::CompileCommand > clang::clangd::DelegatingCDB::getCompileCommand ( PathRef  File) const
overridevirtual

If there are any known-good commands for building this file, returns one.

Implements clang::clangd::GlobalCompilationDatabase.

Reimplemented in clang::clangd::OverlayCDB.

Definition at line 810 of file GlobalCompilationDatabase.cpp.

References clang::clangd::GlobalCompilationDatabase::getCompileCommand().

◆ getFallbackCommand()

tooling::CompileCommand clang::clangd::DelegatingCDB::getFallbackCommand ( PathRef  File) const
overridevirtual

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 from clang::clangd::GlobalCompilationDatabase.

Reimplemented in clang::clangd::OverlayCDB.

Definition at line 822 of file GlobalCompilationDatabase.cpp.

References clang::clangd::GlobalCompilationDatabase::getFallbackCommand().

◆ getProjectInfo()

llvm::Optional< ProjectInfo > clang::clangd::DelegatingCDB::getProjectInfo ( PathRef  File) const
overridevirtual

Finds the closest project to File.

Reimplemented from clang::clangd::GlobalCompilationDatabase.

Definition at line 816 of file GlobalCompilationDatabase.cpp.

References clang::clangd::GlobalCompilationDatabase::getProjectInfo().


The documentation for this class was generated from the following files: