[clang] [llvm] [clang][ssaf] Rework TUSummaryBuilder::addEntity to take NamedDecl (PR #194448)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri May 1 04:20:03 PDT 2026


================
@@ -23,9 +25,15 @@ class TUSummaryBuilder {
 public:
   explicit TUSummaryBuilder(TUSummary &Summary) : Summary(Summary) {}
 
-  /// Add an entity to the summary and return its EntityId.
-  /// If the entity already exists, returns the existing ID (idempotent).
-  EntityId addEntity(const EntityName &E);
+  /// Creates EntityName from the Decl, registers the entity, and sets its
+  /// linkage atomically.
+  /// \returns the EntityId, or std::nullopt if EntityName creation fails.
+  std::optional<EntityId> addEntity(const NamedDecl *D);
----------------
steakhal wrote:

Got it. I think I applied this suggestion in ed265ed7c6b9906889a4b0e7374faac094dd1515
Please confirm that this is what you had in mind.

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


More information about the cfe-commits mailing list