[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 2 03:55:04 PDT 2023


================
@@ -105,38 +86,25 @@ class SVal {
     return llvm::dyn_cast<T>(*this);
   }
 
-  unsigned getRawKind() const { return Kind; }
-  BaseKind getBaseKind() const { return (BaseKind) (Kind & BaseMask); }
-  unsigned getSubKind() const { return Kind >> BaseBits; }
+  SValKind getKind() const { return Kind; }
 
   // This method is required for using SVal in a FoldingSetNode.  It
   // extracts a unique signature for this SVal object.
   void Profile(llvm::FoldingSetNodeID &ID) const {
-    ID.AddInteger((unsigned) getRawKind());
+    ID.AddInteger((unsigned)getKind());
----------------
Endilll wrote:

I think recently introduced `llvm::to_underlying()` is a better fit here.

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


More information about the cfe-commits mailing list