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