================
@@ -91,15 +93,35 @@ class UnsafeBufferUsageEntitySummary final : public 
EntitySummary {
       : EntitySummary(), UnsafeBuffers(std::move(UnsafeBuffers)) {}
 
 public:
-  SummaryName getSummaryName() const override {
-    return SummaryName{"UnsafeBufferUsage"};
-  };
+  SummaryName getSummaryName() const override { return summaryName(); };
 
   bool operator==(const EntityPointerLevelSet &Other) const {
     return UnsafeBuffers == Other;
   }
 
+  bool operator==(const UnsafeBufferUsageEntitySummary &Other) const {
+    return UnsafeBuffers == Other.UnsafeBuffers;
+  }
+
   bool empty() const { return UnsafeBuffers.empty(); }
+
+  static llvm::json::Object
+  jsonSerializeFn(const EntitySummary &ES,
+                  JSONFormat::EntityIdToJSONFn EntityId2JSON);
+
+  static llvm::Expected<std::unique_ptr<EntitySummary>>
+  jsonDeserializeFn(const llvm::json::Object &Data, EntityIdTable &,
+                    JSONFormat::EntityIdFromJSONFn EntityIdFromJSON);
+
+  static SummaryName summaryName() { return SummaryName{"UnsafeBufferUsage"}; }
----------------
steakhal wrote:

I was scratching my head when I saw a call to this. For a moment, I thought the 
`summaryName()` is just the default ctor of `SummaryName`. - But that doesn't 
have a default ctor, so I was confused.
Then I realised that this actually starts with a lower-case letter, so it's a 
different function, at which point I could guess its implementation correctly. 
Nevertheless I was confused about that for a moment, but I think it might be 
actually a good pattern to follow.
No actions expected.

https://github.com/llvm/llvm-project/pull/187156
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to