clang-tools  7.0.0
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...
 
tooling::CompileCommand getFallbackCommand (PathRef File) const override
 Uses the default fallback command, adding any extra flags. More...
 
void setCompileCommandsDir (Path P)
 Set the compile commands directory to P. More...
 
void setExtraFlagsForFile (PathRef File, std::vector< std::string > ExtraFlags)
 Sets the extra flags that should be added to a file. More...
 
- Public Member Functions inherited from clang::clangd::GlobalCompilationDatabase
virtual ~GlobalCompilationDatabase ()=default
 

Detailed Description

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

Definition at line 50 of file GlobalCompilationDatabase.h.

Constructor & Destructor Documentation

◆ DirectoryBasedGlobalCompilationDatabase()

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

◆ ~DirectoryBasedGlobalCompilationDatabase()

clang::clangd::DirectoryBasedGlobalCompilationDatabase::~DirectoryBasedGlobalCompilationDatabase ( )
overridedefault

Member Function Documentation

◆ getCompileCommand()

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

Scans File's parents looking for compilation databases.

Any extra flags will be added.

Implements clang::clangd::GlobalCompilationDatabase.

Definition at line 42 of file GlobalCompilationDatabase.cpp.

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

◆ getFallbackCommand()

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

Uses the default fallback command, adding any extra flags.

Reimplemented from clang::clangd::GlobalCompilationDatabase.

Definition at line 56 of file GlobalCompilationDatabase.cpp.

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

◆ setCompileCommandsDir()

void clang::clangd::DirectoryBasedGlobalCompilationDatabase::setCompileCommandsDir ( Path  P)

Set the compile commands directory to P.

Definition at line 63 of file GlobalCompilationDatabase.cpp.

◆ setExtraFlagsForFile()

void clang::clangd::DirectoryBasedGlobalCompilationDatabase::setExtraFlagsForFile ( PathRef  File,
std::vector< std::string >  ExtraFlags 
)

Sets the extra flags that should be added to a file.

Definition at line 69 of file GlobalCompilationDatabase.cpp.

References clang::clangd::File.


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