aboutsummaryrefslogtreecommitdiff
path: root/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-08-06 23:25:39 +0000
committerAnna Zaks <ganna@apple.com>2012-08-06 23:25:39 +0000
commitc7ecc43c33a21b82c49664910b19fcc1f555aa51 (patch)
treee08d07f14729a8c26fe7852b8424d0328811b179 /include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
parent71f55f771794674a410171dbf3cb5dbedf95d033 (diff)
[analyzer] Add a checker to manage dynamic type propagation.
Instead of sprinkling dynamic type info propagation throughout ExprEngine, the added checker would add the more precise type information on known APIs (Ex: ObjC alloc, new) and propagate the type info in other cases (ex: ObjC init method, casts (the second is not implemented yet)). Add handling of ObjC alloc, new and init to the checker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h')
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
index 9d82ec6983..b38f3ac311 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
@@ -331,10 +331,18 @@ public:
bool isTainted(SymbolRef Sym, TaintTagType Kind = TaintTagGeneric) const;
bool isTainted(const MemRegion *Reg, TaintTagType Kind=TaintTagGeneric) const;
- /// Get dynamic type information for a region.
+ /// \brief Get dynamic type information for a region.
DynamicTypeInfo getDynamicTypeInfo(const MemRegion *Reg) const;
- /// Add dynamic type information to the region and return the new state.
- ProgramStateRef addDynamicTypeInfo(const MemRegion *Reg, QualType NewTy)const;
+
+ /// \brief Add dynamic type information to the region; return the new state.
+ ProgramStateRef addDynamicTypeInfo(const MemRegion *Reg,
+ DynamicTypeInfo NewTy) const;
+
+ /// \brief Add dynamic type information to the region; return the new state.
+ ProgramStateRef addDynamicTypeInfo(const MemRegion *Reg,
+ QualType NewTy) const {
+ return addDynamicTypeInfo(Reg, DynamicTypeInfo(NewTy));
+ }
//==---------------------------------------------------------------------==//
// Accessing the Generic Data Map (GDM).