clang-tools  14.0.0git
ClangTidyOptions.h
Go to the documentation of this file.
1 //===--- ClangTidyOptions.h - clang-tidy ------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYOPTIONS_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYOPTIONS_H
11 
12 #include "llvm/ADT/IntrusiveRefCntPtr.h"
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/ADT/StringMap.h"
15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/Support/ErrorOr.h"
17 #include "llvm/Support/MemoryBufferRef.h"
18 #include "llvm/Support/VirtualFileSystem.h"
19 #include <functional>
20 #include <string>
21 #include <system_error>
22 #include <utility>
23 #include <vector>
24 
25 namespace clang {
26 namespace tidy {
27 
28 /// Contains a list of line ranges in a single file.
29 struct FileFilter {
30  /// File name.
31  std::string Name;
32 
33  /// LineRange is a pair<start, end> (inclusive).
34  typedef std::pair<unsigned, unsigned> LineRange;
35 
36  /// A list of line ranges in this file, for which we show warnings.
37  std::vector<LineRange> LineRanges;
38 };
39 
40 /// Global options. These options are neither stored nor read from
41 /// configuration files.
43  /// Output warnings from certain line ranges of certain files only.
44  /// If empty, no warnings will be filtered.
45  std::vector<FileFilter> LineFilter;
46 };
47 
48 /// Contains options for clang-tidy. These options may be read from
49 /// configuration files, and may be different for different translation units.
51  /// These options are used for all settings that haven't been
52  /// overridden by the \c OptionsProvider.
53  ///
54  /// Allow no checks and no headers by default. This method initializes
55  /// check-specific options by calling \c ClangTidyModule::getModuleOptions()
56  /// of each registered \c ClangTidyModule.
58 
59  /// Overwrites all fields in here by the fields of \p Other that have a value.
60  /// \p Order specifies precedence of \p Other option.
61  ClangTidyOptions &mergeWith(const ClangTidyOptions &Other, unsigned Order);
62 
63  /// Creates a new \c ClangTidyOptions instance combined from all fields
64  /// of this instance overridden by the fields of \p Other that have a value.
65  /// \p Order specifies precedence of \p Other option.
66  LLVM_NODISCARD ClangTidyOptions merge(const ClangTidyOptions &Other,
67  unsigned Order) const;
68 
69  /// Checks filter.
70  llvm::Optional<std::string> Checks;
71 
72  /// WarningsAsErrors filter.
73  llvm::Optional<std::string> WarningsAsErrors;
74 
75  /// Output warnings from headers matching this filter. Warnings from
76  /// main files will always be displayed.
77  llvm::Optional<std::string> HeaderFilterRegex;
78 
79  /// Output warnings from system headers matching \c HeaderFilterRegex.
80  llvm::Optional<bool> SystemHeaders;
81 
82  /// Format code around applied fixes with clang-format using this
83  /// style.
84  ///
85  /// Can be one of:
86  /// * 'none' - don't format code around applied fixes;
87  /// * 'llvm', 'google', 'mozilla' or other predefined clang-format style
88  /// names;
89  /// * 'file' - use the .clang-format file in the closest parent directory of
90  /// each source file;
91  /// * '{inline-formatting-style-in-yaml-format}'.
92  ///
93  /// See clang-format documentation for more about configuring format style.
94  llvm::Optional<std::string> FormatStyle;
95 
96  /// Specifies the name or e-mail of the user running clang-tidy.
97  ///
98  /// This option is used, for example, to place the correct user name in TODO()
99  /// comments in the relevant check.
100  llvm::Optional<std::string> User;
101 
102  /// Helper structure for storing option value with priority of the value.
103  struct ClangTidyValue {
105  ClangTidyValue(const char *Value) : Value(Value), Priority(0) {}
106  ClangTidyValue(llvm::StringRef Value, unsigned Priority = 0)
107  : Value(Value), Priority(Priority) {}
108 
109  std::string Value;
110  /// Priority stores relative precedence of the value loaded from config
111  /// files to disambigute local vs global value from different levels.
112  unsigned Priority;
113  };
114  typedef std::pair<std::string, std::string> StringPair;
115  typedef llvm::StringMap<ClangTidyValue> OptionMap;
116 
117  /// Key-value mapping used to store check-specific options.
119 
120  typedef std::vector<std::string> ArgList;
121 
122  /// Add extra compilation arguments to the end of the list.
123  llvm::Optional<ArgList> ExtraArgs;
124 
125  /// Add extra compilation arguments to the start of the list.
126  llvm::Optional<ArgList> ExtraArgsBefore;
127 
128  /// Only used in the FileOptionsProvider and ConfigOptionsProvider. If true
129  /// and using a FileOptionsProvider, it will take a configuration file in the
130  /// parent directory (if any exists) and apply this config file on top of the
131  /// parent one. IF true and using a ConfigOptionsProvider, it will apply this
132  /// config on top of any configuation file it finds in the directory using the
133  /// same logic as FileOptionsProvider. If false or missing, only this
134  /// configuration file will be used.
135  llvm::Optional<bool> InheritParentConfig;
136 
137  /// Use colors in diagnostics. If missing, it will be auto detected.
138  llvm::Optional<bool> UseColor;
139 };
140 
141 /// Abstract interface for retrieving various ClangTidy options.
143 public:
144  static const char OptionsSourceTypeDefaultBinary[];
147 
149 
150  /// Returns global options, which are independent of the file.
151  virtual const ClangTidyGlobalOptions &getGlobalOptions() = 0;
152 
153  /// ClangTidyOptions and its source.
154  //
155  /// clang-tidy has 3 types of the sources in order of increasing priority:
156  /// * clang-tidy binary.
157  /// * '-config' commandline option or a specific configuration file. If the
158  /// commandline option is specified, clang-tidy will ignore the
159  /// configuration file.
160  /// * '-checks' commandline option.
161  typedef std::pair<ClangTidyOptions, std::string> OptionsSource;
162 
163  /// Returns an ordered vector of OptionsSources, in order of increasing
164  /// priority.
165  virtual std::vector<OptionsSource>
166  getRawOptions(llvm::StringRef FileName) = 0;
167 
168  /// Returns options applying to a specific translation unit with the
169  /// specified \p FileName.
170  ClangTidyOptions getOptions(llvm::StringRef FileName);
171 };
172 
173 /// Implementation of the \c ClangTidyOptionsProvider interface, which
174 /// returns the same options for all files.
176 public:
178  ClangTidyOptions Options)
179  : GlobalOptions(std::move(GlobalOptions)),
180  DefaultOptions(std::move(Options)) {}
182  return GlobalOptions;
183  }
184  std::vector<OptionsSource> getRawOptions(llvm::StringRef FileName) override;
185 
186 private:
187  ClangTidyGlobalOptions GlobalOptions;
188  ClangTidyOptions DefaultOptions;
189 };
190 
192 protected:
193  // A pair of configuration file base name and a function parsing
194  // configuration from text in the corresponding format.
195  typedef std::pair<std::string, std::function<llvm::ErrorOr<ClangTidyOptions>(
196  llvm::MemoryBufferRef)>>
198 
199  /// Configuration file handlers listed in the order of priority.
200  ///
201  /// Custom configuration file formats can be supported by constructing the
202  /// list of handlers and passing it to the appropriate \c FileOptionsProvider
203  /// constructor. E.g. initialization of a \c FileOptionsProvider with support
204  /// of a custom configuration file format for files named ".my-tidy-config"
205  /// could look similar to this:
206  /// \code
207  /// FileOptionsProvider::ConfigFileHandlers ConfigHandlers;
208  /// ConfigHandlers.emplace_back(".my-tidy-config", parseMyConfigFormat);
209  /// ConfigHandlers.emplace_back(".clang-tidy", parseConfiguration);
210  /// return std::make_unique<FileOptionsProvider>(
211  /// GlobalOptions, DefaultOptions, OverrideOptions, ConfigHandlers);
212  /// \endcode
213  ///
214  /// With the order of handlers shown above, the ".my-tidy-config" file would
215  /// take precedence over ".clang-tidy" if both reside in the same directory.
216  typedef std::vector<ConfigFileHandler> ConfigFileHandlers;
217 
219  ClangTidyOptions DefaultOptions,
221  llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS);
222 
224  ClangTidyOptions DefaultOptions,
227 
228 protected:
229  void addRawFileOptions(llvm::StringRef AbsolutePath,
230  std::vector<OptionsSource> &CurOptions);
231 
232  /// Try to read configuration files from \p Directory using registered
233  /// \c ConfigHandlers.
234  llvm::Optional<OptionsSource> tryReadConfigFile(llvm::StringRef Directory);
235 
236  llvm::StringMap<OptionsSource> CachedOptions;
239  llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS;
240 };
241 
242 /// Implementation of ClangTidyOptions interface, which is used for
243 /// '-config' command-line option.
245 public:
247  ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
249  llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS = nullptr);
250  std::vector<OptionsSource> getRawOptions(llvm::StringRef FileName) override;
251 
252 private:
253  ClangTidyOptions ConfigOptions;
254 };
255 
256 /// Implementation of the \c ClangTidyOptionsProvider interface, which
257 /// tries to find a configuration file in the closest parent directory of each
258 /// source file.
259 ///
260 /// By default, files named ".clang-tidy" will be considered, and the
261 /// \c clang::tidy::parseConfiguration function will be used for parsing, but a
262 /// custom set of configuration file names and parsing functions can be
263 /// specified using the appropriate constructor.
265 public:
266  /// Initializes the \c FileOptionsProvider instance.
267  ///
268  /// \param GlobalOptions are just stored and returned to the caller of
269  /// \c getGlobalOptions.
270  ///
271  /// \param DefaultOptions are used for all settings not specified in a
272  /// configuration file.
273  ///
274  /// If any of the \param OverrideOptions fields are set, they will override
275  /// whatever options are read from the configuration file.
277  ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
279  llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS = nullptr);
280 
281  /// Initializes the \c FileOptionsProvider instance with a custom set
282  /// of configuration file handlers.
283  ///
284  /// \param GlobalOptions are just stored and returned to the caller of
285  /// \c getGlobalOptions.
286  ///
287  /// \param DefaultOptions are used for all settings not specified in a
288  /// configuration file.
289  ///
290  /// If any of the \param OverrideOptions fields are set, they will override
291  /// whatever options are read from the configuration file.
292  ///
293  /// \param ConfigHandlers specifies a custom set of configuration file
294  /// handlers. Each handler is a pair of configuration file name and a function
295  /// that can parse configuration from this file type. The configuration files
296  /// in each directory are searched for in the order of appearance in
297  /// \p ConfigHandlers.
299  ClangTidyOptions DefaultOptions,
302 
303  std::vector<OptionsSource> getRawOptions(llvm::StringRef FileName) override;
304 };
305 
306 /// Parses LineFilter from JSON and stores it to the \p Options.
307 std::error_code parseLineFilter(llvm::StringRef LineFilter,
308  ClangTidyGlobalOptions &Options);
309 
310 /// Parses configuration from JSON and returns \c ClangTidyOptions or an
311 /// error.
312 llvm::ErrorOr<ClangTidyOptions>
313 parseConfiguration(llvm::MemoryBufferRef Config);
314 
315 using DiagCallback = llvm::function_ref<void(const llvm::SMDiagnostic &)>;
316 
317 llvm::ErrorOr<ClangTidyOptions>
318 parseConfigurationWithDiags(llvm::MemoryBufferRef Config, DiagCallback Handler);
319 
320 /// Serializes configuration to a YAML-encoded string.
321 std::string configurationAsText(const ClangTidyOptions &Options);
322 
323 } // end namespace tidy
324 } // end namespace clang
325 
326 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYOPTIONS_H
clang::tidy::parseConfiguration
llvm::ErrorOr< ClangTidyOptions > parseConfiguration(llvm::MemoryBufferRef Config)
Parses configuration from JSON and returns ClangTidyOptions or an error.
Definition: ClangTidyOptions.cpp:384
clang::tidy::DefaultOptionsProvider::getRawOptions
std::vector< OptionsSource > getRawOptions(llvm::StringRef FileName) override
Returns an ordered vector of OptionsSources, in order of increasing priority.
Definition: ClangTidyOptions.cpp:191
clang::tidy::ClangTidyOptions::OptionMap
llvm::StringMap< ClangTidyValue > OptionMap
Definition: ClangTidyOptions.h:115
clang::tidy::DefaultOptionsProvider
Implementation of the ClangTidyOptionsProvider interface, which returns the same options for all file...
Definition: ClangTidyOptions.h:175
clang::tidy::ClangTidyOptions::Checks
llvm::Optional< std::string > Checks
Checks filter.
Definition: ClangTidyOptions.h:70
clang::tidy::ClangTidyOptions::ClangTidyValue::Priority
unsigned Priority
Priority stores relative precedence of the value loaded from config files to disambigute local vs glo...
Definition: ClangTidyOptions.h:112
clang::tidy::FileOptionsBaseProvider::ConfigHandlers
ConfigFileHandlers ConfigHandlers
Definition: ClangTidyOptions.h:238
clang::tidy::ClangTidyOptionsProvider
Abstract interface for retrieving various ClangTidy options.
Definition: ClangTidyOptions.h:142
clang::tidy::parseLineFilter
std::error_code parseLineFilter(StringRef LineFilter, clang::tidy::ClangTidyGlobalOptions &Options)
Parses -line-filter option and stores it to the Options.
Definition: ClangTidyOptions.cpp:376
clang::tidy::ClangTidyOptions::ClangTidyValue::ClangTidyValue
ClangTidyValue(llvm::StringRef Value, unsigned Priority=0)
Definition: ClangTidyOptions.h:106
clang::tidy::ClangTidyOptions::ArgList
std::vector< std::string > ArgList
Definition: ClangTidyOptions.h:120
clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeCheckCommandLineOption
static const char OptionsSourceTypeCheckCommandLineOption[]
Definition: ClangTidyOptions.h:145
clang::tidy::FileOptionsBaseProvider::addRawFileOptions
void addRawFileOptions(llvm::StringRef AbsolutePath, std::vector< OptionsSource > &CurOptions)
Definition: ClangTidyOptions.cpp:249
clang::tidy::ClangTidyOptions::ClangTidyValue
Helper structure for storing option value with priority of the value.
Definition: ClangTidyOptions.h:103
clang::tidy::FileFilter
Contains a list of line ranges in a single file.
Definition: ClangTidyOptions.h:29
clang::tidy::ClangTidyOptions::ExtraArgsBefore
llvm::Optional< ArgList > ExtraArgsBefore
Add extra compilation arguments to the start of the list.
Definition: ClangTidyOptions.h:126
clang::tidy::FileFilter::LineRanges
std::vector< LineRange > LineRanges
A list of line ranges in this file, for which we show warnings.
Definition: ClangTidyOptions.h:37
clang::tidy::ClangTidyOptions::User
llvm::Optional< std::string > User
Specifies the name or e-mail of the user running clang-tidy.
Definition: ClangTidyOptions.h:100
clang::tidy::ClangTidyOptions::CheckOptions
OptionMap CheckOptions
Key-value mapping used to store check-specific options.
Definition: ClangTidyOptions.h:118
clang::tidy::ConfigOptionsProvider::ConfigOptionsProvider
ConfigOptionsProvider(ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions, ClangTidyOptions ConfigOptions, ClangTidyOptions OverrideOptions, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS=nullptr)
Definition: ClangTidyOptions.cpp:197
clang::tidy::parseConfigurationWithDiags
llvm::ErrorOr< ClangTidyOptions > parseConfigurationWithDiags(llvm::MemoryBufferRef Config, DiagCallback Handler)
Definition: ClangTidyOptions.cpp:398
clang::tidy::ClangTidyOptions
Contains options for clang-tidy.
Definition: ClangTidyOptions.h:50
clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeDefaultBinary
static const char OptionsSourceTypeDefaultBinary[]
Definition: ClangTidyOptions.h:144
clang::tidy::ClangTidyOptions::InheritParentConfig
llvm::Optional< bool > InheritParentConfig
Only used in the FileOptionsProvider and ConfigOptionsProvider.
Definition: ClangTidyOptions.h:135
clang::tidy::DefaultOptionsProvider::getGlobalOptions
const ClangTidyGlobalOptions & getGlobalOptions() override
Returns global options, which are independent of the file.
Definition: ClangTidyOptions.h:181
clang::tidy::ClangTidyOptions::FormatStyle
llvm::Optional< std::string > FormatStyle
Format code around applied fixes with clang-format using this style.
Definition: ClangTidyOptions.h:94
clang::tidy::ClangTidyOptions::UseColor
llvm::Optional< bool > UseColor
Use colors in diagnostics. If missing, it will be auto detected.
Definition: ClangTidyOptions.h:138
clang::tidy::FileOptionsProvider
Implementation of the ClangTidyOptionsProvider interface, which tries to find a configuration file in...
Definition: ClangTidyOptions.h:264
clang::tidy::ClangTidyOptionsProvider::OptionsSource
std::pair< ClangTidyOptions, std::string > OptionsSource
ClangTidyOptions and its source.
Definition: ClangTidyOptions.h:161
clang::tidy::ClangTidyOptions::HeaderFilterRegex
llvm::Optional< std::string > HeaderFilterRegex
Output warnings from headers matching this filter.
Definition: ClangTidyOptions.h:77
clang::tidy::ClangTidyOptions::SystemHeaders
llvm::Optional< bool > SystemHeaders
Output warnings from system headers matching HeaderFilterRegex.
Definition: ClangTidyOptions.h:80
clang::tidy::FileOptionsBaseProvider
Definition: ClangTidyOptions.h:191
clang::tidy::ClangTidyGlobalOptions::LineFilter
std::vector< FileFilter > LineFilter
Output warnings from certain line ranges of certain files only.
Definition: ClangTidyOptions.h:45
clang::tidy::ClangTidyOptions::mergeWith
ClangTidyOptions & mergeWith(const ClangTidyOptions &Other, unsigned Order)
Overwrites all fields in here by the fields of Other that have a value.
Definition: ClangTidyOptions.cpp:145
clang::tidy::FileOptionsBaseProvider::FS
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS
Definition: ClangTidyOptions.h:239
clang::tidy::FileOptionsProvider::getRawOptions
std::vector< OptionsSource > getRawOptions(llvm::StringRef FileName) override
Returns an ordered vector of OptionsSources, in order of increasing priority.
Definition: ClangTidyOptions.cpp:308
clang::tidy::ClangTidyOptions::ClangTidyValue::ClangTidyValue
ClangTidyValue()
Definition: ClangTidyOptions.h:104
Directory
llvm::StringRef Directory
Definition: Serialization.cpp:419
clang::tidy::ClangTidyOptionsProvider::getGlobalOptions
virtual const ClangTidyGlobalOptions & getGlobalOptions()=0
Returns global options, which are independent of the file.
clang::tidy::FileOptionsBaseProvider::CachedOptions
llvm::StringMap< OptionsSource > CachedOptions
Definition: ClangTidyOptions.h:236
clang::tidy::FileOptionsBaseProvider::ConfigFileHandler
std::pair< std::string, std::function< llvm::ErrorOr< ClangTidyOptions > llvm::MemoryBufferRef)> > ConfigFileHandler
Definition: ClangTidyOptions.h:197
clang::tidy::configurationAsText
std::string configurationAsText(const ClangTidyOptions &Options)
Serializes configuration to a YAML-encoded string.
Definition: ClangTidyOptions.cpp:409
FileName
StringRef FileName
Definition: KernelNameRestrictionCheck.cpp:46
clang::tidy::FileOptionsBaseProvider::tryReadConfigFile
llvm::Optional< OptionsSource > tryReadConfigFile(llvm::StringRef Directory)
Try to read configuration files from Directory using registered ConfigHandlers.
Definition: ClangTidyOptions.cpp:329
clang::tidy::FileOptionsProvider::FileOptionsProvider
FileOptionsProvider(ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions, ClangTidyOptions OverrideOptions, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS=nullptr)
Initializes the FileOptionsProvider instance.
Definition: ClangTidyOptions.cpp:288
clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeConfigCommandLineOption
static const char OptionsSourceTypeConfigCommandLineOption[]
Definition: ClangTidyOptions.h:146
Config
static cl::opt< std::string > Config("config", cl::desc(R"( Specifies a configuration in YAML/JSON format: -config="{Checks:' *', CheckOptions:[{key:x, value:y}]}" When the value is empty, clang-tidy will attempt to find a file named .clang-tidy for each source file in its parent directories. )"), cl::init(""), cl::cat(ClangTidyCategory))
clang::tidy::ClangTidyGlobalOptions
Global options.
Definition: ClangTidyOptions.h:42
clang::tidy::ClangTidyOptions::WarningsAsErrors
llvm::Optional< std::string > WarningsAsErrors
WarningsAsErrors filter.
Definition: ClangTidyOptions.h:73
clang::tidy::ConfigOptionsProvider
Implementation of ClangTidyOptions interface, which is used for '-config' command-line option.
Definition: ClangTidyOptions.h:244
clang::tidy::FileFilter::Name
std::string Name
File name.
Definition: ClangTidyOptions.h:31
clang::tidy::DiagCallback
llvm::function_ref< void(const llvm::SMDiagnostic &)> DiagCallback
Definition: ClangTidyOptions.h:315
clang::tidy::ClangTidyOptionsProvider::getOptions
ClangTidyOptions getOptions(llvm::StringRef FileName)
Returns options applying to a specific translation unit with the specified FileName.
Definition: ClangTidyOptions.cpp:182
clang::tidy::FileOptionsBaseProvider::FileOptionsBaseProvider
FileOptionsBaseProvider(ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions, ClangTidyOptions OverrideOptions, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS)
Definition: ClangTidyOptions.cpp:228
clang::tidy::FileOptionsBaseProvider::ConfigFileHandlers
std::vector< ConfigFileHandler > ConfigFileHandlers
Configuration file handlers listed in the order of priority.
Definition: ClangTidyOptions.h:216
LineFilter
static cl::opt< std::string > LineFilter("line-filter", cl::desc(R"( List of files with line ranges to filter the warnings. Can be used together with -header-filter. The format of the list is a JSON array of objects: [ {"name":"file1.cpp","lines":[[1,3],[5,7]]}, {"name":"file2.h"} ] )"), cl::init(""), cl::cat(ClangTidyCategory))
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27
clang::tidy::FileFilter::LineRange
std::pair< unsigned, unsigned > LineRange
LineRange is a pair<start, end> (inclusive).
Definition: ClangTidyOptions.h:34
clang::tidy::ClangTidyOptionsProvider::getRawOptions
virtual std::vector< OptionsSource > getRawOptions(llvm::StringRef FileName)=0
Returns an ordered vector of OptionsSources, in order of increasing priority.
clang::tidy::ClangTidyOptions::ClangTidyValue::Value
std::string Value
Definition: ClangTidyOptions.h:109
clang::tidy::FileOptionsBaseProvider::OverrideOptions
ClangTidyOptions OverrideOptions
Definition: ClangTidyOptions.h:237
clang::tidy::ClangTidyOptionsProvider::~ClangTidyOptionsProvider
virtual ~ClangTidyOptionsProvider()
Definition: ClangTidyOptions.h:148
clang::tidy::ClangTidyOptions::ClangTidyValue::ClangTidyValue
ClangTidyValue(const char *Value)
Definition: ClangTidyOptions.h:105
clang::tidy::ClangTidyOptions::merge
LLVM_NODISCARD ClangTidyOptions merge(const ClangTidyOptions &Other, unsigned Order) const
Creates a new ClangTidyOptions instance combined from all fields of this instance overridden by the f...
Definition: ClangTidyOptions.cpp:166
clang::tidy::ClangTidyOptions::getDefaults
static ClangTidyOptions getDefaults()
These options are used for all settings that haven't been overridden by the OptionsProvider.
Definition: ClangTidyOptions.cpp:109
clang::tidy::ConfigOptionsProvider::getRawOptions
std::vector< OptionsSource > getRawOptions(llvm::StringRef FileName) override
Returns an ordered vector of OptionsSources, in order of increasing priority.
Definition: ClangTidyOptions.cpp:207
clang::tidy::ClangTidyOptions::ExtraArgs
llvm::Optional< ArgList > ExtraArgs
Add extra compilation arguments to the end of the list.
Definition: ClangTidyOptions.h:123
clang::tidy::ClangTidyOptions::StringPair
std::pair< std::string, std::string > StringPair
Definition: ClangTidyOptions.h:114
clang::tidy::DefaultOptionsProvider::DefaultOptionsProvider
DefaultOptionsProvider(ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions Options)
Definition: ClangTidyOptions.h:177