summaryrefslogtreecommitdiffstats
path: root/include/clang/Sema/AnalysisBasedWarnings.h
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2013-08-12 21:20:55 +0000
committerDeLesley Hutchins <delesley@google.com>2013-08-12 21:20:55 +0000
commitdf7bef07eebd5c7913e8be09c62a6a470f255fd2 (patch)
tree9684e39ef1fc4c97d90a806438ea2a6b810bde31 /include/clang/Sema/AnalysisBasedWarnings.h
parent4432bf007abb40cdbe2679dd94ec5b11c5795355 (diff)
Patch by Chris Wailes <chris.wailes@gmail.com>.
Reviewed by delesley, dblaikie. Add the annotations and code needed to support a basic 'consumed' analysis. Summary: This new analysis is based on academic literature on linear types. It tracks the state of a value, either as unconsumed, consumed, or unknown. Methods are then annotated as CallableWhenUnconsumed, and when an annotated method is called while the value is in the 'consumed' state a warning is issued. A value may be tested in the conditional statement of an if-statement; when this occurs we know the state of the value in the different branches, and this information is added to our analysis. The code is still highly experimental, and the names of annotations or the algorithm may be subject to change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188206 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/AnalysisBasedWarnings.h')
-rw-r--r--include/clang/Sema/AnalysisBasedWarnings.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/clang/Sema/AnalysisBasedWarnings.h b/include/clang/Sema/AnalysisBasedWarnings.h
index eeac97332d..432c4e23a9 100644
--- a/include/clang/Sema/AnalysisBasedWarnings.h
+++ b/include/clang/Sema/AnalysisBasedWarnings.h
@@ -38,6 +38,7 @@ public:
unsigned enableCheckFallThrough : 1;
unsigned enableCheckUnreachable : 1;
unsigned enableThreadSafetyAnalysis : 1;
+ unsigned enableConsumedAnalysis : 1;
public:
Policy();
void disableCheckFallThrough() { enableCheckFallThrough = 0; }