[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 13 08:21:08 PDT 2024


================
@@ -171,6 +174,17 @@ class MemRegion : public llvm::FoldingSetNode {
 
   Kind getKind() const { return kind; }
 
+  StringRef getKindStr() const {
+    switch (getKind()) {
+#define REGION(Id, Parent)                                                     \
+  case Id##Kind:                                                               \
+    return #Id;
+#include "clang/StaticAnalyzer/Core/PathSensitive/Regions.def"
----------------
steakhal wrote:

Please hoist this into a cpp file so that it's not gonna regress compile times due to header inclusions.

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


More information about the cfe-commits mailing list