clang-tools  6.0.0svn
Public Types | Public Member Functions | Static Public Attributes | List of all members
clang::tidy::ClangTidyOptionsProvider Class Referenceabstract

Abstract interface for retrieving various ClangTidy options. More...

#include <ClangTidyOptions.h>

Inheritance diagram for clang::tidy::ClangTidyOptionsProvider:
Inheritance graph
[legend]
Collaboration diagram for clang::tidy::ClangTidyOptionsProvider:
Collaboration graph
[legend]

Public Types

typedef std::pair< ClangTidyOptions, std::string > OptionsSource
 ClangTidyOptions and its source. More...
 

Public Member Functions

virtual ~ClangTidyOptionsProvider ()
 
virtual const ClangTidyGlobalOptionsgetGlobalOptions ()=0
 Returns global options, which are independent of the file. More...
 
virtual std::vector< OptionsSourcegetRawOptions (llvm::StringRef FileName)=0
 Returns an ordered vector of OptionsSources, in order of increasing priority. More...
 
ClangTidyOptions getOptions (llvm::StringRef FileName)
 Returns options applying to a specific translation unit with the specified FileName. More...
 

Static Public Attributes

static const char OptionsSourceTypeDefaultBinary []
 
static const char OptionsSourceTypeCheckCommandLineOption []
 
static const char OptionsSourceTypeConfigCommandLineOption []
 

Detailed Description

Abstract interface for retrieving various ClangTidy options.

Definition at line 114 of file ClangTidyOptions.h.

Member Typedef Documentation

◆ OptionsSource

ClangTidyOptions and its source.

clang-tidy has 3 types of the sources in order of increasing priority:

  • clang-tidy binary.
  • '-config' commandline option or a specific configuration file. If the commandline option is specified, clang-tidy will ignore the configuration file.
  • '-checks' commandline option.

Definition at line 133 of file ClangTidyOptions.h.

Constructor & Destructor Documentation

◆ ~ClangTidyOptionsProvider()

virtual clang::tidy::ClangTidyOptionsProvider::~ClangTidyOptionsProvider ( )
inlinevirtual

Definition at line 120 of file ClangTidyOptions.h.

Member Function Documentation

◆ getGlobalOptions()

virtual const ClangTidyGlobalOptions& clang::tidy::ClangTidyOptionsProvider::getGlobalOptions ( )
pure virtual

Returns global options, which are independent of the file.

Implemented in clang::tidy::DefaultOptionsProvider.

◆ getOptions()

ClangTidyOptions clang::tidy::ClangTidyOptionsProvider::getOptions ( llvm::StringRef  FileName)

Returns options applying to a specific translation unit with the specified FileName.

Definition at line 171 of file ClangTidyOptions.cpp.

References clang::tidy::ClangTidyOptions::mergeWith().

◆ getRawOptions()

virtual std::vector<OptionsSource> clang::tidy::ClangTidyOptionsProvider::getRawOptions ( llvm::StringRef  FileName)
pure virtual

Returns an ordered vector of OptionsSources, in order of increasing priority.

Implemented in clang::tidy::FileOptionsProvider, clang::tidy::ConfigOptionsProvider, and clang::tidy::DefaultOptionsProvider.

Member Data Documentation

◆ OptionsSourceTypeCheckCommandLineOption

const char clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeCheckCommandLineOption
static
Initial value:
=
"command-line option '-checks'"

Definition at line 117 of file ClangTidyOptions.h.

Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions(), and clang::tidy::FileOptionsProvider::getRawOptions().

◆ OptionsSourceTypeConfigCommandLineOption

const char clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeConfigCommandLineOption
static
Initial value:
=
"command-line option '-config'"

Definition at line 118 of file ClangTidyOptions.h.

Referenced by clang::tidy::ConfigOptionsProvider::getRawOptions().

◆ OptionsSourceTypeDefaultBinary

const char clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeDefaultBinary
static
Initial value:
=
"clang-tidy binary"

Definition at line 116 of file ClangTidyOptions.h.


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