[clang] [NFC] [analyzer] Factor out SymbolManager::get<*> (PR #121781)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 6 08:17:14 PST 2025


================
@@ -525,14 +527,14 @@ class SymbolManager {
 
   static bool canSymbolicate(QualType T);
 
-  /// Make a unique symbol for MemRegion R according to its kind.
-  const SymbolRegionValue* getRegionValueSymbol(const TypedValueRegion* R);
+  template <typename T, typename... Args> const T *get(Args &&...args);
----------------
NagyDonat wrote:

If somebody reads this generic declaration without any context, they won't see any connection to symbols. Perhaps it would be good to either rename `T` to something like `SymbolType` or add a brief comment to describe the role of this method.

:thinking: In fact, now that I write this, maybe it would be better to rename this method to "`make`" or something similar to highlight that it's a factory method that makes new symbol objects (as opposed to e.g. `ProgramState::get<>()` which queries an existing state trait object from the state).

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


More information about the cfe-commits mailing list