From 457837772b06afbdc4efa5f29fb746a813964e2e Mon Sep 17 00:00:00 2001 From: Jonathan Protzenko Date: Fri, 20 Dec 2024 05:42:52 -0800 Subject: [PATCH] Eliminate empty struct *definitions* --- lib/DataTypes.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/DataTypes.ml b/lib/DataTypes.ml index de945a44..72f9a176 100644 --- a/lib/DataTypes.ml +++ b/lib/DataTypes.ml @@ -1280,6 +1280,10 @@ let remove_empty_structs files = LidSet.empty end)#visit_files () files in + let files = List.map (fun (f, decls) -> + f, List.filter (fun d -> not (LidSet.mem (lid_of_decl d) empty_structs)) decls + ) files in + (object inherit [_] map as super