[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 06:08:26 PDT 2025


================
@@ -46,7 +50,7 @@ class SymbolRegionValue : public SymbolData {
 
   friend class SymExprAllocator;
   SymbolRegionValue(SymbolID sym, const TypedValueRegion *r)
-      : SymbolData(SymbolRegionValueKind, sym), R(r) {
+      : SymbolData(ClassKind, sym), R(r) {
----------------
balazs-benics-sonarsource wrote:

I do depend on this, although it could be technically split from this PR.
I need to compile time check if a `T` is a subclass of `SymbolData`, thus I need a constexpr type-trait (`classof`).
If we have a `SymbolData` then the `acquire` can never hit max symbol complexity, thus we always return the type that was requested. Otherwise, we "complicate" a symbol which may return a substitute symbol instead of type `T`.

I'll try to split it from this PR.

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


More information about the cfe-commits mailing list