From e8fd648fe82e9d61c40a1e2c9e2a03add101d798 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Thu, 14 Jul 2016 03:50:13 -0700 Subject: [PATCH] Fix mod_dep for reason conversion, add mod_dep.pdf Summary: Generation of the module dependency graph was broken (all IR modules were omitted) by the reason conversion. Reviewed By: cristianoc Differential Revision: D3541395 fbshipit-source-id: e5af125 --- .gitignore | 1 + infer/src/Makefile | 12 +++++++++--- infer/src/backend/StatisticsToolbox.re | 2 ++ infer/src/backend/StatisticsToolbox.rei | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 96c53f1da..053d45431 100644 --- a/.gitignore +++ b/.gitignore @@ -120,3 +120,4 @@ infer/src/.project /dependencies/ocamldot/ocamldot /dependencies/ocamldot/ocamldot.ml /infer/src/mod_dep.dot +/infer/src/mod_dep.pdf diff --git a/infer/src/Makefile b/infer/src/Makefile index 2e26aa5b0..249b09bce 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -231,14 +231,19 @@ $(DEPENDENCIES_DIR)/ocamldot/ocamldot: roots:=Infer Inferanalyze CMain JMain Inferprint src_dirs:=$(shell find * -type d) -src_files:=$(shell find $(src_dirs) -regex '.*\.ml\(i\)*' -not -path facebook/scripts/eradicate_stats.ml) +ml_src_files:=$(shell find $(src_dirs) -regex '.*\.ml\(i\)*' -not -path facebook/scripts/eradicate_stats.ml) +re_src_files:=$(shell find $(src_dirs) -regex '.*\.re\(i\)*') inc_flags:=$(foreach dir,$(src_dirs),-I $(dir)) root_flags:=$(foreach root,$(roots),-r $(root)) -mod_dep.dot: $(DEPENDENCIES_DIR)/ocamldot/ocamldot $(src_files) - ocamldep.opt $(inc_flags) $(src_files) \ +mod_dep.dot: $(DEPENDENCIES_DIR)/ocamldot/ocamldot $(ml_src_files) $(re_src_files) + { ocamldep.opt $(inc_flags) -ml-synonym .re -mli-synonym .rei $(ml_src_files); \ + ocamldep.opt $(inc_flags) -ml-synonym .re -mli-synonym .rei -pp refmt $(re_src_files); } \ | $(DEPENDENCIES_DIR)/ocamldot/ocamldot -lr $(root_flags) \ > mod_dep.dot +mod_dep.pdf: mod_dep.dot + dot -Tpdf -o mod_dep.pdf mod_dep.dot + define gen_atdgen_rules # generate files using atdgen # parameters: @@ -326,6 +331,7 @@ endif $(REMOVE) $(CLANG_ATDGEN_STUBS) $(REMOVE) $(INFER_CLANG_FCP_MIRRORED_FILES) $(REMOVE) mod_dep.dot + $(REMOVE) mod_dep.pdf # convert to reason %.re : %.ml diff --git a/infer/src/backend/StatisticsToolbox.re b/infer/src/backend/StatisticsToolbox.re index b31fa18a2..404b705fa 100644 --- a/infer/src/backend/StatisticsToolbox.re +++ b/infer/src/backend/StatisticsToolbox.re @@ -10,6 +10,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +open! Utils; + type t = { sum: float, avg: float, diff --git a/infer/src/backend/StatisticsToolbox.rei b/infer/src/backend/StatisticsToolbox.rei index 316a9ea28..e2812b95c 100644 --- a/infer/src/backend/StatisticsToolbox.rei +++ b/infer/src/backend/StatisticsToolbox.rei @@ -10,6 +10,8 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +open! Utils; + type t; let to_json: t => Yojson.Basic.json;