=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-static-analyzer-1

Author: tigbr

<details>
<summary>Changes</summary>

This patch continues the refactoring roadmap described in issue #<!-- -->190973 
by renaming the `StackFrameContext` class to just `StackFrame`. Many variables 
of type `const StackFrame *` also had their names updated to reflect the new 
class name `StackFrame`.

---

Patch is 129.62 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/195802.diff


48 Files Affected:

- (modified) clang/include/clang/Analysis/AnalysisDeclContext.h (+23-23) 
- (modified) clang/include/clang/Analysis/ProgramPoint.h (+13-14) 
- (modified) 
clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h 
(+5-5) 
- (modified) 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h (+4-6) 
- (modified) clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h 
(+10-11) 
- (modified) 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h (+1-3) 
- (modified) 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h (+1-2) 
- (modified) 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h (+1-1) 
- (modified) clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h 
(+19-20) 
- (modified) 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h (+3-6) 
- (modified) 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h (+3-5) 
- (modified) clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h 
(+3-3) 
- (modified) 
clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h (+5-5) 
- (modified) clang/lib/Analysis/AnalysisDeclContext.cpp (+13-15) 
- (modified) clang/lib/Analysis/CFG.cpp (+1-1) 
- (modified) clang/lib/Analysis/PathDiagnostic.cpp (+9-10) 
- (modified) clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp (+1-1) 
- (modified) clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp (+4-4) 
- (modified) clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp (+1-1) 
- (modified) clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp (+2-2) 
- (modified) 
clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h 
(+3-3) 
- (modified) 
clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp 
(+2-2) 
- (modified) clang/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp (+3-3) 
- (modified) clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp 
(+5-5) 
- (modified) clang/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp 
(+14-14) 
- (modified) clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp (+1-1) 
- (modified) clang/lib/StaticAnalyzer/Core/BlockCounter.cpp (+7-9) 
- (modified) clang/lib/StaticAnalyzer/Core/BugReporter.cpp (+2-2) 
- (modified) clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (+52-53) 
- (modified) clang/lib/StaticAnalyzer/Core/CallEvent.cpp (+53-63) 
- (modified) clang/lib/StaticAnalyzer/Core/CoreEngine.cpp (+2-2) 
- (modified) clang/lib/StaticAnalyzer/Core/Environment.cpp (+1-1) 
- (modified) clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp (+1-1) 
- (modified) clang/lib/StaticAnalyzer/Core/ExprEngine.cpp (+9-9) 
- (modified) clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp (+10-10) 
- (modified) clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp (+39-41) 
- (modified) clang/lib/StaticAnalyzer/Core/LoopWidening.cpp (+5-5) 
- (modified) clang/lib/StaticAnalyzer/Core/MemRegion.cpp (+55-58) 
- (modified) clang/lib/StaticAnalyzer/Core/ProgramState.cpp (+4-5) 
- (modified) clang/lib/StaticAnalyzer/Core/RegionStore.cpp (+12-14) 
- (modified) clang/lib/StaticAnalyzer/Core/SValBuilder.cpp (+4-4) 
- (modified) clang/lib/StaticAnalyzer/Core/Store.cpp (+2-2) 
- (modified) clang/lib/StaticAnalyzer/Core/SymbolManager.cpp (+11-11) 
- (modified) clang/lib/StaticAnalyzer/Core/WorkList.cpp (+2-2) 
- (modified) clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp (+6-7) 
- (modified) clang/unittests/StaticAnalyzer/ParamRegionTest.cpp (+16-18) 
- (modified) clang/unittests/StaticAnalyzer/StoreTest.cpp (+10-12) 
- (modified) clang/unittests/StaticAnalyzer/SymbolReaperTest.cpp (+3-4) 


``````````diff
diff --git a/clang/include/clang/Analysis/AnalysisDeclContext.h 
b/clang/include/clang/Analysis/AnalysisDeclContext.h
index fb9ed61229277..846960ad48075 100644
--- a/clang/include/clang/Analysis/AnalysisDeclContext.h
+++ b/clang/include/clang/Analysis/AnalysisDeclContext.h
@@ -41,7 +41,7 @@ class ImplicitParamDecl;
 class LocationContext;
 class LocationContextManager;
 class ParentMap;
-class StackFrameContext;
+class StackFrame;
 class Stmt;
 class VarDecl;
 
@@ -177,10 +177,10 @@ class AnalysisDeclContext {
   const ImplicitParamDecl *getSelfDecl() const;
 
   /// \copydoc LocationContextManager::getStackFrame()
-  const StackFrameContext *getStackFrame(LocationContext const *ParentLC,
-                                         const void *Data, const Expr *E,
-                                         const CFGBlock *Blk,
-                                         unsigned BlockCount, unsigned Index);
+  const StackFrame *getStackFrame(LocationContext const *ParentLC,
+                                  const void *Data, const Expr *E,
+                                  const CFGBlock *Blk, unsigned BlockCount,
+                                  unsigned Index);
 
   /// \returns The specified analysis object, lazily running the analysis if
   /// necessary or nullptr if the analysis could not run.
@@ -205,7 +205,7 @@ class AnalysisDeclContext {
 
 class LocationContext : public llvm::FoldingSetNode {
 public:
-  enum ContextKind { StackFrame };
+  enum ContextKind { StackFrameKind };
 
 private:
   ContextKind Kind;
@@ -250,7 +250,7 @@ class LocationContext : public llvm::FoldingSetNode {
   /// \copydoc AnalysisDeclContext::getSelfDecl()
   const ImplicitParamDecl *getSelfDecl() const { return Ctx->getSelfDecl(); }
 
-  const StackFrameContext *getStackFrame() const;
+  const StackFrame *getStackFrame() const;
 
   /// \returns Whether the current LocationContext has no caller context.
   virtual bool inTopFrame() const;
@@ -287,7 +287,7 @@ class LocationContext : public llvm::FoldingSetNode {
 };
 
 /// It represents a stack frame of the call stack (based on CallEvent).
-class StackFrameContext : public LocationContext {
+class StackFrame : public LocationContext {
   friend class LocationContextManager;
 
   // Extra data for BlockInvocations
@@ -307,14 +307,14 @@ class StackFrameContext : public LocationContext {
   // The index of the call site in the CFGBlock.
   const unsigned Index;
 
-  StackFrameContext(AnalysisDeclContext *ADC, const LocationContext *ParentLC,
-                    const void *Data, const Expr *E, const CFGBlock *Block,
-                    unsigned BlockCount, unsigned Index, int64_t ID)
-      : LocationContext(StackFrame, ADC, ParentLC, ID), Data(Data), 
CallSite(E),
-        Block(Block), BlockCount(BlockCount), Index(Index) {}
+  StackFrame(AnalysisDeclContext *ADC, const LocationContext *ParentLC,
+             const void *Data, const Expr *E, const CFGBlock *Block,
+             unsigned BlockCount, unsigned Index, int64_t ID)
+      : LocationContext(StackFrameKind, ADC, ParentLC, ID), Data(Data),
+        CallSite(E), Block(Block), BlockCount(BlockCount), Index(Index) {}
 
 public:
-  ~StackFrameContext() override = default;
+  ~StackFrame() override = default;
 
   const void *getData() const { return Data; }
 
@@ -334,7 +334,7 @@ class StackFrameContext : public LocationContext {
                       const LocationContext *ParentLC, const void *Data,
                       const Expr *E, const CFGBlock *Block, unsigned 
BlockCount,
                       unsigned Index) {
-    ProfileCommon(ID, StackFrame, ADC, ParentLC, E);
+    ProfileCommon(ID, StackFrameKind, ADC, ParentLC, E);
     ID.AddPointer(Data);
     ID.AddPointer(Block);
     ID.AddInteger(BlockCount);
@@ -342,7 +342,7 @@ class StackFrameContext : public LocationContext {
   }
 
   static bool classof(const LocationContext *LC) {
-    return LC->getKind() == StackFrame;
+    return LC->getKind() == StackFrameKind;
   }
 };
 
@@ -360,7 +360,7 @@ class LocationContextManager {
   /// \param ADC        The AnalysisDeclContext.
   /// \param ParentLC   The parent context of this newly created
   ///                   context.
-  /// \param Data       Extra data in case this StackFrameContext is
+  /// \param Data       Extra data in case this StackFrame is
   ///                   created for a BlockInvocation.
   /// \param E          The call expression.
   /// \param Block      The basic block.
@@ -368,11 +368,11 @@ class LocationContextManager {
   /// \param StmtIdx    The index of the call expression \p E among the
   ///                   statements of the CFGBlock \p Block.
   /// \returns The stack frame context corresponding to the call.
-  const StackFrameContext *getStackFrame(AnalysisDeclContext *ADC,
-                                         const LocationContext *ParentLC,
-                                         const void *Data, const Expr *E,
-                                         const CFGBlock *Block,
-                                         unsigned BlockCount, unsigned 
StmtIdx);
+  const StackFrame *getStackFrame(AnalysisDeclContext *ADC,
+                                  const LocationContext *ParentLC,
+                                  const void *Data, const Expr *E,
+                                  const CFGBlock *Block, unsigned BlockCount,
+                                  unsigned StmtIdx);
 
   /// Discard all previously created LocationContext objects.
   void clear();
@@ -423,7 +423,7 @@ class AnalysisDeclContextManager {
   /// Obtain the beginning context of the analysis.
   ///
   /// \returns The top level stack frame for \p D.
-  const StackFrameContext *getStackFrame(const Decl *D) {
+  const StackFrame *getStackFrame(const Decl *D) {
     return LocCtxMgr.getStackFrame(getContext(D), nullptr, nullptr, nullptr,
                                    nullptr, 0, 0);
   }
diff --git a/clang/include/clang/Analysis/ProgramPoint.h 
b/clang/include/clang/Analysis/ProgramPoint.h
index 8b7d46177b11b..993eddf38ac87 100644
--- a/clang/include/clang/Analysis/ProgramPoint.h
+++ b/clang/include/clang/Analysis/ProgramPoint.h
@@ -182,7 +182,7 @@ class ProgramPoint {
     return L.getPointer();
   }
 
-  const StackFrameContext *getStackFrame() const {
+  const StackFrame *getStackFrame() const {
     return getLocationContext()->getStackFrame();
   }
 
@@ -637,22 +637,22 @@ class PostAllocatorCall : public StmtPoint {
 /// CallEnter uses the caller's location context.
 class CallEnter : public ProgramPoint {
 public:
-  CallEnter(const Stmt *stmt, const StackFrameContext *calleeCtx,
+  CallEnter(const Stmt *stmt, const StackFrame *CalleeSF,
             const LocationContext *callerCtx)
-    : ProgramPoint(stmt, calleeCtx, CallEnterKind, callerCtx, nullptr) {}
+      : ProgramPoint(stmt, CalleeSF, CallEnterKind, callerCtx, nullptr) {}
 
   const Stmt *getCallExpr() const {
     return static_cast<const Stmt *>(getData1());
   }
 
-  const StackFrameContext *getCalleeContext() const {
-    return static_cast<const StackFrameContext *>(getData2());
+  const StackFrame *getCalleeContext() const {
+    return static_cast<const StackFrame *>(getData2());
   }
 
   /// Returns the entry block in the CFG for the entered function.
   const CFGBlock *getEntry() const {
-    const StackFrameContext *CalleeCtx = getCalleeContext();
-    const CFG *CalleeCFG = CalleeCtx->getCFG();
+    const StackFrame *CalleeSF = getCalleeContext();
+    const CFG *CalleeCFG = CalleeSF->getCFG();
     return &(CalleeCFG->getEntry());
   }
 
@@ -676,8 +676,8 @@ class CallEnter : public ProgramPoint {
 class CallExitBegin : public ProgramPoint {
 public:
   // CallExitBegin uses the callee's location context.
-  CallExitBegin(const StackFrameContext *L, const ReturnStmt *RS)
-    : ProgramPoint(RS, CallExitBeginKind, L, nullptr) { }
+  CallExitBegin(const StackFrame *SF, const ReturnStmt *RS)
+      : ProgramPoint(RS, CallExitBeginKind, SF, nullptr) {}
 
   const ReturnStmt *getReturnStmt() const {
     return static_cast<const ReturnStmt *>(getData1());
@@ -696,12 +696,11 @@ class CallExitBegin : public ProgramPoint {
 class CallExitEnd : public ProgramPoint {
 public:
   // CallExitEnd uses the caller's location context.
-  CallExitEnd(const StackFrameContext *CalleeCtx,
-              const LocationContext *CallerCtx)
-    : ProgramPoint(CalleeCtx, CallExitEndKind, CallerCtx, nullptr) {}
+  CallExitEnd(const StackFrame *CalleeSF, const LocationContext *CallerCtx)
+      : ProgramPoint(CalleeSF, CallExitEndKind, CallerCtx, nullptr) {}
 
-  const StackFrameContext *getCalleeContext() const {
-    return static_cast<const StackFrameContext *>(getData1());
+  const StackFrame *getCalleeContext() const {
+    return static_cast<const StackFrame *>(getData1());
   }
 
 private:
diff --git 
a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h 
b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
index 56f7ca63d0062..03d3b97876ac9 100644
--- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
+++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
@@ -233,7 +233,7 @@ class Tracker : public llvm::RefCountedBase<Tracker> {
   ///        this visitor can prevent that without polluting the bugpath too
   ///        much.
   virtual Result track(SVal V, const MemRegion *R, TrackingOptions Opts = {},
-                       const StackFrameContext *Origin = nullptr);
+                       const StackFrame *Origin = nullptr);
 
   /// Handle the store operation and produce the note.
   ///
@@ -386,7 +386,7 @@ bool trackExpressionValue(const ExplodedNode *N, const Expr 
*E,
 ///        much.
 void trackStoredValue(SVal V, const MemRegion *R,
                       PathSensitiveBugReport &Report, TrackingOptions Opts = 
{},
-                      const StackFrameContext *Origin = nullptr);
+                      const StackFrame *Origin = nullptr);
 
 const Expr *getDerefExpr(const Stmt *S);
 
@@ -632,15 +632,15 @@ class NoStateChangeFuncVisitor : public 
BugReporterVisitor {
   /// along the path.
   // TODO: Can't we just use a map instead? This is likely not as cheap as it
   // makes the code difficult to read.
-  llvm::SmallPtrSet<const StackFrameContext *, 32> FramesModifying;
-  llvm::SmallPtrSet<const StackFrameContext *, 32> FramesModifyingCalculated;
+  llvm::SmallPtrSet<const StackFrame *, 32> FramesModifying;
+  llvm::SmallPtrSet<const StackFrame *, 32> FramesModifyingCalculated;
 
   /// Check and lazily calculate whether the state is modified in the stack
   /// frame to which \p CallExitBeginN belongs.
   /// The calculation is cached in FramesModifying.
   bool isModifiedInFrame(const ExplodedNode *CallExitBeginN);
 
-  void markFrameAsModifying(const StackFrameContext *SCtx);
+  void markFrameAsModifying(const StackFrame *SF);
 
   /// Write to \c FramesModifying all stack frames along the path in the 
current
   /// stack frame which modifies the state.
diff --git 
a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h 
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h
index 46ff69e0c3968..2afada4acb6ef 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h
@@ -19,7 +19,7 @@
 
 namespace clang {
 
-class StackFrameContext;
+class StackFrame;
 
 namespace ento {
 
@@ -34,8 +34,7 @@ class BlockCounter {
 public:
   BlockCounter() : Data(nullptr) {}
 
-  unsigned getNumVisited(const StackFrameContext *CallSite,
-                         unsigned BlockID) const;
+  unsigned getNumVisited(const StackFrame *CallSite, unsigned BlockID) const;
 
   class Factory {
     void *F;
@@ -44,9 +43,8 @@ class BlockCounter {
     ~Factory();
 
     BlockCounter GetEmptyCounter();
-    BlockCounter IncrementCount(BlockCounter BC,
-                                  const StackFrameContext *CallSite,
-                                  unsigned BlockID);
+    BlockCounter IncrementCount(BlockCounter BC, const StackFrame *CallSite,
+                                unsigned BlockID);
   };
 
   friend class Factory;
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h 
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
index 30fedd91a942c..c18b40491039f 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
@@ -53,7 +53,7 @@ namespace clang {
 class LocationContext;
 class ProgramPoint;
 class ProgramPointTag;
-class StackFrameContext;
+class StackFrame;
 
 namespace ento {
 
@@ -382,7 +382,7 @@ class CallEvent {
 
   /// Populates the given SmallVector with the bindings in the callee's stack
   /// frame at the start of this call.
-  virtual void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
+  virtual void getInitialStackFrameContents(const StackFrame *CalleeSF,
                                             BindingsTy &Bindings) const = 0;
 
   /// Returns a copy of this CallEvent, but using the given state.
@@ -416,7 +416,7 @@ class CallEvent {
   /// during analysis if the call is inlined, but it may still be useful
   /// in intermediate calculations even if the call isn't inlined.
   /// May fail; returns null on failure.
-  const StackFrameContext *getCalleeStackFrame(unsigned BlockCount) const;
+  const StackFrame *getCalleeStackFrame(unsigned BlockCount) const;
 
   /// Returns memory location for a parameter variable within the callee stack
   /// frame. The behavior is undefined if the block count is different from the
@@ -530,7 +530,7 @@ class AnyFunctionCall : public CallEvent {
 
   bool argumentsMayEscape() const override;
 
-  void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
+  void getInitialStackFrameContents(const StackFrame *CalleeSF,
                                     BindingsTy &Bindings) const override;
 
   ArrayRef<ParmVarDecl *> parameters() const override;
@@ -674,7 +674,7 @@ class BlockCall : public CallEvent {
 
   bool argumentsMayEscape() const override { return true; }
 
-  void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
+  void getInitialStackFrameContents(const StackFrame *CalleeSF,
                                     BindingsTy &Bindings) const override;
 
   ArrayRef<ParmVarDecl *> parameters() const override;
@@ -719,7 +719,7 @@ class CXXInstanceCall : public AnyFunctionCall {
 
   RuntimeDefinition getRuntimeDefinition() const override;
 
-  void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
+  void getInitialStackFrameContents(const StackFrame *CalleeSF,
                                     BindingsTy &Bindings) const override;
 
   static bool classof(const CallEvent *CA) {
@@ -978,7 +978,7 @@ class AnyCXXConstructorCall : public AnyFunctionCall {
       ValueList &Values,
       RegionAndSymbolInvalidationTraits *ETraits) const override;
 
-  void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
+  void getInitialStackFrameContents(const StackFrame *CalleeSF,
                                     BindingsTy &Bindings) const override;
 
 public:
@@ -1091,7 +1091,7 @@ class CXXInheritedConstructorCall : public 
AnyCXXConstructorCall {
 
   /// Obtain the stack frame of the inheriting constructor. Argument 
expressions
   /// can be found on the call site of that stack frame.
-  const StackFrameContext *getInheritingStackFrame() const;
+  const StackFrame *getInheritingStackFrame() const;
 
   /// Obtain the CXXConstructExpr for the sub-class that inherited the current
   /// constructor (possibly indirectly). It's the statement that contains
@@ -1351,7 +1351,7 @@ class ObjCMethodCall : public CallEvent {
 
   bool argumentsMayEscape() const override;
 
-  void getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
+  void getInitialStackFrameContents(const StackFrame *CalleeSF,
                                     BindingsTy &Bindings) const override;
 
   ArrayRef<ParmVarDecl *> parameters() const override;
@@ -1428,8 +1428,7 @@ class CallEventManager {
   CallEventManager(llvm::BumpPtrAllocator &alloc);
 
   /// Gets an outside caller given a callee context.
-  CallEventRef<> getCaller(const StackFrameContext *CalleeCtx,
-                           ProgramStateRef State);
+  CallEventRef<> getCaller(const StackFrame *CalleeSF, ProgramStateRef State);
 
   /// Gets a call event for a function call, Objective-C method call,
   /// a 'new', or a 'delete' call.
diff --git 
a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h 
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index d3b18f7ec36dc..382bba923891a 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -105,9 +105,7 @@ class CheckerContext {
     return Pred->getLocationContext();
   }
 
-  const StackFrameContext *getStackFrame() const {
-    return Pred->getStackFrame();
-  }
+  const StackFrame *getStackFrame() const { return Pred->getStackFrame(); }
 
   /// Return true if the current LocationContext has no caller context.
   bool inTopFrame() const { return getLocationContext()->inTopFrame();  }
diff --git 
a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h 
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h
index 2e980110c2ff0..dd0165ae65076 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h
@@ -32,8 +32,7 @@ class SymbolReaper;
 /// This allows the environment to manage context-sensitive bindings,
 /// which is essentially for modeling recursive function analysis, among
 /// other things.
-class EnvironmentEntry
-    : public std::pair<const Expr *, const StackFrameContext *> {
+class EnvironmentEntry : public std::pair<const Expr *, const StackFrame *> {
 public:
   EnvironmentEntry(const Expr *E, const LocationContext *L);
 
diff --git 
a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h 
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
index e86afffd8d5d7..52f36aea7d719 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
@@ -144,7 +144,7 @@ class ExplodedNode : public llvm::FoldingSetNode {
     return getLocation().getLocationContext();
   }
 
-  const StackFrameContext *getStackFrame() const {
+  const StackFrame *getStackFrame() const {
     return getLocation().getStackFrame();
   }
 
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h 
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
index 31813f59ab748..a6b3574aa22d9 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
@@ -49,7 +49,7 @@ class AnalysisDeclContext;
 class CXXRecordDecl;
 class Decl;
 class LocationContext;
-class StackFrameContext;
+class StackFrame;
 
 namespace ento {
 
@@ -419,18 +419,18 @@ class UnknownSpaceRegion : public MemSpaceRegion {
 class StackSpaceRegion : public MemSpaceRegion {
   virtual void anchor();
 
-  const StackFrameContext *SFC;
+  const StackFrame *SF;
 
 protected:
-  StackSpaceRegion(MemRegionManager &mgr, Kind k, const StackFrameContext *sfc)
-      : MemSpaceRegion(mgr, k), SFC(sfc) {
+  StackSpaceRegion(MemRegionManager &mgr, Kind k, const StackFrame *SF)
+      : MemSpaceRegion(mgr, k), SF(SF) {
     assert(classof(this));
-    assert(sfc);
+    assert(SF);
   }
 
 public:
   LLVM_ATTRIBUTE_RETURNS_NONNULL
-  const StackFrameContext *getStackFrame() const { return SFC; }
+  const StackFrame *getStackFrame() const { return SF; }
 
   void Profile(llvm::FoldingSetNodeID &ID) const override;
 
@@ -443,8 +443,8 @@ class StackSpaceRegion : public MemSpaceRegion {
 class StackLocalsSpaceRegion : public StackSpaceRegion {
   friend class MemRegionManager;
 
-  StackLocalsSpaceRegion(MemRegionManager &mgr, const StackFrameContext *sfc)
-      : StackSpaceRegion(mgr, StackLocalsSpaceRegionKind, sfc) {}
+  StackLocalsSpaceRegion(MemRegionManager &mgr, const StackFrame *SF)
+   ...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/195802
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to