From d35a4f6f2e6ec7c74561b6ef2ee89ea22a63c081 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Fri, 11 Sep 2020 06:42:51 -0700 Subject: [PATCH] [debug] deterministically order procedures when printing Summary: So that it can be meaningfully used for diffing across infer versions, say. Reviewed By: martintrojer Differential Revision: D23648560 fbshipit-source-id: 98d634e37 --- infer/src/backend/Procedures.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/infer/src/backend/Procedures.ml b/infer/src/backend/Procedures.ml index 6776b2310..7f2e7badc 100644 --- a/infer/src/backend/Procedures.ml +++ b/infer/src/backend/Procedures.ml @@ -92,7 +92,16 @@ let pp_all ~filter ~proc_name:proc_name_cond ~attr_kind ~source_file:source_file (* we could also register this statement but it's typically used only once per run so just prepare it inside the function *) Sqlite3.prepare db - "SELECT proc_name, proc_uid, attr_kind, source_file, proc_attributes, cfg FROM procedures" + {| + SELECT + proc_name, + proc_uid, + attr_kind, + source_file, + proc_attributes, + cfg + FROM procedures ORDER BY proc_uid + |} |> Container.iter ~fold:(SqliteUtils.result_fold_rows db ~log:"print all procedures") ~f:(fun stmt -> let proc_name = Sqlite3.column stmt 0 |> Procname.SQLite.deserialize in