clang-tools 8.0.0

ClangTidyOptions.cpp
Go to the documentation of this file.
1 //===--- ClangTidyOptions.cpp - clang-tidy ----------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "ClangTidyOptions.h"
11 #include "ClangTidyModuleRegistry.h"
12 #include "clang/Basic/LLVM.h"
13 #include "llvm/ADT/SmallString.h"
14 #include "llvm/Support/Debug.h"
15 #include "llvm/Support/Errc.h"
16 #include "llvm/Support/FileSystem.h"
17 #include "llvm/Support/Path.h"
18 #include "llvm/Support/YAMLTraits.h"
19 #include "llvm/Support/raw_ostream.h"
20 #include <utility>
21
22 #define DEBUG_TYPE "clang-tidy-options"
23
24 using clang::tidy::ClangTidyOptions;
25 using clang::tidy::FileFilter;
26 using OptionsSource = clang::tidy::ClangTidyOptionsProvider::OptionsSource;
27
28 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FileFilter)
29 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FileFilter::LineRange)
30
31 namespace llvm {
32 namespace yaml {
33
34 // Map std::pair<int, int> to a JSON array of size 2.
35 template <> struct SequenceTraits<FileFilter::LineRange> {
36 static size_t size(IO &IO, FileFilter::LineRange &Range) {
37 return Range.first == 0 ? 0 : Range.second == 0 ? 1 : 2;
38 }
39 static unsigned &element(IO &IO, FileFilter::LineRange &Range, size_t Index) {
40 if (Index > 1)
41 IO.setError("Too many elements in line range.");
42 return Index == 0 ? Range.first : Range.second;
43 }
44 };
45
46 template <> struct MappingTraits<FileFilter> {
47 static void mapping(IO &IO, FileFilter &File) {
48 IO.mapRequired("name", File.Name);
49 IO.mapOptional("lines", File.LineRanges);
50 }
51 static StringRef validate(IO &io, FileFilter &File) {
52 if (File.Name.empty())
53 return "No file name specified";
54 for (const FileFilter::LineRange &Range : File.LineRanges) {
55 if (Range.first <= 0 || Range.second <= 0)
56 return "Invalid line range";
57 }
58 return StringRef();
59 }
60 };
61
62 template <> struct MappingTraits<ClangTidyOptions::StringPair> {
63 static void mapping(IO &IO, ClangTidyOptions::StringPair &KeyValue) {
64 IO.mapRequired("key", KeyValue.first);
65 IO.mapRequired("value", KeyValue.second);
66 }
67 };
68
69 struct NOptionMap {
70 NOptionMap(IO &) {}
71 NOptionMap(IO &, const ClangTidyOptions::OptionMap &OptionMap)
72 : Options(OptionMap.begin(), OptionMap.end()) {}
73 ClangTidyOptions::OptionMap denormalize(IO &) {
74 ClangTidyOptions::OptionMap Map;
75 for (const auto &KeyValue : Options)
76 Map[KeyValue.first] = KeyValue.second;
77 return Map;
78 }
79 std::vector<ClangTidyOptions::StringPair> Options;
80 };
81
82 template <> struct MappingTraits<ClangTidyOptions> {
83 static void mapping(IO &IO, ClangTidyOptions &Options) {
84 MappingNormalization<NOptionMap, ClangTidyOptions::OptionMap> NOpts(
85 IO, Options.CheckOptions);
86 bool Ignored = false;
87 IO.mapOptional("Checks", Options.Checks);
88 IO.mapOptional("WarningsAsErrors", Options.WarningsAsErrors);
89 IO.mapOptional("HeaderFilterRegex", Options.HeaderFilterRegex);
90 IO.mapOptional("AnalyzeTemporaryDtors", Ignored); // legacy compatibility
91 IO.mapOptional("FormatStyle", Options.FormatStyle);
92 IO.mapOptional("User", Options.User);
93 IO.mapOptional("CheckOptions", NOpts->Options);
94 IO.mapOptional("ExtraArgs", Options.ExtraArgs);
95 IO.mapOptional("ExtraArgsBefore", Options.ExtraArgsBefore);
96 }
97 };
98
99 } // namespace yaml
100 } // namespace llvm
101
102 namespace clang {
103 namespace tidy {
104
105 ClangTidyOptions ClangTidyOptions::getDefaults() {
106 ClangTidyOptions Options;
107 Options.Checks = "";
108 Options.WarningsAsErrors = "";
109 Options.HeaderFilterRegex = "";
110 Options.SystemHeaders = false;
111 Options.FormatStyle = "none";
112 Options.User = llvm::None;
113 for (ClangTidyModuleRegistry::iterator I = ClangTidyModuleRegistry::begin(),
114 E = ClangTidyModuleRegistry::end();
115 I != E; ++I)
116 Options = Options.mergeWith(I->instantiate()->getModuleOptions());
117 return Options;
118 }
119
120 template <typename T>
121 static void mergeVectors(Optional<T> &Dest, const Optional<T> &Src) {
122 if (Src) {
123 if (Dest)
124 Dest->insert(Dest->end(), Src->begin(), Src->end());
125 else
126 Dest = Src;
127 }
128 }
129
130 static void mergeCommaSeparatedLists(Optional<std::string> &Dest,
131 const Optional<std::string> &Src) {
132 if (Src)
133 Dest = (Dest && !Dest->empty() ? *Dest + "," : "") + *Src;
134 }
135
136 template <typename T>
137 static void overrideValue(Optional<T> &Dest, const Optional<T> &Src) {
138 if (Src)
139 Dest = Src;
140 }
141
142 ClangTidyOptions
143 ClangTidyOptions::mergeWith(const ClangTidyOptions &Other) const {
144 ClangTidyOptions Result = *this;
145
146 mergeCommaSeparatedLists(Result.Checks, Other.Checks);
147 mergeCommaSeparatedLists(Result.WarningsAsErrors, Other.WarningsAsErrors);
148 overrideValue(Result.HeaderFilterRegex, Other.HeaderFilterRegex);
149 overrideValue(Result.SystemHeaders, Other.SystemHeaders);
150 overrideValue(Result.FormatStyle, Other.FormatStyle);
151 overrideValue(Result.User, Other.User);
152 mergeVectors(Result.ExtraArgs, Other.ExtraArgs);
153 mergeVectors(Result.ExtraArgsBefore, Other.ExtraArgsBefore);
154
155 for (const auto &KeyValue : Other.CheckOptions)
156 Result.CheckOptions[KeyValue.first] = KeyValue.second;
157
158 return Result;
159 }
160
161 const char ClangTidyOptionsProvider::OptionsSourceTypeDefaultBinary[] =
162 "clang-tidy binary";
163 const char ClangTidyOptionsProvider::OptionsSourceTypeCheckCommandLineOption[] =
164 "command-line option '-checks'";
165 const char
166 ClangTidyOptionsProvider::OptionsSourceTypeConfigCommandLineOption[] =
167 "command-line option '-config'";
168
169 ClangTidyOptions
170 ClangTidyOptionsProvider::getOptions(llvm::StringRef FileName) {
171 ClangTidyOptions Result;
172 for (const auto &Source : getRawOptions(FileName))
173 Result = Result.mergeWith(Source.first);
174 return Result;
175 }
176
177 std::vector<OptionsSource>
178 DefaultOptionsProvider::getRawOptions(llvm::StringRef FileName) {
179 std::vector<OptionsSource> Result;
180 Result.emplace_back(DefaultOptions, OptionsSourceTypeDefaultBinary);
181 return Result;
182 }
183
184 ConfigOptionsProvider::ConfigOptionsProvider(
185 const ClangTidyGlobalOptions &GlobalOptions,
186 const ClangTidyOptions &DefaultOptions,
187 const ClangTidyOptions &ConfigOptions,
188 const ClangTidyOptions &OverrideOptions)
189 : DefaultOptionsProvider(GlobalOptions, DefaultOptions),
190 ConfigOptions(ConfigOptions), OverrideOptions(OverrideOptions) {}
191
192 std::vector<OptionsSource>
193 ConfigOptionsProvider::getRawOptions(llvm::StringRef FileName) {
194 std::vector<OptionsSource> RawOptions =
195 DefaultOptionsProvider::getRawOptions(FileName);
196 RawOptions.emplace_back(ConfigOptions,
197 OptionsSourceTypeConfigCommandLineOption);
198 RawOptions.emplace_back(OverrideOptions,
199 OptionsSourceTypeCheckCommandLineOption);
200 return RawOptions;
201 }
202
203 FileOptionsProvider::FileOptionsProvider(
204 const ClangTidyGlobalOptions &GlobalOptions,
205 const ClangTidyOptions &DefaultOptions,
206 const ClangTidyOptions &OverrideOptions,
207 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS)
208 : DefaultOptionsProvider(GlobalOptions, DefaultOptions),
209 OverrideOptions(OverrideOptions), FS(std::move(VFS)) {
210 if (!FS)
211 FS = llvm::vfs::getRealFileSystem();
212 ConfigHandlers.emplace_back(".clang-tidy", parseConfiguration);
213 }
214
215 FileOptionsProvider::FileOptionsProvider(
216 const ClangTidyGlobalOptions &GlobalOptions,
217 const ClangTidyOptions &DefaultOptions,
218 const ClangTidyOptions &OverrideOptions,
219 const FileOptionsProvider::ConfigFileHandlers &ConfigHandlers)
220 : DefaultOptionsProvider(GlobalOptions, DefaultOptions),
221 OverrideOptions(OverrideOptions), ConfigHandlers(ConfigHandlers) {}
222
223 // FIXME: This method has some common logic with clang::format::getStyle().
224 // Consider pulling out common bits to a findParentFileWithName function or
225 // similar.
226 std::vector<OptionsSource>
227 FileOptionsProvider::getRawOptions(StringRef FileName) {
228 LLVM_DEBUG(llvm::dbgs() << "Getting options for file " << FileName
229 << "...\n");
230 assert(FS && "FS must be set.");
231
232 llvm::SmallString<128> AbsoluteFilePath(FileName);
233
234 if (FS->makeAbsolute(AbsoluteFilePath))
235 return {};
236
237 std::vector<OptionsSource> RawOptions =
238 DefaultOptionsProvider::getRawOptions(AbsoluteFilePath.str());
239 OptionsSource CommandLineOptions(OverrideOptions,
240 OptionsSourceTypeCheckCommandLineOption);
241 // Look for a suitable configuration file in all parent directories of the
242 // file. Start with the immediate parent directory and move up.
243 StringRef Path = llvm::sys::path::parent_path(AbsoluteFilePath.str());
244 for (StringRef CurrentPath = Path; !CurrentPath.empty();
245 CurrentPath = llvm::sys::path::parent_path(CurrentPath)) {
246 llvm::Optional<OptionsSource> Result;
247
248 auto Iter = CachedOptions.find(CurrentPath);
249 if (Iter != CachedOptions.end())
250 Result = Iter->second;
251
252 if (!Result)
253 Result = tryReadConfigFile(CurrentPath);
254
255 if (Result) {
256 // Store cached value for all intermediate directories.
257 while (Path != CurrentPath) {
258 LLVM_DEBUG(llvm::dbgs()
259 << "Caching configuration for path " << Path << ".\n");
260 CachedOptions[Path] = *Result;
261 Path = llvm::sys::path::parent_path(Path);
262 }
263 CachedOptions[Path] = *Result;
264
265 RawOptions.push_back(*Result);
266 break;
267 }
268 }
269 RawOptions.push_back(CommandLineOptions);
270 return RawOptions;
271 }
272
273 llvm::Optional<OptionsSource>
274 FileOptionsProvider::tryReadConfigFile(StringRef Directory) {
275 assert(!Directory.empty());
276
277 if (!llvm::sys::fs::is_directory(Directory)) {
278 llvm::errs() << "Error reading configuration from " << Directory
279 << ": directory doesn't exist.\n";
280 return llvm::None;
281 }
282
283 for (const ConfigFileHandler &ConfigHandler : ConfigHandlers) {
284 SmallString<128> ConfigFile(Directory);
285 llvm::sys::path::append(ConfigFile, ConfigHandler.first);
286 LLVM_DEBUG(llvm::dbgs() << "Trying " << ConfigFile << "...\n");
287
288 bool IsFile = false;
289 // Ignore errors from is_regular_file: we only need to know if we can read
290 // the file or not.
291 llvm::sys::fs::is_regular_file(Twine(ConfigFile), IsFile);
292 if (!IsFile)
293 continue;
294
295 llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> Text =
296 llvm::MemoryBuffer::getFile(ConfigFile.c_str());
297 if (std::error_code EC = Text.getError()) {
298 llvm::errs() << "Can't read " << ConfigFile << ": " << EC.message()
299 << "\n";
300 continue;
301 }
302
303 // Skip empty files, e.g. files opened for writing via shell output
304 // redirection.
305 if ((*Text)->getBuffer().empty())
306 continue;
307 llvm::ErrorOr<ClangTidyOptions> ParsedOptions =
308 ConfigHandler.second((*Text)->getBuffer());
309 if (!ParsedOptions) {
310 if (ParsedOptions.getError())
311 llvm::errs() << "Error parsing " << ConfigFile << ": "
312 << ParsedOptions.getError().message() << "\n";
313 continue;
314 }
315 return OptionsSource(*ParsedOptions, ConfigFile.c_str());
316 }
317 return llvm::None;
318 }
319
320 /// \brief Parses -line-filter option and stores it to the \c Options.
321 std::error_code parseLineFilter(StringRef LineFilter,
322 clang::tidy::ClangTidyGlobalOptions &Options) {
323 llvm::yaml::Input Input(LineFilter);
324 Input >> Options.LineFilter;
325 return Input.error();
326 }
327
328 llvm::ErrorOr<ClangTidyOptions> parseConfiguration(StringRef Config) {
329 llvm::yaml::Input Input(Config);
330 ClangTidyOptions Options;
331 Input >> Options;
332 if (Input.error())
333 return Input.error();
334 return Options;
335 }
336
337 std::string configurationAsText(const ClangTidyOptions &Options) {
338 std::string Text;
339 llvm::raw_string_ostream Stream(Text);
340 llvm::yaml::Output Output(Stream);
341 // We use the same mapping method for input and output, so we need a non-const
342 // reference here.
343 ClangTidyOptions NonConstValue = Options;
344 Output << NonConstValue;
345 return Stream.str();
346 }
347
348 } // namespace tidy
349 } // namespace clang
clang::tidy::ClangTidyOptions::Checks
llvm::Optional< std::string > Checks
Checks filter.
Definition: ClangTidyOptions.h:65
clang::tidy::ClangTidyOptions::mergeWith
ClangTidyOptions mergeWith(const ClangTidyOptions &Other) const
Creates a new ClangTidyOptions instance combined from all fields of this instance overridden by the f...
Definition: ClangTidyOptions.cpp:143
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:178
clang::tidy::ClangTidyOptions::ExtraArgs
llvm::Optional< ArgList > ExtraArgs
Add extra compilation arguments to the end of the list.
Definition: ClangTidyOptions.h:106
llvm
Some operations such as code completion produce a set of candidates.
Definition: YAMLGenerator.cpp:28
clang::tidy::ClangTidyOptions::User
llvm::Optional< std::string > User
Specifies the name or e-mail of the user running clang-tidy.
Definition: ClangTidyOptions.h:95
VFS
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS
Definition: CodeComplete.cpp:1009
clang::tidy::mergeVectors
static void mergeVectors(Optional< T > &Dest, const Optional< T > &Src)
Definition: ClangTidyOptions.cpp:121
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::ClangTidyOptions::HeaderFilterRegex
llvm::Optional< std::string > HeaderFilterRegex
Output warnings from headers matching this filter.
Definition: ClangTidyOptions.h:72
llvm::yaml::MappingTraits< FileFilter >::mapping
static void mapping(IO &IO, FileFilter &File)
Definition: ClangTidyOptions.cpp:47
clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeCheckCommandLineOption
static const char OptionsSourceTypeCheckCommandLineOption[]
Definition: ClangTidyOptions.h:116
clang::tidy::ClangTidyOptions
Contains options for clang-tidy.
Definition: ClangTidyOptions.h:51
clang::tidy::ClangTidyGlobalOptions
Global options.
Definition: ClangTidyOptions.h:43
clang::tidy::ClangTidyOptionsProvider::OptionsSourceTypeConfigCommandLineOption
static const char OptionsSourceTypeConfigCommandLineOption[]
Definition: ClangTidyOptions.h:117
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:227
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:321
Path
std::vector< HeaderHandle > Path
Definition: PreprocessorTracker.cpp:538
clang::tidy::parseConfiguration
llvm::ErrorOr< ClangTidyOptions > parseConfiguration(StringRef Config)
Definition: ClangTidyOptions.cpp:328
llvm::yaml::MappingTraits< FileFilter >::validate
static StringRef validate(IO &io, FileFilter &File)
Definition: ClangTidyOptions.cpp:51
llvm::yaml::NOptionMap::NOptionMap
NOptionMap(IO &, const ClangTidyOptions::OptionMap &OptionMap)
Definition: ClangTidyOptions.cpp:71
clang::tidy::ClangTidyOptions::CheckOptions
OptionMap CheckOptions
Key-value mapping used to store check-specific options.
Definition: ClangTidyOptions.h:101
clang::tidy::ClangTidyOptions::SystemHeaders
llvm::Optional< bool > SystemHeaders
Output warnings from system headers matching HeaderFilterRegex.
Definition: ClangTidyOptions.h:75
clang::tidy::FileOptionsProvider::OverrideOptions
ClangTidyOptions OverrideOptions
Definition: ClangTidyOptions.h:257
ClangTidyOptions.h
clang::tidy::FileOptionsProvider::FileOptionsProvider
FileOptionsProvider(const ClangTidyGlobalOptions &GlobalOptions, const ClangTidyOptions &DefaultOptions, const ClangTidyOptions &OverrideOptions, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS=nullptr)
Initializes the FileOptionsProvider instance.
Definition: ClangTidyOptions.cpp:203
clang::tidy::FileOptionsProvider::ConfigHandlers
ConfigFileHandlers ConfigHandlers
Definition: ClangTidyOptions.h:258
clang::tidy::ClangTidyOptions::ExtraArgsBefore
llvm::Optional< ArgList > ExtraArgsBefore
Add extra compilation arguments to the start of the list.
Definition: ClangTidyOptions.h:109
clang::tidy::ClangTidyOptions::FormatStyle
llvm::Optional< std::string > FormatStyle
Format code around applied fixes with clang-format using this style.
Definition: ClangTidyOptions.h:89
Directory
static cl::opt< std::string > Directory(cl::Positional, cl::Required, cl::desc("<Search Root Directory>"))
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::tidy::FileOptionsProvider::FS
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS
Definition: ClangTidyOptions.h:259
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:193
clang::tidy::configurationAsText
std::string configurationAsText(const ClangTidyOptions &Options)
Serializes configuration to a YAML-encoded string.
Definition: ClangTidyOptions.cpp:337
ClangTidyModuleRegistry.h
llvm::yaml::SequenceTraits< FileFilter::LineRange >::element
static unsigned & element(IO &IO, FileFilter::LineRange &Range, size_t Index)
Definition: ClangTidyOptions.cpp:39
clang::tidy::FileOptionsProvider::CachedOptions
llvm::StringMap< OptionsSource > CachedOptions
Definition: ClangTidyOptions.h:256
llvm::yaml::NOptionMap
Definition: ClangTidyOptions.cpp:69
llvm::yaml::MappingTraits< ClangTidyOptions >::mapping
static void mapping(IO &IO, ClangTidyOptions &Options)
Definition: ClangTidyOptions.cpp:83
clang::tidy::ClangTidyGlobalOptions::LineFilter
std::vector< FileFilter > LineFilter
Output warnings from certain line ranges of certain files only.
Definition: ClangTidyOptions.h:46
llvm::yaml::MappingTraits< ClangTidyOptions::StringPair >::mapping
static void mapping(IO &IO, ClangTidyOptions::StringPair &KeyValue)
Definition: ClangTidyOptions.cpp:63
Result
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
Definition: ClangdServer.cpp:60
FileName
PathRef FileName
Definition: CodeComplete.cpp:1004
clang::tidy::FileOptionsProvider::ConfigFileHandler
std::pair< std::string, std::function< llvm::ErrorOr< ClangTidyOptions > llvm::StringRef)> > ConfigFileHandler
Definition: ClangTidyOptions.h:190
clang::tidy::ClangTidyOptions::WarningsAsErrors
llvm::Optional< std::string > WarningsAsErrors
WarningsAsErrors filter.
Definition: ClangTidyOptions.h:68
clang::tidy::mergeCommaSeparatedLists
static void mergeCommaSeparatedLists(Optional< std::string > &Dest, const Optional< std::string > &Src)
Definition: ClangTidyOptions.cpp:130
clang::tidy::FileOptionsProvider::ConfigFileHandlers
std::vector< ConfigFileHandler > ConfigFileHandlers
Configuration file handlers listed in the order of priority.
Definition: ClangTidyOptions.h:209
yaml
Definition: ClangDocMain.cpp:68
clang::tidy::FileFilter
Contains a list of line ranges in a single file.
Definition: ClangTidyOptions.h:30
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ChangeNamespace.cpp:18
Range
CharSourceRange Range
SourceRange for the file name.
Definition: IncludeOrderCheck.cpp:38
llvm::yaml::NOptionMap::Options
std::vector< ClangTidyOptions::StringPair > Options
Definition: ClangTidyOptions.cpp:79
llvm::yaml::SequenceTraits< FileFilter::LineRange >::size
static size_t size(IO &IO, FileFilter::LineRange &Range)
Definition: ClangTidyOptions.cpp:36
clang::tidy::overrideValue
static void overrideValue(Optional< T > &Dest, const Optional< T > &Src)
Definition: ClangTidyOptions.cpp:137
llvm::yaml::NOptionMap::NOptionMap
NOptionMap(IO &)
Definition: ClangTidyOptions.cpp:70
clang::tidy::ClangTidyOptionsProvider::OptionsSource
std::pair< ClangTidyOptions, std::string > OptionsSource
ClangTidyOptions and its source.
Definition: ClangTidyOptions.h:132
llvm::yaml::NOptionMap::denormalize
ClangTidyOptions::OptionMap denormalize(IO &)
Definition: ClangTidyOptions.cpp:73
clang::tidy::FileFilter::LineRanges
std::vector< LineRange > LineRanges
A list of line ranges in this file, for which we show warnings.
Definition: ClangTidyOptions.h:38
OptionsSource
clang::tidy::ClangTidyOptionsProvider::OptionsSource OptionsSource
Definition: ClangTidyOptions.cpp:26
clang::tidy::FileFilter::Name
std::string Name
File name.
Definition: ClangTidyOptions.h:32
clang::tidy::FileOptionsProvider::tryReadConfigFile
llvm::Optional< OptionsSource > tryReadConfigFile(llvm::StringRef Directory)
Try to read configuration files from Directory using registered ConfigHandlers.
Definition: ClangTidyOptions.cpp:274
clang::tidy::DefaultOptionsProvider
Implementation of the ClangTidyOptionsProvider interface, which returns the same options for all file...
Definition: ClangTidyOptions.h:146
Index
const SymbolIndex * Index
Definition: Dexp.cpp:85