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 | 2d18419a7c8f9a2975d4ed74a202de6467308ad1 (patch) | |
tree | 464106fbed3a6d596f46a672e71ad907345084ea /lib/StaticAnalyzer/Core/Store.cpp | |
parent | 3738db9445b60d6d7cab5367122308f5f2c302fc (diff) |
[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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/Store.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/Store.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/Store.cpp b/lib/StaticAnalyzer/Core/Store.cpp index 98d815f328..ed221c5419 100644 --- a/lib/StaticAnalyzer/Core/Store.cpp +++ b/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; } |