]> granicus.if.org Git - clang/commitdiff
[analyzer] Add getStackFrame() to CheckerContext and ExplodedNode.
authorAnna Zaks <ganna@apple.com>
Tue, 14 Aug 2012 00:36:12 +0000 (00:36 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 14 Aug 2012 00:36:12 +0000 (00:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161819 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp

index 0669b05570645c349d926b17a3eccdb4a3b0555f..8c8e82ce20dddb784b1177b23a4ffcb1faec1a13 100644 (file)
@@ -92,8 +92,8 @@ public:
     return Pred->getLocationContext();
   }
 
-  const StackFrameContext *getCurrentStackFrame() const {
-    return getLocationContext()->getCurrentStackFrame();
+  const StackFrameContext *getStackFrame() const {
+    return Pred->getStackFrame();
   }
 
   BugReporter &getBugReporter() {
index 40969d3fa2440ecaa154d0ce52cc3eb0ba2db89a..1052d9491a96da4679887ce6d46b62478e255872 100644 (file)
@@ -133,6 +133,10 @@ public:
     return getLocation().getLocationContext();
   }
 
+  const StackFrameContext *getStackFrame() const {
+    return getLocationContext()->getCurrentStackFrame();
+  }
+
   const Decl &getCodeDecl() const { return *getLocationContext()->getDecl(); }
 
   CFG &getCFG() const { return *getLocationContext()->getCFG(); }
index f22d7404c042ce4266f3fc4a08e80988d7596219..fea57337bbdaa3685a81c8c2be9018e6ac8e04cd 100644 (file)
@@ -125,7 +125,7 @@ DynamicTypePropagation::getObjectTypeForAllocAndNew(const ObjCMessageExpr *MsgE,
 
   RecE= RecE->IgnoreParenImpCasts();
   if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(RecE)) {
-    const StackFrameContext *SFCtx = C.getCurrentStackFrame();
+    const StackFrameContext *SFCtx = C.getStackFrame();
     // Are we calling [self alloc]? If this is self, get the type of the
     // enclosing ObjC class.
     if (DRE->getDecl() == SFCtx->getSelfDecl()) {