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 @@ -2253,7 +2253,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; } } @@ -2914,7 +2914,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 @@ -1977,8 +1977,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)) { @@ -2306,7 +2306,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 @@ -1325,7 +1325,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())) { @@ -1935,7 +1935,7 @@ // 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), @@ -2614,7 +2614,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 @@ -252,7 +252,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(); @@ -307,7 +307,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); @@ -321,7 +321,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(); @@ -332,16 +332,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(); } } @@ -905,7 +904,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. @@ -2308,7 +2307,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 @@ -1216,7 +1216,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 @@ -233,7 +233,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); @@ -312,7 +312,7 @@ bool FoundOriginalMaterializationRegion = false; const TypedValueRegion *TR = nullptr; if (const auto *MT = dyn_cast(Result)) { - auto Key = std::make_pair(MT, LC->getCurrentStackFrame()); + auto Key = std::make_pair(MT, LC->getStackFrame()); if (const CXXTempObjectRegion *const *TRPtr = State->get(Key)) { FoundOriginalMaterializationRegion = true; @@ -400,7 +400,7 @@ ProgramStateRef ExprEngine::addInitializedTemporary( ProgramStateRef State, const CXXBindTemporaryExpr *BTE, const LocationContext *LC, const CXXTempObjectRegion *R) { - const auto &Key = std::make_pair(BTE, LC->getCurrentStackFrame()); + const auto &Key = std::make_pair(BTE, LC->getStackFrame()); if (!State->contains(Key)) { return State->set(Key, R); } @@ -430,7 +430,7 @@ ProgramStateRef ExprEngine::addTemporaryMaterialization( ProgramStateRef State, const MaterializeTemporaryExpr *MTE, const LocationContext *LC, const CXXTempObjectRegion *R) { - const auto &Key = std::make_pair(MTE, LC->getCurrentStackFrame()); + const auto &Key = std::make_pair(MTE, LC->getStackFrame()); assert(!State->contains(Key)); return State->set(Key, R); } @@ -460,7 +460,7 @@ // If the temporary is being returned from the function, it will be // destroyed or lifetime-extended in the caller stack frame. if (isa(CC)) { - const StackFrameContext *SFC = LC->getCurrentStackFrame(); + const StackFrameContext *SFC = LC->getStackFrame(); assert(SFC); LC = SFC->getParent(); if (!LC) { @@ -774,7 +774,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()) @@ -1100,7 +1100,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. @@ -1122,7 +1122,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()); @@ -1901,8 +1901,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(); @@ -1914,7 +1914,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. @@ -2013,10 +2013,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 @@ -2338,7 +2338,7 @@ NodeBuilder Bldr(Pred, CleanUpTemporaries, 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!"); @@ -2499,7 +2499,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 @@ -140,7 +140,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; @@ -209,7 +209,7 @@ // won't necessarily end up with a temporary at the end. const LocationContext *TempLCtx = LCtx; if (const LocationContext *CallerLCtx = - LCtx->getCurrentStackFrame()->getParent()) { + LCtx->getStackFrame()->getParent()) { TempLCtx = CallerLCtx; } CallOpts.IsTemporaryCtorOrDtor = true; @@ -282,7 +282,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()) { @@ -320,7 +320,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; @@ -221,13 +220,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(); @@ -438,7 +436,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()) { @@ -634,7 +632,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 @@ -49,7 +49,7 @@ // TODO Nested loops are currently widened as a result of the invalidation // being so inprecise. When the invalidation is improved, the handling // of nested loops will also need to be improved. - 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 @@ -895,7 +895,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); } @@ -923,7 +923,7 @@ if (CL->isFileScope()) sReg = getGlobalsRegion(); else { - const StackFrameContext *STC = LC->getCurrentStackFrame(); + const StackFrameContext *STC = LC->getStackFrame(); assert(STC); sReg = getStackLocalsRegion(STC); } @@ -989,7 +989,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)); } @@ -1055,7 +1055,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)); } @@ -1063,7 +1063,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) { @@ -233,7 +233,7 @@ if (auto BE = N->getLocation().getAs()) { LocIdentifier LocId = std::make_pair( BE->getBlock()->getBlockID(), - N->getLocationContext()->getCurrentStackFrame()); + N->getLocationContext()->getStackFrame()); NumVisited = NumReached[LocId]++; }