diff options
| author | Anna Zaks <ganna@apple.com> | 2012-07-30 20:31:29 +0000 |
|---|---|---|
| committer | Anna Zaks <ganna@apple.com> | 2012-07-30 20:31:29 +0000 |
| commit | 63282aefb91f8dbc43a55819c1333353bb317df7 (patch) | |
| tree | ad6697edd16ebec1a8aa421417c7665b7801d872 /clang/lib/StaticAnalyzer/Core/Store.cpp | |
| parent | b7c2d1506599e87dab89df4b071a0362fc27ae8f (diff) | |
| download | bcm5719-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/Store.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/Store.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp index 98d815f3289..ed221c5419e 100644 --- a/clang/lib/StaticAnalyzer/Core/Store.cpp +++ b/clang/lib/StaticAnalyzer/Core/Store.cpp @@ -53,6 +53,13 @@ StoreRef StoreManager::enterStackFrame(Store OldStore, Store = Bind(Store.getStore(), ThisRegion, ThisVal); } + if (const ObjCMethodCall *MCall = dyn_cast<ObjCMethodCall>(&Call)) { + SVal SelfVal = MCall->getReceiverSVal(); + const VarDecl *SelfDecl = LCtx->getAnalysisDeclContext()->getSelfDecl(); + Store = Bind(Store.getStore(), + svalBuilder.makeLoc(MRMgr.getVarRegion(SelfDecl, LCtx)), + SelfVal); + } return Store; } |

