[clang] [clang][dataflow] Add synthetic fields to `RecordStorageLocation` (PR #73860)

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 06:16:21 PST 2023


================
@@ -92,11 +96,39 @@ class DataflowAnalysisContext {
                               /*Logger=*/nullptr});
   ~DataflowAnalysisContext();
 
+  /// Sets a callback that returns the names and types of the synthetic fields
+  /// to add to a `RecordStorageLocation` of a given type.
+  /// Typically, this is called from the constructor of a `DataflowAnalysis`
+  ///
+  /// To maintain the invariant that all `RecordStorageLocation`s of a given
+  /// type have the same fields:
+  /// *  The callback must always return the same result for a given type
+  /// *  `setSyntheticFieldCallback()` must be called before any
+  //     `RecordStorageLocation`s are created.
----------------
ymand wrote:

Can this be integrated into the constructor? Could be in a followup patch (to minimize further churn in this one).

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


More information about the cfe-commits mailing list