[clang] [analyzer][NFC] Merge the `LocationContext` class into the `StackFrame` class (PR #198211)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed May 27 06:06:56 PDT 2026


================
@@ -95,32 +94,32 @@ class ProgramPoint {
   const void *Data1;
   llvm::PointerIntPair<const void *, 2, unsigned> Data2;
 
-  // The LocationContext could be NULL to allow ProgramPoint to be used in
+  // The StackFrame could be NULL to allow ProgramPoint to be used in
   // context insensitive analysis.
-  llvm::PointerIntPair<const LocationContext *, 2, unsigned> L;
+  llvm::PointerIntPair<const StackFrame *, 2, unsigned> S;
 
   llvm::PointerIntPair<const ProgramPointTag *, 2, unsigned> Tag;
 
   CFGBlock::ConstCFGElementRef ElemRef = {nullptr, 0};
 
 protected:
   ProgramPoint() = default;
-  ProgramPoint(const void *P, Kind k, const LocationContext *l,
+  ProgramPoint(const void *P, Kind k, const StackFrame *SF,
                const ProgramPointTag *tag = nullptr,
                CFGBlock::ConstCFGElementRef ElemRef = {nullptr, 0})
       : Data1(P), Data2(nullptr, (((unsigned)k) >> 0) & 0x3),
-        L(l, (((unsigned)k) >> 2) & 0x3), Tag(tag, (((unsigned)k) >> 4) & 0x3),
+        S(SF, (((unsigned)k) >> 2) & 0x3), Tag(tag, (((unsigned)k) >> 4) & 0x3),
         ElemRef(ElemRef) {
     assert(getKind() == k);
-    assert(getLocationContext() == l);
+    assert(getStackFrame() == SF);
     assert(getData1() == P);
   }
 
-  ProgramPoint(const void *P1, const void *P2, Kind k, const LocationContext *l,
+  ProgramPoint(const void *P1, const void *P2, Kind k, const StackFrame *SF,
                const ProgramPointTag *tag = nullptr,
                CFGBlock::ConstCFGElementRef ElemRef = {nullptr, 0})
       : Data1(P1), Data2(P2, (((unsigned)k) >> 0) & 0x3),
-        L(l, (((unsigned)k) >> 2) & 0x3), Tag(tag, (((unsigned)k) >> 4) & 0x3),
+        S(SF, (((unsigned)k) >> 2) & 0x3), Tag(tag, (((unsigned)k) >> 4) & 0x3),
----------------
steakhal wrote:

Why isn't the member called `SF` if we pass `SF`?

https://github.com/llvm/llvm-project/pull/198211


More information about the cfe-commits mailing list