Ted Kremenek | 918fe84 | 2010-03-20 21:06:02 +0000 | [diff] [blame^] | 1 | //=- AnalysisBasedWarnings.h - Sema warnings based on libAnalysis -*- 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 | // This file defines AnalysisBasedWarnings, a worker object used by Sema |
| 11 | // that issues warnings based on dataflow-analysis. |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_CLANG_SEMA_ANALYSIS_WARNINGS_H |
| 15 | #define LLVM_CLANG_SEMA_ANALYSIS_WARNINGS_H |
| 16 | |
| 17 | namespace clang { namespace sema { |
| 18 | |
| 19 | class AnalysisBasedWarnings { |
| 20 | Sema &S; |
| 21 | // The warnings to run. |
| 22 | unsigned enableCheckFallThrough : 1; |
| 23 | unsigned enableCheckUnreachable : 1; |
| 24 | |
| 25 | public: |
| 26 | |
| 27 | AnalysisBasedWarnings(Sema &s); |
| 28 | void IssueWarnings(const Decl *D, QualType BlockTy = QualType()); |
| 29 | |
| 30 | void disableCheckFallThrough() { enableCheckFallThrough = 0; } |
| 31 | }; |
| 32 | |
| 33 | }} // end namespace clang::sema |
| 34 | |
| 35 | #endif |