diff options
author | Anna Zaks <ganna@apple.com> | 2012-08-03 21:43:37 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-08-03 21:43:37 +0000 |
commit | 148fee988e32efcad45ecf7b3bf714880c657dda (patch) | |
tree | 0d51ee02bdc3957c1338ce25a091324e8cc150c4 /include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h | |
parent | 89ab7d0012ffe02a335b765eeb9b48977a5ecd79 (diff) |
[analyzer] ObjC Inlining: Start tracking dynamic type info in the GDM
In the following code, find the type of the symbolic receiver by
following it and updating the dynamic type info in the state when we
cast the symbol from id to MyClass *.
MyClass *a = [[self alloc] init];
return 5/[a testSelf];
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h index 4e92873860..9d82ec6983 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h @@ -66,6 +66,12 @@ public: DynamicTypeInfo() : T(QualType()) {} DynamicTypeInfo(QualType WithType) : T(WithType) {} QualType getType() {return T;} + void Profile(llvm::FoldingSetNodeID &ID) const { + T.Profile(ID); + } + bool operator==(const DynamicTypeInfo &X) const { + return T == X.T; + } }; /// \class ProgramState @@ -327,6 +333,8 @@ public: /// 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; //==---------------------------------------------------------------------==// // Accessing the Generic Data Map (GDM). |