diff options
| author | DeLesley Hutchins <delesley@google.com> | 2013-10-17 23:23:53 +0000 |
|---|---|---|
| committer | DeLesley Hutchins <delesley@google.com> | 2013-10-17 23:23:53 +0000 |
| commit | 6939177ceab8b9df367bbaeccb16a74d85447644 (patch) | |
| tree | bb51351642d736f4bb09e8b6a5b5e9dc05f8e4fa /clang/lib/Sema/AnalysisBasedWarnings.cpp | |
| parent | 403425bba8939ecbf217f3f9e6b1ceb6ad45f16b (diff) | |
| download | bcm5719-llvm-6939177ceab8b9df367bbaeccb16a74d85447644.tar.gz bcm5719-llvm-6939177ceab8b9df367bbaeccb16a74d85447644.zip | |
Consumed analysis: Add param_typestate attribute, which specifies that
function parameters must be in a particular state. Patch by
chris.wailes@gmail.com. Reviewed by delesley@google.com.
llvm-svn: 192934
Diffstat (limited to 'clang/lib/Sema/AnalysisBasedWarnings.cpp')
| -rw-r--r-- | clang/lib/Sema/AnalysisBasedWarnings.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp index 2d65980ec07..93e3ecfb294 100644 --- a/clang/lib/Sema/AnalysisBasedWarnings.cpp +++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp @@ -1496,6 +1496,15 @@ public: Warnings.push_back(DelayedDiag(Warning, OptionalNotes())); } + void warnParamTypestateMismatch(SourceLocation Loc, StringRef ExpectedState, + StringRef ObservedState) { + + PartialDiagnosticAt Warning(Loc, S.PDiag( + diag::warn_param_typestate_mismatch) << ExpectedState << ObservedState); + + Warnings.push_back(DelayedDiag(Warning, OptionalNotes())); + } + void warnReturnTypestateForUnconsumableType(SourceLocation Loc, StringRef TypeName) { PartialDiagnosticAt Warning(Loc, S.PDiag( |

