| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 1 | //===--- ClangTidyDiagnosticConsumer.h - 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 | |
| Alexander Kornienko | 6658055 | 2015-03-09 16:52:33 +0000 | [diff] [blame] | 10 | #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYDIAGNOSTICCONSUMER_H |
| 11 | #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYDIAGNOSTICCONSUMER_H |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 12 | |
| Alexander Kornienko | 9ff5b6f | 2014-05-05 14:54:47 +0000 | [diff] [blame] | 13 | #include "ClangTidyOptions.h" |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 14 | #include "clang/Basic/Diagnostic.h" |
| 15 | #include "clang/Basic/SourceManager.h" |
| Alexander Kornienko | 563de79 | 2017-01-03 14:36:13 +0000 | [diff] [blame] | 16 | #include "clang/Tooling/Core/Diagnostic.h" |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 17 | #include "clang/Tooling/Refactoring.h" |
| Alexander Kornienko | 41bfe8d | 2014-01-13 10:50:51 +0000 | [diff] [blame] | 18 | #include "llvm/ADT/DenseMap.h" |
| Samuel Benzaquen | aedd994 | 2014-10-23 17:23:20 +0000 | [diff] [blame] | 19 | #include "llvm/ADT/StringMap.h" |
| Alexander Kornienko | 09952d2 | 2014-03-20 09:38:22 +0000 | [diff] [blame] | 20 | #include "llvm/Support/Regex.h" |
| Samuel Benzaquen | aedd994 | 2014-10-23 17:23:20 +0000 | [diff] [blame] | 21 | #include "llvm/Support/Timer.h" |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 22 | |
| 23 | namespace clang { |
| 24 | |
| Alexander Kornienko | ad21688 | 2014-07-14 14:10:03 +0000 | [diff] [blame] | 25 | class ASTContext; |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 26 | class CompilerInstance; |
| 27 | namespace ast_matchers { |
| 28 | class MatchFinder; |
| 29 | } |
| 30 | namespace tooling { |
| 31 | class CompilationDatabase; |
| 32 | } |
| 33 | |
| 34 | namespace tidy { |
| 35 | |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 36 | /// \brief A detected error complete with information to display diagnostic and |
| 37 | /// automatic fix. |
| 38 | /// |
| 39 | /// This is used as an intermediate format to transport Diagnostics without a |
| 40 | /// dependency on a SourceManager. |
| 41 | /// |
| 42 | /// FIXME: Make Diagnostics flexible enough to support this directly. |
| Alexander Kornienko | 563de79 | 2017-01-03 14:36:13 +0000 | [diff] [blame] | 43 | struct ClangTidyError : tooling::Diagnostic { |
| 44 | ClangTidyError(StringRef CheckName, Level DiagLevel, StringRef BuildDirectory, |
| 45 | bool IsWarningAsError); |
| Alexander Kornienko | 348cae8 | 2014-06-02 20:44:32 +0000 | [diff] [blame] | 46 | |
| Jonathan Roelofs | d60388a | 2016-01-13 17:36:41 +0000 | [diff] [blame] | 47 | bool IsWarningAsError; |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 48 | }; |
| 49 | |
| Alexander Kornienko | b3d331d | 2014-08-06 11:49:10 +0000 | [diff] [blame] | 50 | /// \brief Read-only set of strings represented as a list of positive and |
| 51 | /// negative globs. Positive globs add all matched strings to the set, negative |
| 52 | /// globs remove them in the order of appearance in the list. |
| 53 | class GlobList { |
| Alexander Kornienko | 09952d2 | 2014-03-20 09:38:22 +0000 | [diff] [blame] | 54 | public: |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 55 | /// \brief \p GlobList is a comma-separated list of globs (only '*' |
| 56 | /// metacharacter is supported) with optional '-' prefix to denote exclusion. |
| Alexander Kornienko | b3d331d | 2014-08-06 11:49:10 +0000 | [diff] [blame] | 57 | GlobList(StringRef Globs); |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 58 | |
| Alexander Kornienko | b3d331d | 2014-08-06 11:49:10 +0000 | [diff] [blame] | 59 | /// \brief Returns \c true if the pattern matches \p S. The result is the last |
| 60 | /// matching glob's Positive flag. |
| 61 | bool contains(StringRef S) { return contains(S, false); } |
| Alexander Kornienko | 09952d2 | 2014-03-20 09:38:22 +0000 | [diff] [blame] | 62 | |
| 63 | private: |
| Alexander Kornienko | b3d331d | 2014-08-06 11:49:10 +0000 | [diff] [blame] | 64 | bool contains(StringRef S, bool Contains); |
| Alexander Kornienko | 23fe959 | 2014-05-15 14:27:36 +0000 | [diff] [blame] | 65 | |
| 66 | bool Positive; |
| 67 | llvm::Regex Regex; |
| Alexander Kornienko | b3d331d | 2014-08-06 11:49:10 +0000 | [diff] [blame] | 68 | std::unique_ptr<GlobList> NextGlob; |
| Alexander Kornienko | 09952d2 | 2014-03-20 09:38:22 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 71 | /// \brief Contains displayed and ignored diagnostic counters for a ClangTidy |
| 72 | /// run. |
| Alexander Kornienko | 5d17454 | 2014-05-07 09:06:53 +0000 | [diff] [blame] | 73 | struct ClangTidyStats { |
| 74 | ClangTidyStats() |
| 75 | : ErrorsDisplayed(0), ErrorsIgnoredCheckFilter(0), ErrorsIgnoredNOLINT(0), |
| Alexander Kornienko | dad4acb | 2014-05-22 16:07:11 +0000 | [diff] [blame] | 76 | ErrorsIgnoredNonUserCode(0), ErrorsIgnoredLineFilter(0) {} |
| Alexander Kornienko | 5d17454 | 2014-05-07 09:06:53 +0000 | [diff] [blame] | 77 | |
| 78 | unsigned ErrorsDisplayed; |
| 79 | unsigned ErrorsIgnoredCheckFilter; |
| 80 | unsigned ErrorsIgnoredNOLINT; |
| 81 | unsigned ErrorsIgnoredNonUserCode; |
| Alexander Kornienko | dad4acb | 2014-05-22 16:07:11 +0000 | [diff] [blame] | 82 | unsigned ErrorsIgnoredLineFilter; |
| 83 | |
| 84 | unsigned errorsIgnored() const { |
| 85 | return ErrorsIgnoredNOLINT + ErrorsIgnoredCheckFilter + |
| 86 | ErrorsIgnoredNonUserCode + ErrorsIgnoredLineFilter; |
| 87 | } |
| Alexander Kornienko | 5d17454 | 2014-05-07 09:06:53 +0000 | [diff] [blame] | 88 | }; |
| 89 | |
| Samuel Benzaquen | aedd994 | 2014-10-23 17:23:20 +0000 | [diff] [blame] | 90 | /// \brief Container for clang-tidy profiling data. |
| 91 | struct ProfileData { |
| 92 | llvm::StringMap<llvm::TimeRecord> Records; |
| 93 | }; |
| 94 | |
| Alexander Kornienko | 284c249 | 2014-12-19 15:37:02 +0000 | [diff] [blame] | 95 | /// \brief Every \c ClangTidyCheck reports errors through a \c DiagnosticsEngine |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 96 | /// provided by this context. |
| 97 | /// |
| 98 | /// A \c ClangTidyCheck always has access to the active context to report |
| 99 | /// warnings like: |
| 100 | /// \code |
| 101 | /// Context->Diag(Loc, "Single-argument constructors must be explicit") |
| 102 | /// << FixItHint::CreateInsertion(Loc, "explicit "); |
| 103 | /// \endcode |
| 104 | class ClangTidyContext { |
| 105 | public: |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 106 | /// \brief Initializes \c ClangTidyContext instance. |
| Alexander Kornienko | d53d268 | 2014-09-04 14:23:36 +0000 | [diff] [blame] | 107 | ClangTidyContext(std::unique_ptr<ClangTidyOptionsProvider> OptionsProvider); |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 108 | |
| Alexander Kornienko | 6180337 | 2017-05-18 01:13:51 +0000 | [diff] [blame] | 109 | ~ClangTidyContext(); |
| 110 | |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 111 | /// \brief Report any errors detected using this method. |
| 112 | /// |
| 113 | /// This is still under heavy development and will likely change towards using |
| 114 | /// tablegen'd diagnostic IDs. |
| 115 | /// FIXME: Figure out a way to manage ID spaces. |
| Alexander Kornienko | 41bfe8d | 2014-01-13 10:50:51 +0000 | [diff] [blame] | 116 | DiagnosticBuilder diag(StringRef CheckName, SourceLocation Loc, |
| Alexander Kornienko | 54461eb | 2014-02-06 14:50:10 +0000 | [diff] [blame] | 117 | StringRef Message, |
| 118 | DiagnosticIDs::Level Level = DiagnosticIDs::Warning); |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 119 | |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 120 | /// \brief Sets the \c SourceManager of the used \c DiagnosticsEngine. |
| 121 | /// |
| 122 | /// This is called from the \c ClangTidyCheck base class. |
| 123 | void setSourceManager(SourceManager *SourceMgr); |
| 124 | |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 125 | /// \brief Should be called when starting to process new translation unit. |
| 126 | void setCurrentFile(StringRef File); |
| 127 | |
| Alexander Kornienko | 19bbeaf | 2015-05-21 14:08:56 +0000 | [diff] [blame] | 128 | /// \brief Returns the main file name of the current translation unit. |
| 129 | StringRef getCurrentFile() const { return CurrentFile; } |
| 130 | |
| Alexander Kornienko | ad21688 | 2014-07-14 14:10:03 +0000 | [diff] [blame] | 131 | /// \brief Sets ASTContext for the current translation unit. |
| 132 | void setASTContext(ASTContext *Context); |
| 133 | |
| Alexander Kornienko | 64956b5 | 2015-11-09 16:28:11 +0000 | [diff] [blame] | 134 | /// \brief Gets the language options from the AST context. |
| Alexander Kornienko | 1612fa0 | 2016-02-25 23:57:23 +0000 | [diff] [blame] | 135 | const LangOptions &getLangOpts() const { return LangOpts; } |
| Aaron Ballman | f36a425 | 2015-08-28 13:20:46 +0000 | [diff] [blame] | 136 | |
| Alexander Kornienko | 41bfe8d | 2014-01-13 10:50:51 +0000 | [diff] [blame] | 137 | /// \brief Returns the name of the clang-tidy check which produced this |
| 138 | /// diagnostic ID. |
| 139 | StringRef getCheckName(unsigned DiagnosticID) const; |
| 140 | |
| Alexander Kornienko | 2137518 | 2017-05-17 14:39:47 +0000 | [diff] [blame] | 141 | /// \brief Returns \c true if the check is enabled for the \c CurrentFile. |
| Alexander Kornienko | 64956b5 | 2015-11-09 16:28:11 +0000 | [diff] [blame] | 142 | /// |
| 143 | /// The \c CurrentFile can be changed using \c setCurrentFile. |
| Alexander Kornienko | 2137518 | 2017-05-17 14:39:47 +0000 | [diff] [blame] | 144 | bool isCheckEnabled(StringRef CheckName) const; |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 145 | |
| Alexander Kornienko | 2137518 | 2017-05-17 14:39:47 +0000 | [diff] [blame] | 146 | /// \brief Returns \c true if the check should be upgraded to error for the |
| 147 | /// \c CurrentFile. |
| 148 | bool treatAsError(StringRef CheckName) const; |
| Jonathan Roelofs | d60388a | 2016-01-13 17:36:41 +0000 | [diff] [blame] | 149 | |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 150 | /// \brief Returns global options. |
| 151 | const ClangTidyGlobalOptions &getGlobalOptions() const; |
| 152 | |
| 153 | /// \brief Returns options for \c CurrentFile. |
| Alexander Kornienko | 64956b5 | 2015-11-09 16:28:11 +0000 | [diff] [blame] | 154 | /// |
| 155 | /// The \c CurrentFile can be changed using \c setCurrentFile. |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 156 | const ClangTidyOptions &getOptions() const; |
| 157 | |
| Alexander Kornienko | 64956b5 | 2015-11-09 16:28:11 +0000 | [diff] [blame] | 158 | /// \brief Returns options for \c File. Does not change or depend on |
| 159 | /// \c CurrentFile. |
| 160 | ClangTidyOptions getOptionsForFile(StringRef File) const; |
| 161 | |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 162 | /// \brief Returns \c ClangTidyStats containing issued and ignored diagnostic |
| 163 | /// counters. |
| Alexander Kornienko | 5d17454 | 2014-05-07 09:06:53 +0000 | [diff] [blame] | 164 | const ClangTidyStats &getStats() const { return Stats; } |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 165 | |
| 166 | /// \brief Returns all collected errors. |
| Alexander Kornienko | 2561320 | 2017-04-06 13:41:29 +0000 | [diff] [blame] | 167 | ArrayRef<ClangTidyError> getErrors() const { return Errors; } |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 168 | |
| 169 | /// \brief Clears collected errors. |
| Alexander Kornienko | c009360 | 2014-05-09 15:50:15 +0000 | [diff] [blame] | 170 | void clearErrors() { Errors.clear(); } |
| Alexander Kornienko | 09952d2 | 2014-03-20 09:38:22 +0000 | [diff] [blame] | 171 | |
| Samuel Benzaquen | aedd994 | 2014-10-23 17:23:20 +0000 | [diff] [blame] | 172 | /// \brief Set the output struct for profile data. |
| 173 | /// |
| 174 | /// Setting a non-null pointer here will enable profile collection in |
| 175 | /// clang-tidy. |
| Angel Garcia Gomez | 1669357 | 2015-10-16 11:43:49 +0000 | [diff] [blame] | 176 | void setCheckProfileData(ProfileData *Profile); |
| 177 | ProfileData *getCheckProfileData() const { return Profile; } |
| Samuel Benzaquen | aedd994 | 2014-10-23 17:23:20 +0000 | [diff] [blame] | 178 | |
| Haojian Wu | f7692a2 | 2016-02-26 09:19:33 +0000 | [diff] [blame] | 179 | /// \brief Should be called when starting to process new translation unit. |
| 180 | void setCurrentBuildDirectory(StringRef BuildDirectory) { |
| 181 | CurrentBuildDirectory = BuildDirectory; |
| 182 | } |
| 183 | |
| 184 | /// \brief Returns build directory of the current translation unit. |
| 185 | const std::string &getCurrentBuildDirectory() { |
| 186 | return CurrentBuildDirectory; |
| 187 | } |
| 188 | |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 189 | private: |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 190 | // Calls setDiagnosticsEngine() and storeError(). |
| 191 | friend class ClangTidyDiagnosticConsumer; |
| Benjamin Kramer | 8f5eb56 | 2016-03-03 08:58:12 +0000 | [diff] [blame] | 192 | friend class ClangTidyPluginAction; |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 193 | |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 194 | /// \brief Sets the \c DiagnosticsEngine so that Diagnostics can be generated |
| 195 | /// correctly. |
| 196 | void setDiagnosticsEngine(DiagnosticsEngine *Engine); |
| 197 | |
| 198 | /// \brief Store an \p Error. |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 199 | void storeError(const ClangTidyError &Error); |
| 200 | |
| Alexander Kornienko | 826b5ad | 2014-05-09 12:24:09 +0000 | [diff] [blame] | 201 | std::vector<ClangTidyError> Errors; |
| NAKAMURA Takumi | 338eee1 | 2014-03-20 10:53:03 +0000 | [diff] [blame] | 202 | DiagnosticsEngine *DiagEngine; |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 203 | std::unique_ptr<ClangTidyOptionsProvider> OptionsProvider; |
| 204 | |
| 205 | std::string CurrentFile; |
| Alexander Kornienko | d53d268 | 2014-09-04 14:23:36 +0000 | [diff] [blame] | 206 | ClangTidyOptions CurrentOptions; |
| Alexander Kornienko | 6180337 | 2017-05-18 01:13:51 +0000 | [diff] [blame] | 207 | class CachedGlobList; |
| 208 | std::unique_ptr<CachedGlobList> CheckFilter; |
| 209 | std::unique_ptr<CachedGlobList> WarningAsErrorFilter; |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 210 | |
| Aaron Ballman | f36a425 | 2015-08-28 13:20:46 +0000 | [diff] [blame] | 211 | LangOptions LangOpts; |
| 212 | |
| Alexander Kornienko | 5d17454 | 2014-05-07 09:06:53 +0000 | [diff] [blame] | 213 | ClangTidyStats Stats; |
| Alexander Kornienko | 09952d2 | 2014-03-20 09:38:22 +0000 | [diff] [blame] | 214 | |
| Haojian Wu | f7692a2 | 2016-02-26 09:19:33 +0000 | [diff] [blame] | 215 | std::string CurrentBuildDirectory; |
| 216 | |
| Alexander Kornienko | 41bfe8d | 2014-01-13 10:50:51 +0000 | [diff] [blame] | 217 | llvm::DenseMap<unsigned, std::string> CheckNamesByDiagnosticID; |
| Samuel Benzaquen | aedd994 | 2014-10-23 17:23:20 +0000 | [diff] [blame] | 218 | |
| 219 | ProfileData *Profile; |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 220 | }; |
| 221 | |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 222 | /// \brief A diagnostic consumer that turns each \c Diagnostic into a |
| 223 | /// \c SourceManager-independent \c ClangTidyError. |
| 224 | // |
| 225 | // FIXME: If we move away from unit-tests, this can be moved to a private |
| 226 | // implementation file. |
| 227 | class ClangTidyDiagnosticConsumer : public DiagnosticConsumer { |
| 228 | public: |
| Alexander Kornienko | 9660d4d | 2017-05-09 15:10:26 +0000 | [diff] [blame] | 229 | ClangTidyDiagnosticConsumer(ClangTidyContext &Ctx, |
| 230 | bool RemoveIncompatibleErrors = true); |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 231 | |
| 232 | // FIXME: The concept of converting between FixItHints and Replacements is |
| 233 | // more generic and should be pulled out into a more useful Diagnostics |
| 234 | // library. |
| Alexander Kornienko | cb9272f | 2014-02-27 13:14:51 +0000 | [diff] [blame] | 235 | void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, |
| Craig Topper | a3dbe84 | 2014-03-02 10:20:11 +0000 | [diff] [blame] | 236 | const Diagnostic &Info) override; |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 237 | |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 238 | /// \brief Flushes the internal diagnostics buffer to the ClangTidyContext. |
| Craig Topper | a3dbe84 | 2014-03-02 10:20:11 +0000 | [diff] [blame] | 239 | void finish() override; |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 240 | |
| 241 | private: |
| Alexander Kornienko | 54461eb | 2014-02-06 14:50:10 +0000 | [diff] [blame] | 242 | void finalizeLastError(); |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 243 | |
| Angel Garcia Gomez | 1669357 | 2015-10-16 11:43:49 +0000 | [diff] [blame] | 244 | void removeIncompatibleErrors(SmallVectorImpl<ClangTidyError> &Errors) const; |
| 245 | |
| Daniel Jasper | 4d871f9 | 2015-08-12 13:16:41 +0000 | [diff] [blame] | 246 | /// \brief Returns the \c HeaderFilter constructed for the options set in the |
| 247 | /// context. |
| Angel Garcia Gomez | 1669357 | 2015-10-16 11:43:49 +0000 | [diff] [blame] | 248 | llvm::Regex *getHeaderFilter(); |
| Daniel Jasper | 4d871f9 | 2015-08-12 13:16:41 +0000 | [diff] [blame] | 249 | |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 250 | /// \brief Updates \c LastErrorRelatesToUserCode and LastErrorPassesLineFilter |
| 251 | /// according to the diagnostic \p Location. |
| Alexander Kornienko | dad4acb | 2014-05-22 16:07:11 +0000 | [diff] [blame] | 252 | void checkFilters(SourceLocation Location); |
| 253 | bool passesLineFilter(StringRef FileName, unsigned LineNumber) const; |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 254 | |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 255 | ClangTidyContext &Context; |
| Alexander Kornienko | 9660d4d | 2017-05-09 15:10:26 +0000 | [diff] [blame] | 256 | bool RemoveIncompatibleErrors; |
| Ahmed Charles | 6a2dc5c | 2014-03-09 09:24:40 +0000 | [diff] [blame] | 257 | std::unique_ptr<DiagnosticsEngine> Diags; |
| Manuel Klimek | 814f9bd | 2013-11-14 15:49:44 +0000 | [diff] [blame] | 258 | SmallVector<ClangTidyError, 8> Errors; |
| Alexander Kornienko | a469522 | 2014-06-05 13:31:45 +0000 | [diff] [blame] | 259 | std::unique_ptr<llvm::Regex> HeaderFilter; |
| Alexander Kornienko | 54461eb | 2014-02-06 14:50:10 +0000 | [diff] [blame] | 260 | bool LastErrorRelatesToUserCode; |
| Alexander Kornienko | dad4acb | 2014-05-22 16:07:11 +0000 | [diff] [blame] | 261 | bool LastErrorPassesLineFilter; |
| Malcolm Parsons | cb2e749 | 2016-11-02 21:14:22 +0000 | [diff] [blame] | 262 | bool LastErrorWasIgnored; |
| Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 263 | }; |
| 264 | |
| 265 | } // end namespace tidy |
| 266 | } // end namespace clang |
| 267 | |
| Alexander Kornienko | 6658055 | 2015-03-09 16:52:33 +0000 | [diff] [blame] | 268 | #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYDIAGNOSTICCONSUMER_H |