clang-tools 10.0.0

Classes | Public Member Functions | List of all members
clang::clangd::DirectoryBasedGlobalCompilationDatabase Class Reference

Gets compile args from tooling::CompilationDatabases built for parent directories. More...

`#include <GlobalCompilationDatabase.h>`

Inheritance diagram for clang::clangd::DirectoryBasedGlobalCompilationDatabase:
[legend]
Collaboration diagram for clang::clangd::DirectoryBasedGlobalCompilationDatabase:
[legend]

## Public Member Functions
| DirectoryBasedGlobalCompilationDatabase (llvm::Optional< Path > CompileCommandsDir)
| ~DirectoryBasedGlobalCompilationDatabase () override
llvm::Optional< tooling::CompileCommand > | getCompileCommand (PathRef File) const override
| Scans File's parents looking for compilation databases. More...
llvm::Optional< ProjectInfo > | getProjectInfo (PathRef File) const override
| Returns the path to first directory containing a compilation database in `File's` parents. More...
Public Member Functions inherited from clang::clangd::GlobalCompilationDatabase
virtual | ~GlobalCompilationDatabase ()=default
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...

## 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

Gets compile args from tooling::CompilationDatabases built for parent directories.

Definition at line 66 of file GlobalCompilationDatabase.h.

## Constructor & Destructor Documentation

## ◆ DirectoryBasedGlobalCompilationDatabase()

clang::clangd::DirectoryBasedGlobalCompilationDatabase::DirectoryBasedGlobalCompilationDatabase | ( | llvm::Optional< Path > | CompileCommandsDir | ) |

Definition at line 62 of file GlobalCompilationDatabase.cpp.

References ~DirectoryBasedGlobalCompilationDatabase().

Referenced by clang::clangd::GlobalCompilationDatabase::getFallbackCommand().

## ◆ ~DirectoryBasedGlobalCompilationDatabase()

clang::clangd::DirectoryBasedGlobalCompilationDatabase::~DirectoryBasedGlobalCompilationDatabase | ( |  | ) |
| override default

Referenced by DirectoryBasedGlobalCompilationDatabase().

## Member Function Documentation

## ◆ getCompileCommand()

llvm::Optional< tooling::CompileCommand > clang::clangd::DirectoryBasedGlobalCompilationDatabase::getCompileCommand | ( | PathRef | File | ) | const
| override virtual

Scans File's parents looking for compilation databases.

Any extra flags will be added. Might trigger OnCommandChanged, if CDB wasn't broadcasted yet.

Implements clang::clangd::GlobalCompilationDatabase.

Definition at line 70 of file GlobalCompilationDatabase.cpp.

References clang::clangd::File, clang::clangd::log(), and clang::clangd::None.

## ◆ getProjectInfo()

llvm::Optional< ProjectInfo > clang::clangd::DirectoryBasedGlobalCompilationDatabase::getProjectInfo | ( | PathRef | File | ) | const
| override virtual

Returns the path to first directory containing a compilation database in `File's` parents.

Reimplemented from clang::clangd::GlobalCompilationDatabase.

Definition at line 222 of file GlobalCompilationDatabase.cpp.

References clang::clangd::File, and clang::clangd::None.

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

- GlobalCompilationDatabase.h
- GlobalCompilationDatabase.cpp