Index: include/clang/Analysis/AnalysisDeclContext.h =================================================================== --- include/clang/Analysis/AnalysisDeclContext.h +++ include/clang/Analysis/AnalysisDeclContext.h @@ -264,7 +264,7 @@ return Ctx->getSelfDecl(); } - const StackFrameContext *getCurrentStackFrame() const; + const StackFrameContext *getStackFrame() const; /// Return true if the current LocationContext has no caller context. virtual bool inTopFrame() const; Index: include/clang/Analysis/ProgramPoint.h =================================================================== --- include/clang/Analysis/ProgramPoint.h +++ include/clang/Analysis/ProgramPoint.h @@ -181,6 +181,10 @@ return L.getPointer(); } + const StackFrameContext *getStackFrame() const { + return getLocationContext()->getStackFrame(); + } + // For use with DenseMap. This hash is probably slow. unsigned getHashValue() const { llvm::FoldingSetNodeID ID; Index: include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h @@ -211,7 +211,7 @@ /// visited on the exploded graph path. unsigned blockCount() const { return Eng.WList->getBlockCounter().getNumVisited( - LC->getCurrentStackFrame(), + LC->getStackFrame(), Block->getBlockID()); } }; Index: include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h @@ -147,7 +147,7 @@ } const StackFrameContext *getStackFrame() const { - return getLocationContext()->getCurrentStackFrame(); + return getLocation().getStackFrame(); } const Decl &getCodeDecl() const { return *getLocationContext()->getDecl(); } Index: lib/Analysis/AnalysisDeclContext.cpp =================================================================== --- lib/Analysis/AnalysisDeclContext.cpp +++ lib/Analysis/AnalysisDeclContext.cpp @@ -442,7 +442,7 @@ // LocationContext methods. //===----------------------------------------------------------------------===// -const StackFrameContext *LocationContext::getCurrentStackFrame() const { +const StackFrameContext *LocationContext::getStackFrame() const { const LocationContext *LC = this; while (LC) { if (const auto *SFC = dyn_cast(LC)) @@ -453,7 +453,7 @@ } bool LocationContext::inTopFrame() const { - return getCurrentStackFrame()->inTopFrame(); + return getStackFrame()->inTopFrame(); } bool LocationContext::isParentOf(const LocationContext *LC) const { Index: lib/StaticAnalyzer/Checkers/CXXSelfAssignmentChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/CXXSelfAssignmentChecker.cpp +++ lib/StaticAnalyzer/Checkers/CXXSelfAssignmentChecker.cpp @@ -48,7 +48,7 @@ auto &State = C.getState(); auto &SVB = C.getSValBuilder(); auto ThisVal = - State->getSVal(SVB.getCXXThis(MD, LCtx->getCurrentStackFrame())); + State->getSVal(SVB.getCXXThis(MD, LCtx->getStackFrame())); auto Param = SVB.makeLoc(State->getRegion(MD->getParamDecl(0), LCtx)); auto ParamVal = State->getSVal(Param); ProgramStateRef SelfAssignState = State->bindLoc(Param, ThisVal, LCtx); Index: lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp +++ lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp @@ -149,7 +149,7 @@ // A specific instantiation of an inlined function may have more constrained // values than can generally be assumed. Skip the check. - if (LC->getCurrentStackFrame()->getParent() != nullptr) + if (LC->getStackFrame()->getParent() != nullptr) return; reportBug(getArgumentValueString(CE, C), C); @@ -178,7 +178,7 @@ // when we are analyzing it as an inlined function. This means that // clang_analyzer_checkInlined(true) should always print TRUE, but // clang_analyzer_checkInlined(false) should never actually print anything. - if (LC->getCurrentStackFrame()->getParent() == nullptr) + if (LC->getStackFrame()->getParent() == nullptr) return; reportBug(getArgumentValueString(CE, C), C); Index: lib/StaticAnalyzer/Checkers/MallocChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -2258,7 +2258,7 @@ // Do not show local variables belonging to a function other than // where the error is reported. if (!VR || - (VR->getStackFrame() == LeakContext->getCurrentStackFrame())) + (VR->getStackFrame() == LeakContext->getStackFrame())) ReferenceRegion = MR; } } @@ -2919,7 +2919,7 @@ // reference counting operations within it (see the code above), // and if so, we'd conclude that it likely is a reference counting // pointer destructor. - ReleaseDestructorLC = LC->getCurrentStackFrame(); + ReleaseDestructorLC = LC->getStackFrame(); // It is unlikely that releasing memory is delegated to a destructor // inside a destructor of a shared pointer, because it's fairly hard // to pass the information that the pointer indeed needs to be Index: lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp +++ lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp @@ -186,8 +186,7 @@ } static QualType parameterTypeFromSVal(SVal val, CheckerContext &C) { - const StackFrameContext * - SFC = C.getLocationContext()->getCurrentStackFrame(); + const StackFrameContext * SFC = C.getStackFrame(); if (Optional X = val.getAs()) { const MemRegion* R = X->getRegion(); if (const VarRegion *VR = R->getAs()) Index: lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -1968,8 +1968,8 @@ const Stmt *S = N->getLocation().castAs().getStmt(); if (isa(S) && - isSynthesizedAccessor(LCtx->getCurrentStackFrame())) { - S = LCtx->getCurrentStackFrame()->getCallSite(); + isSynthesizedAccessor(LCtx->getStackFrame())) { + S = LCtx->getStackFrame()->getCallSite(); } if (isa(S)) { @@ -2297,7 +2297,7 @@ const VarRegion *VR = R->getBaseRegion()->getAs(); // Do not show local variables belonging to a function other than // where the error is reported. - if (!VR || VR->getStackFrame() == LeakContext->getCurrentStackFrame()) + if (!VR || VR->getStackFrame() == LeakContext->getStackFrame()) FirstBinding = R; } Index: lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp +++ lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp @@ -120,7 +120,7 @@ bool StackAddrEscapeChecker::isNotInCurrentFrame(const MemRegion *R, CheckerContext &C) { const StackSpaceRegion *S = cast(R->getMemorySpace()); - return S->getStackFrame() != C.getLocationContext()->getCurrentStackFrame(); + return S->getStackFrame() != C.getStackFrame(); } bool StackAddrEscapeChecker::isSemaphoreCaptured(const BlockDecl &B) const { @@ -303,8 +303,7 @@ public: SmallVector, 10> V; - CallBack(CheckerContext &CC) - : Ctx(CC), CurSFC(CC.getLocationContext()->getCurrentStackFrame()) {} + CallBack(CheckerContext &CC) : Ctx(CC), CurSFC(CC.getStackFrame()) {} bool HandleBinding(StoreManager &SMgr, Store S, const MemRegion *Region, SVal Val) override { Index: lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp +++ lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp @@ -108,7 +108,7 @@ if (!MD) return nullptr; auto ThiSVal = - State->getSVal(SVB.getCXXThis(MD, LCtx->getCurrentStackFrame())); + State->getSVal(SVB.getCXXThis(MD, LCtx->getStackFrame())); const MemRegion *Reg = ThiSVal.castAs().getRegion(); if (!Reg) return nullptr; @@ -230,7 +230,7 @@ // Enter a constructor, set the corresponding memregion be true. if (isa(MD)) { auto ThiSVal = - State->getSVal(SVB.getCXXThis(MD, LCtx->getCurrentStackFrame())); + State->getSVal(SVB.getCXXThis(MD, LCtx->getStackFrame())); const MemRegion *Reg = ThiSVal.getAsRegion(); if (IsBeginFunction) State = State->set(Reg, ObjectState::CtorCalled); @@ -244,7 +244,7 @@ // Enter a Destructor, set the corresponding memregion be true. if (isa(MD)) { auto ThiSVal = - State->getSVal(SVB.getCXXThis(MD, LCtx->getCurrentStackFrame())); + State->getSVal(SVB.getCXXThis(MD, LCtx->getStackFrame())); const MemRegion *Reg = ThiSVal.getAsRegion(); if (IsBeginFunction) State = State->set(Reg, ObjectState::DtorCalled); Index: lib/StaticAnalyzer/Core/BugReporter.cpp =================================================================== --- lib/StaticAnalyzer/Core/BugReporter.cpp +++ lib/StaticAnalyzer/Core/BugReporter.cpp @@ -865,7 +865,7 @@ const LocationContext *CallerCtx) { // FIXME: Handle non-CallExpr-based CallEvents. - const StackFrameContext *Callee = CalleeCtx->getCurrentStackFrame(); + const StackFrameContext *Callee = CalleeCtx->getStackFrame(); const Stmt *CallSite = Callee->getCallSite(); if (const auto *CE = dyn_cast_or_null(CallSite)) { if (const auto *FD = dyn_cast(CalleeCtx->getDecl())) { @@ -1956,7 +1956,7 @@ if (AddPathEdges) { // Add an edge to the start of the function. // We'll prune it out later, but it helps make diagnostics more uniform. - const StackFrameContext *CalleeLC = PDB.LC->getCurrentStackFrame(); + const StackFrameContext *CalleeLC = PDB.LC->getStackFrame(); const Decl *D = CalleeLC->getDecl(); addEdgeToPath(PD->getActivePath(), PrevLoc, PathDiagnosticLocation::createBegin(D, SM), CalleeLC); @@ -2051,7 +2051,7 @@ return nullptr; const LocationContext *LC = N->getLocationContext(); - return LC->getCurrentStackFrame()->getDecl(); + return LC->getStackFrame()->getDecl(); } void BugReport::Profile(llvm::FoldingSetNodeID& hash) const { Index: lib/StaticAnalyzer/Core/BugReporterVisitors.cpp =================================================================== --- lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -264,7 +264,7 @@ BugReport &BR) override { const LocationContext *Ctx = N->getLocationContext(); - const StackFrameContext *SCtx = Ctx->getCurrentStackFrame(); + const StackFrameContext *SCtx = Ctx->getStackFrame(); ProgramStateRef State = N->getState(); auto CallExitLoc = N->getLocationAs(); @@ -319,7 +319,7 @@ /// The calculation is cached in FramesModifyingRegion. bool isRegionOfInterestModifiedInFrame(const ExplodedNode *N) { const LocationContext *Ctx = N->getLocationContext(); - const StackFrameContext *SCtx = Ctx->getCurrentStackFrame(); + const StackFrameContext *SCtx = Ctx->getStackFrame(); if (!FramesModifyingCalculated.count(SCtx)) findModifyingFrames(N); return FramesModifyingRegion.count(SCtx); @@ -333,7 +333,7 @@ ProgramStateRef LastReturnState = N->getState(); SVal ValueAtReturn = LastReturnState->getSVal(RegionOfInterest); const LocationContext *Ctx = N->getLocationContext(); - const StackFrameContext *OriginalSCtx = Ctx->getCurrentStackFrame(); + const StackFrameContext *OriginalSCtx = Ctx->getStackFrame(); do { ProgramStateRef State = N->getState(); @@ -344,16 +344,15 @@ } FramesModifyingCalculated.insert( - N->getLocationContext()->getCurrentStackFrame()); + N->getLocationContext()->getStackFrame()); if (wasRegionOfInterestModifiedAt(N, LastReturnState, ValueAtReturn)) { - const StackFrameContext *SCtx = - N->getLocationContext()->getCurrentStackFrame(); + const StackFrameContext *SCtx = N->getStackFrame(); while (!SCtx->inTopFrame()) { auto p = FramesModifyingRegion.insert(SCtx); if (!p.second) break; // Frame and all its parents already inserted. - SCtx = SCtx->getParent()->getCurrentStackFrame(); + SCtx = SCtx->getParent()->getStackFrame(); } } @@ -913,7 +912,7 @@ assert(VR->getDecl()->hasLocalStorage()); const LocationContext *LCtx = N->getLocationContext(); - return FrameSpace->getStackFrame() == LCtx->getCurrentStackFrame(); + return FrameSpace->getStackFrame() == LCtx->getStackFrame(); } /// Show diagnostics for initializing or declaring a region \p R with a bad value. @@ -2310,7 +2309,7 @@ const auto Param = State->getSVal(State->getRegion(Met->getParamDecl(0), LCtx)); const auto This = - State->getSVal(SVB.getCXXThis(Met, LCtx->getCurrentStackFrame())); + State->getSVal(SVB.getCXXThis(Met, LCtx->getStackFrame())); auto L = PathDiagnosticLocation::create(Met, BRC.getSourceManager()); Index: lib/StaticAnalyzer/Core/CallEvent.cpp =================================================================== --- lib/StaticAnalyzer/Core/CallEvent.cpp +++ lib/StaticAnalyzer/Core/CallEvent.cpp @@ -1221,7 +1221,7 @@ CallEventManager::getCaller(const StackFrameContext *CalleeCtx, ProgramStateRef State) { const LocationContext *ParentCtx = CalleeCtx->getParent(); - const LocationContext *CallerCtx = ParentCtx->getCurrentStackFrame(); + const LocationContext *CallerCtx = ParentCtx->getStackFrame(); assert(CallerCtx && "This should not be used for top-level stack frames"); const Stmt *CallSite = CalleeCtx->getCallSite(); Index: lib/StaticAnalyzer/Core/CoreEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/CoreEngine.cpp +++ lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -256,7 +256,7 @@ const LocationContext *LC = Pred->getLocationContext(); unsigned BlockId = L.getBlock()->getBlockID(); BlockCounter Counter = WList->getBlockCounter(); - Counter = BCounterFactory.IncrementCount(Counter, LC->getCurrentStackFrame(), + Counter = BCounterFactory.IncrementCount(Counter, LC->getStackFrame(), BlockId); WList->setBlockCounter(Counter); Index: lib/StaticAnalyzer/Core/Environment.cpp =================================================================== --- lib/StaticAnalyzer/Core/Environment.cpp +++ lib/StaticAnalyzer/Core/Environment.cpp @@ -67,7 +67,7 @@ EnvironmentEntry::EnvironmentEntry(const Stmt *S, const LocationContext *L) : std::pair(ignoreTransparentExprs(S), - L ? L->getCurrentStackFrame() + L ? L->getStackFrame() : nullptr) {} SVal Environment::lookupExpr(const EnvironmentEntry &E) const { Index: lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/ExprEngine.cpp +++ lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -282,7 +282,7 @@ // Precondition: 'this' is always non-null upon entry to the // top-level function. This is our starting assumption for // analyzing an "open" program. - const StackFrameContext *SFC = InitLoc->getCurrentStackFrame(); + const StackFrameContext *SFC = InitLoc->getStackFrame(); if (SFC->getParent() == nullptr) { loc::MemRegionVal L = svalBuilder.getCXXThis(MD, SFC); SVal V = state->getSVal(L); @@ -450,7 +450,7 @@ ProgramStateRef State, llvm::PointerUnion P, const LocationContext *LC, SVal V) { - ConstructedObjectKey Key(P, LC->getCurrentStackFrame()); + ConstructedObjectKey Key(P, LC->getStackFrame()); // FIXME: Currently the state might already contain the marker due to // incorrect handling of temporaries bound to default parameters. assert(!State->get(Key) || @@ -462,7 +462,7 @@ ProgramStateRef State, llvm::PointerUnion P, const LocationContext *LC) { - ConstructedObjectKey Key(P, LC->getCurrentStackFrame()); + ConstructedObjectKey Key(P, LC->getStackFrame()); return Optional::create(State->get(Key)); } @@ -470,7 +470,7 @@ ProgramStateRef State, llvm::PointerUnion P, const LocationContext *LC) { - ConstructedObjectKey Key(P, LC->getCurrentStackFrame()); + ConstructedObjectKey Key(P, LC->getStackFrame()); assert(State->contains(Key)); return State->remove(Key); } @@ -640,7 +640,7 @@ LC = LC->getParent(); } - const StackFrameContext *SFC = LC ? LC->getCurrentStackFrame() : nullptr; + const StackFrameContext *SFC = LC ? LC->getStackFrame() : nullptr; SymbolReaper SymReaper(SFC, ReferenceStmt, SymMgr, getStoreManager()); for (auto I : CleanedState->get()) { @@ -963,7 +963,7 @@ const auto *CurDtor = cast(LCtx->getDecl()); Loc ThisPtr = getSValBuilder().getCXXThis(CurDtor, - LCtx->getCurrentStackFrame()); + LCtx->getStackFrame()); SVal ThisVal = Pred->getState()->getSVal(ThisPtr); // Create the base object region. @@ -985,7 +985,7 @@ const auto *CurDtor = cast(LCtx->getDecl()); Loc ThisVal = getSValBuilder().getCXXThis(CurDtor, - LCtx->getCurrentStackFrame()); + LCtx->getStackFrame()); SVal FieldVal = State->getLValue(Member, State->getSVal(ThisVal).castAs()); @@ -1758,8 +1758,8 @@ bool ExprEngine::replayWithoutInlining(ExplodedNode *N, const LocationContext *CalleeLC) { - const StackFrameContext *CalleeSF = CalleeLC->getCurrentStackFrame(); - const StackFrameContext *CallerSF = CalleeSF->getParent()->getCurrentStackFrame(); + const StackFrameContext *CalleeSF = CalleeLC->getStackFrame(); + const StackFrameContext *CallerSF = CalleeSF->getParent()->getStackFrame(); assert(CalleeSF && CallerSF); ExplodedNode *BeforeProcessingCall = nullptr; const Stmt *CE = CalleeSF->getCallSite(); @@ -1771,7 +1771,7 @@ N = N->pred_empty() ? nullptr : *(N->pred_begin()); // Skip the nodes corresponding to the inlined code. - if (L.getLocationContext()->getCurrentStackFrame() != CallerSF) + if (L.getStackFrame() != CallerSF) continue; // We reached the caller. Find the node right before we started // processing the call. @@ -1870,10 +1870,10 @@ // Check if we stopped at the top level function or not. // Root node should have the location context of the top most function. const LocationContext *CalleeLC = Pred->getLocation().getLocationContext(); - const LocationContext *CalleeSF = CalleeLC->getCurrentStackFrame(); + const LocationContext *CalleeSF = CalleeLC->getStackFrame(); const LocationContext *RootLC = (*G.roots_begin())->getLocation().getLocationContext(); - if (RootLC->getCurrentStackFrame() != CalleeSF) { + if (RootLC->getStackFrame() != CalleeSF) { Engine.FunctionSummaries->markReachedMaxBlockCount(CalleeSF->getDecl()); // Re-run the call evaluation without inlining it, by storing the @@ -2190,7 +2190,7 @@ NodeBuilder Bldr(Pred, CleanUpObjects, BC); ProgramStateRef State = Pred->getState(); const LocationContext *FromLC = Pred->getLocationContext(); - const LocationContext *ToLC = FromLC->getCurrentStackFrame()->getParent(); + const LocationContext *ToLC = FromLC->getStackFrame()->getParent(); const LocationContext *LC = FromLC; while (LC != ToLC) { assert(LC && "ToLC must be a parent of FromLC!"); @@ -2353,7 +2353,7 @@ // variable should be captured. if (const FieldDecl *FD = LambdaCaptureFields[VD]) { Loc CXXThis = - svalBuilder.getCXXThis(MD, LocCtxt->getCurrentStackFrame()); + svalBuilder.getCXXThis(MD, LocCtxt->getStackFrame()); SVal CXXThisVal = state->getSVal(CXXThis); VInfo = std::make_pair(state->getLValue(FD, CXXThisVal), FD->getType()); } Index: lib/StaticAnalyzer/Core/ExprEngineCXX.cpp =================================================================== --- lib/StaticAnalyzer/Core/ExprEngineCXX.cpp +++ lib/StaticAnalyzer/Core/ExprEngineCXX.cpp @@ -139,7 +139,7 @@ assert(Init->isAnyMemberInitializer()); const CXXMethodDecl *CurCtor = cast(LCtx->getDecl()); Loc ThisPtr = - getSValBuilder().getCXXThis(CurCtor, LCtx->getCurrentStackFrame()); + getSValBuilder().getCXXThis(CurCtor, LCtx->getStackFrame()); SVal ThisVal = State->getSVal(ThisPtr); const ValueDecl *Field; @@ -185,7 +185,7 @@ // The temporary is to be managed by the parent stack frame. // So build it in the parent stack frame if we're not in the // top frame of the analysis. - const StackFrameContext *SFC = LCtx->getCurrentStackFrame(); + const StackFrameContext *SFC = LCtx->getStackFrame(); if (const LocationContext *CallerLCtx = SFC->getParent()) { auto RTC = (*SFC->getCallSiteBlock())[SFC->getIndex()] .getAs(); @@ -289,7 +289,7 @@ case CXXConstructExpr::CK_VirtualBase: // Make sure we are not calling virtual base class initializers twice. // Only the most-derived object should initialize virtual base classes. - if (const Stmt *Outer = LCtx->getCurrentStackFrame()->getCallSite()) { + if (const Stmt *Outer = LCtx->getStackFrame()->getCallSite()) { const CXXConstructExpr *OuterCtor = dyn_cast(Outer); if (OuterCtor) { switch (OuterCtor->getConstructionKind()) { @@ -327,7 +327,7 @@ case CXXConstructExpr::CK_Delegating: { const CXXMethodDecl *CurCtor = cast(LCtx->getDecl()); Loc ThisPtr = getSValBuilder().getCXXThis(CurCtor, - LCtx->getCurrentStackFrame()); + LCtx->getStackFrame()); SVal ThisVal = State->getSVal(ThisPtr); if (CE->getConstructionKind() == CXXConstructExpr::CK_Delegating) { Index: lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp =================================================================== --- lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +++ lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp @@ -74,15 +74,14 @@ const CFGBlock*> getLastStmt(const ExplodedNode *Node) { const Stmt *S = nullptr; const CFGBlock *Blk = nullptr; - const StackFrameContext *SF = - Node->getLocation().getLocationContext()->getCurrentStackFrame(); + const StackFrameContext *SF = Node->getStackFrame(); // Back up through the ExplodedGraph until we reach a statement node in this // stack frame. while (Node) { const ProgramPoint &PP = Node->getLocation(); - if (PP.getLocationContext()->getCurrentStackFrame() == SF) { + if (PP.getStackFrame() == SF) { if (Optional SP = PP.getAs()) { S = SP->getStmt(); break; @@ -204,13 +203,12 @@ void ExprEngine::processCallExit(ExplodedNode *CEBNode) { // Step 1 CEBNode was generated before the call. PrettyStackTraceLocationContext CrashInfo(CEBNode->getLocationContext()); - const StackFrameContext *calleeCtx = - CEBNode->getLocationContext()->getCurrentStackFrame(); + const StackFrameContext *calleeCtx = CEBNode->getStackFrame(); // The parent context might not be a stack frame, so make sure we // look up the first enclosing stack frame. const StackFrameContext *callerCtx = - calleeCtx->getParent()->getCurrentStackFrame(); + calleeCtx->getParent()->getStackFrame(); const Stmt *CE = calleeCtx->getCallSite(); ProgramStateRef state = CEBNode->getState(); @@ -418,7 +416,7 @@ assert(D); const LocationContext *CurLC = Pred->getLocationContext(); - const StackFrameContext *CallerSFC = CurLC->getCurrentStackFrame(); + const StackFrameContext *CallerSFC = CurLC->getStackFrame(); const LocationContext *ParentOfCallee = CallerSFC; if (Call.getKind() == CE_Block && !cast(Call).isConversionFromLambda()) { @@ -612,7 +610,7 @@ AnalyzerOptions &Opts, const ExprEngine::EvalCallOptions &CallOpts) { const LocationContext *CurLC = Pred->getLocationContext(); - const StackFrameContext *CallerSFC = CurLC->getCurrentStackFrame(); + const StackFrameContext *CallerSFC = CurLC->getStackFrame(); switch (Call.getKind()) { case CE_Function: case CE_Block: Index: lib/StaticAnalyzer/Core/LoopWidening.cpp =================================================================== --- lib/StaticAnalyzer/Core/LoopWidening.cpp +++ lib/StaticAnalyzer/Core/LoopWidening.cpp @@ -56,7 +56,7 @@ // being so inprecise. When the invalidation is improved, the handling // of nested loops will also need to be improved. ASTContext &ASTCtx = LCtx->getAnalysisDeclContext()->getASTContext(); - const StackFrameContext *STC = LCtx->getCurrentStackFrame(); + const StackFrameContext *STC = LCtx->getStackFrame(); MemRegionManager &MRMgr = PrevState->getStateManager().getRegionManager(); const MemRegion *Regions[] = {MRMgr.getStackLocalsRegion(STC), MRMgr.getStackArgumentsRegion(STC), Index: lib/StaticAnalyzer/Core/MemRegion.cpp =================================================================== --- lib/StaticAnalyzer/Core/MemRegion.cpp +++ lib/StaticAnalyzer/Core/MemRegion.cpp @@ -921,7 +921,7 @@ if (LC) { // FIXME: Once we implement scope handling, we want the parent region // to be the scope. - const StackFrameContext *STC = LC->getCurrentStackFrame(); + const StackFrameContext *STC = LC->getStackFrame(); assert(STC); sReg = getStackLocalsRegion(STC); } @@ -949,7 +949,7 @@ if (CL->isFileScope()) sReg = getGlobalsRegion(); else { - const StackFrameContext *STC = LC->getCurrentStackFrame(); + const StackFrameContext *STC = LC->getStackFrame(); assert(STC); sReg = getStackLocalsRegion(STC); } @@ -1014,7 +1014,7 @@ const CXXTempObjectRegion* MemRegionManager::getCXXTempObjectRegion(Expr const *E, LocationContext const *LC) { - const StackFrameContext *SFC = LC->getCurrentStackFrame(); + const StackFrameContext *SFC = LC->getStackFrame(); assert(SFC); return getSubRegion(E, getStackLocalsRegion(SFC)); } @@ -1078,7 +1078,7 @@ LC = LC->getParent(); D = dyn_cast(LC->getDecl()); } - const StackFrameContext *STC = LC->getCurrentStackFrame(); + const StackFrameContext *STC = LC->getStackFrame(); assert(STC); return getSubRegion(PT, getStackArgumentsRegion(STC)); } @@ -1086,7 +1086,7 @@ const AllocaRegion* MemRegionManager::getAllocaRegion(const Expr *E, unsigned cnt, const LocationContext *LC) { - const StackFrameContext *STC = LC->getCurrentStackFrame(); + const StackFrameContext *STC = LC->getStackFrame(); assert(STC); return getSubRegion(E, cnt, getStackLocalsRegion(STC)); } Index: lib/StaticAnalyzer/Core/SymbolManager.cpp =================================================================== --- lib/StaticAnalyzer/Core/SymbolManager.cpp +++ lib/StaticAnalyzer/Core/SymbolManager.cpp @@ -542,7 +542,7 @@ if (!LCtx) return false; - const StackFrameContext *CurrentContext = LCtx->getCurrentStackFrame(); + const StackFrameContext *CurrentContext = LCtx->getStackFrame(); if (VarContext == CurrentContext) { // If no statement is provided, everything is live. Index: lib/StaticAnalyzer/Core/WorkList.cpp =================================================================== --- lib/StaticAnalyzer/Core/WorkList.cpp +++ lib/StaticAnalyzer/Core/WorkList.cpp @@ -158,7 +158,7 @@ } else { LocIdentifier LocId = std::make_pair( BE->getBlock()->getBlockID(), - N->getLocationContext()->getCurrentStackFrame()); + N->getLocationContext()->getStackFrame()); auto InsertInfo = Reachable.insert(LocId); if (InsertInfo.second) { @@ -234,7 +234,7 @@ if (auto BE = N->getLocation().getAs()) { LocIdentifier LocId = std::make_pair( BE->getBlock()->getBlockID(), - N->getLocationContext()->getCurrentStackFrame()); + N->getLocationContext()->getStackFrame()); NumVisited = NumReached[LocId]++; }