From 608677a2e10538e2b88c533b5f409e5ab7adad87 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 21 Aug 2009 23:25:54 +0000 Subject: Remove 'SelfRegion' field from both BasicStoreManager and RegionStoreManager. SelfRegion represented the object bound to 'self' (when analyzing Objective-C methods) upon entry to a method. Having this region stored on the side ignores the current stack frame that we might be analyzing (among other things), and is a problem for interprocedural analysis. For RegionStoreManager, the value for SelfRegion is just lazily created. For BasicStoreManager, the value for SelfRegion is bound eagerly to 'self', but no explicit tracking of SelfRegion on the side is made. As part of this change, remove the restriction in BasicStoreManager that we only track ivars for 'self'. This shouldn't actually change anything in terms of precision, and simplifies the logic. llvm-svn: 79694 --- clang/lib/Analysis/AnalysisContext.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/Analysis/AnalysisContext.cpp') diff --git a/clang/lib/Analysis/AnalysisContext.cpp b/clang/lib/Analysis/AnalysisContext.cpp index 996d5c879ac..324fdf2dce8 100644 --- a/clang/lib/Analysis/AnalysisContext.cpp +++ b/clang/lib/Analysis/AnalysisContext.cpp @@ -37,6 +37,13 @@ Stmt *AnalysisContext::getBody() { llvm::llvm_unreachable("unknown code decl"); } +const ImplicitParamDecl *AnalysisContext::getSelfDecl() const { + if (const ObjCMethodDecl *MD = dyn_cast(D)) + return MD->getSelfDecl(); + + return NULL; +} + CFG *AnalysisContext::getCFG() { if (!cfg) cfg = CFG::buildCFG(getBody(), &D->getASTContext()); -- cgit v1.2.3