summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-07-30 20:31:29 +0000
committerAnna Zaks <ganna@apple.com>2012-07-30 20:31:29 +0000
commit63282aefb91f8dbc43a55819c1333353bb317df7 (patch)
treead6697edd16ebec1a8aa421417c7665b7801d872 /clang/lib/StaticAnalyzer/Core/ProgramState.cpp
parentb7c2d1506599e87dab89df4b071a0362fc27ae8f (diff)
downloadbcm5719-llvm-63282aefb91f8dbc43a55819c1333353bb317df7.tar.gz
bcm5719-llvm-63282aefb91f8dbc43a55819c1333353bb317df7.zip
[analyzer] Very simple ObjC instance method inlining
- Retrieves the type of the object/receiver from the state. - Binds self during stack setup. - Only explores the path on which the method is inlined (no bifurcation to explore the path on which the method is not inlined). llvm-svn: 160991
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ProgramState.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ProgramState.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
index 6adc18c67ce..20f1e226b87 100644
--- a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
@@ -731,3 +731,12 @@ bool ProgramState::isTainted(SymbolRef Sym, TaintTagType Kind) const {
return Tainted;
}
+
+DynamicTypeInfo ProgramState::getDynamicTypeInfo(const MemRegion *Reg) const {
+ if (const TypedRegion *TR = dyn_cast<TypedRegion>(Reg))
+ return DynamicTypeInfo(TR->getLocationType());
+ if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(Reg))
+ return DynamicTypeInfo(SR->getSymbol()
+ ->getType(getStateManager().getContext()));
+ return DynamicTypeInfo();
+}
OpenPOWER on IntegriCloud