From b93d6b5012809225e19b186f74819b80a002a19f Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Tue, 4 Oct 2016 03:16:03 -0700 Subject: [PATCH] [ocaml] Create base/ directory for code shared across analyzer and frontends Summary: Move most of common dependencies out of backend/ into base/ Diff doesn't change any code and hence files in base/ may still depend on code outside of base/. There will be followup diff cleaning those up. There are also files that maybe should be in common/ but haven't been moved there yet. Reviewed By: jberdine Differential Revision: D3950695 fbshipit-source-id: 00612b1 --- .gitignore | 2 +- infer/src/Makefile | 12 ++++++------ infer/src/{backend => base}/CommandLineOption.ml | 0 infer/src/{backend => base}/CommandLineOption.mli | 0 infer/src/{backend/config.ml => base/Config.ml} | 0 infer/src/{backend/config.mli => base/Config.mli} | 0 infer/src/{backend => base}/DB.ml | 0 infer/src/{backend => base}/DB.mli | 0 infer/src/{backend/escape.ml => base/Escape.ml} | 0 infer/src/{backend/escape.mli => base/Escape.mli} | 0 infer/src/{backend/iList.ml => base/IList.ml} | 0 infer/src/{backend/iList.mli => base/IList.mli} | 0 infer/src/{backend/io_infer.ml => base/Io_infer.ml} | 0 .../src/{backend/io_infer.mli => base/Io_infer.mli} | 0 infer/src/{backend/latex.ml => base/Latex.ml} | 0 infer/src/{backend/latex.mli => base/Latex.mli} | 0 infer/src/{backend/logging.ml => base/Logging.ml} | 0 infer/src/{backend/logging.mli => base/Logging.mli} | 0 .../prettyPrintable.ml => base/PrettyPrintable.ml} | 0 .../prettyPrintable.mli => base/PrettyPrintable.mli} | 0 .../serialization.ml => base/Serialization.ml} | 0 .../serialization.mli => base/Serialization.mli} | 0 infer/src/{backend/utils.ml => base/Utils.ml} | 0 infer/src/{backend/utils.mli => base/Utils.mli} | 0 .../{backend/version.ml.in => base/Version.ml.in} | 0 infer/src/{backend/version.mli => base/Version.mli} | 0 infer/src/{backend/zipLib.ml => base/ZipLib.ml} | 0 infer/src/{backend/zipLib.mli => base/ZipLib.mli} | 0 28 files changed, 7 insertions(+), 7 deletions(-) rename infer/src/{backend => base}/CommandLineOption.ml (100%) rename infer/src/{backend => base}/CommandLineOption.mli (100%) rename infer/src/{backend/config.ml => base/Config.ml} (100%) rename infer/src/{backend/config.mli => base/Config.mli} (100%) rename infer/src/{backend => base}/DB.ml (100%) rename infer/src/{backend => base}/DB.mli (100%) rename infer/src/{backend/escape.ml => base/Escape.ml} (100%) rename infer/src/{backend/escape.mli => base/Escape.mli} (100%) rename infer/src/{backend/iList.ml => base/IList.ml} (100%) rename infer/src/{backend/iList.mli => base/IList.mli} (100%) rename infer/src/{backend/io_infer.ml => base/Io_infer.ml} (100%) rename infer/src/{backend/io_infer.mli => base/Io_infer.mli} (100%) rename infer/src/{backend/latex.ml => base/Latex.ml} (100%) rename infer/src/{backend/latex.mli => base/Latex.mli} (100%) rename infer/src/{backend/logging.ml => base/Logging.ml} (100%) rename infer/src/{backend/logging.mli => base/Logging.mli} (100%) rename infer/src/{backend/prettyPrintable.ml => base/PrettyPrintable.ml} (100%) rename infer/src/{backend/prettyPrintable.mli => base/PrettyPrintable.mli} (100%) rename infer/src/{backend/serialization.ml => base/Serialization.ml} (100%) rename infer/src/{backend/serialization.mli => base/Serialization.mli} (100%) rename infer/src/{backend/utils.ml => base/Utils.ml} (100%) rename infer/src/{backend/utils.mli => base/Utils.mli} (100%) rename infer/src/{backend/version.ml.in => base/Version.ml.in} (100%) rename infer/src/{backend/version.mli => base/Version.mli} (100%) rename infer/src/{backend/zipLib.ml => base/ZipLib.ml} (100%) rename infer/src/{backend/zipLib.mli => base/ZipLib.mli} (100%) diff --git a/.gitignore b/.gitignore index 3b781a1ea..769222f2d 100644 --- a/.gitignore +++ b/.gitignore @@ -74,7 +74,7 @@ buck-out/ /infer/bin/infer /infer/lib/infer /infer/bin/inferTraceBugs -/infer/src/backend/version.ml +/infer/src/base/Version.ml /infer/models/java/models/ /infer/models/java/models.jar /infer/lib/java/models.jar diff --git a/infer/src/Makefile b/infer/src/Makefile index 948027735..76bf0928b 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -133,7 +133,7 @@ else EXTRA_DEPS = opensource endif -DEPENDENCIES = IR backend checkers eradicate harness quandary $(EXTRA_DEPS) +DEPENDENCIES = IR backend base checkers eradicate harness quandary $(EXTRA_DEPS) # ocamlbuild command with options common to all build targets OCAMLBUILD_BASE = rebuild $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES)) @@ -333,8 +333,8 @@ ifneq ($(wildcard $(BUILD_DIR)/sanitize.sh),) $(BUILD_DIR)/sanitize.sh endif -version: backend/version.ml.in Makefile - TMPFILE=$$(mktemp backend/version.ml.tmp.XXXX); \ +version: base/Version.ml.in Makefile + TMPFILE=$$(mktemp base/Version.ml.tmp.XXXX); \ INFER_GIT_COMMIT=$$(git --work-tree=$(ROOT_DIR) --git-dir=$(ROOT_DIR)/.git rev-parse --short HEAD || printf "unknown"); \ INFER_GIT_BRANCH=$$(git --work-tree=$(ROOT_DIR) --git-dir=$(ROOT_DIR)/.git rev-parse --abbrev-ref HEAD || printf "unknown"); \ sed \ @@ -345,7 +345,7 @@ version: backend/version.ml.in Makefile -e "s|@INFER_GIT_COMMIT[@]|$$INFER_GIT_COMMIT|g" \ -e "s|@INFER_GIT_BRANCH[@]|$$INFER_GIT_BRANCH|g" \ $< > "$$TMPFILE"; \ - $(INSTALL) -m 644 -C "$$TMPFILE" backend/version.ml; \ + $(INSTALL) -m 644 -C "$$TMPFILE" base/Version.ml; \ rm -f "$$TMPFILE" $(BUILD_DIR): @@ -363,8 +363,8 @@ endif ifeq ($(BUILD_LLVM_ANALYZERS),yes) $(REMOVE) $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml endif - $(REMOVE) backend/version.ml - $(REMOVE) backend/version.ml.tmp.* + $(REMOVE) base/Version.ml + $(REMOVE) base/Version.ml.tmp.* $(REMOVE) backend/jsonbug_{j,t}.ml{,i} $(REMOVE) checkers/stacktree_{j,t}.ml{,i} $(REMOVE) $(INFER_BIN) $(INFERANALYZE_BIN) $(INFERPRINT_BIN) $(STATSAGGREGATOR_BIN) diff --git a/infer/src/backend/CommandLineOption.ml b/infer/src/base/CommandLineOption.ml similarity index 100% rename from infer/src/backend/CommandLineOption.ml rename to infer/src/base/CommandLineOption.ml diff --git a/infer/src/backend/CommandLineOption.mli b/infer/src/base/CommandLineOption.mli similarity index 100% rename from infer/src/backend/CommandLineOption.mli rename to infer/src/base/CommandLineOption.mli diff --git a/infer/src/backend/config.ml b/infer/src/base/Config.ml similarity index 100% rename from infer/src/backend/config.ml rename to infer/src/base/Config.ml diff --git a/infer/src/backend/config.mli b/infer/src/base/Config.mli similarity index 100% rename from infer/src/backend/config.mli rename to infer/src/base/Config.mli diff --git a/infer/src/backend/DB.ml b/infer/src/base/DB.ml similarity index 100% rename from infer/src/backend/DB.ml rename to infer/src/base/DB.ml diff --git a/infer/src/backend/DB.mli b/infer/src/base/DB.mli similarity index 100% rename from infer/src/backend/DB.mli rename to infer/src/base/DB.mli diff --git a/infer/src/backend/escape.ml b/infer/src/base/Escape.ml similarity index 100% rename from infer/src/backend/escape.ml rename to infer/src/base/Escape.ml diff --git a/infer/src/backend/escape.mli b/infer/src/base/Escape.mli similarity index 100% rename from infer/src/backend/escape.mli rename to infer/src/base/Escape.mli diff --git a/infer/src/backend/iList.ml b/infer/src/base/IList.ml similarity index 100% rename from infer/src/backend/iList.ml rename to infer/src/base/IList.ml diff --git a/infer/src/backend/iList.mli b/infer/src/base/IList.mli similarity index 100% rename from infer/src/backend/iList.mli rename to infer/src/base/IList.mli diff --git a/infer/src/backend/io_infer.ml b/infer/src/base/Io_infer.ml similarity index 100% rename from infer/src/backend/io_infer.ml rename to infer/src/base/Io_infer.ml diff --git a/infer/src/backend/io_infer.mli b/infer/src/base/Io_infer.mli similarity index 100% rename from infer/src/backend/io_infer.mli rename to infer/src/base/Io_infer.mli diff --git a/infer/src/backend/latex.ml b/infer/src/base/Latex.ml similarity index 100% rename from infer/src/backend/latex.ml rename to infer/src/base/Latex.ml diff --git a/infer/src/backend/latex.mli b/infer/src/base/Latex.mli similarity index 100% rename from infer/src/backend/latex.mli rename to infer/src/base/Latex.mli diff --git a/infer/src/backend/logging.ml b/infer/src/base/Logging.ml similarity index 100% rename from infer/src/backend/logging.ml rename to infer/src/base/Logging.ml diff --git a/infer/src/backend/logging.mli b/infer/src/base/Logging.mli similarity index 100% rename from infer/src/backend/logging.mli rename to infer/src/base/Logging.mli diff --git a/infer/src/backend/prettyPrintable.ml b/infer/src/base/PrettyPrintable.ml similarity index 100% rename from infer/src/backend/prettyPrintable.ml rename to infer/src/base/PrettyPrintable.ml diff --git a/infer/src/backend/prettyPrintable.mli b/infer/src/base/PrettyPrintable.mli similarity index 100% rename from infer/src/backend/prettyPrintable.mli rename to infer/src/base/PrettyPrintable.mli diff --git a/infer/src/backend/serialization.ml b/infer/src/base/Serialization.ml similarity index 100% rename from infer/src/backend/serialization.ml rename to infer/src/base/Serialization.ml diff --git a/infer/src/backend/serialization.mli b/infer/src/base/Serialization.mli similarity index 100% rename from infer/src/backend/serialization.mli rename to infer/src/base/Serialization.mli diff --git a/infer/src/backend/utils.ml b/infer/src/base/Utils.ml similarity index 100% rename from infer/src/backend/utils.ml rename to infer/src/base/Utils.ml diff --git a/infer/src/backend/utils.mli b/infer/src/base/Utils.mli similarity index 100% rename from infer/src/backend/utils.mli rename to infer/src/base/Utils.mli diff --git a/infer/src/backend/version.ml.in b/infer/src/base/Version.ml.in similarity index 100% rename from infer/src/backend/version.ml.in rename to infer/src/base/Version.ml.in diff --git a/infer/src/backend/version.mli b/infer/src/base/Version.mli similarity index 100% rename from infer/src/backend/version.mli rename to infer/src/base/Version.mli diff --git a/infer/src/backend/zipLib.ml b/infer/src/base/ZipLib.ml similarity index 100% rename from infer/src/backend/zipLib.ml rename to infer/src/base/ZipLib.ml diff --git a/infer/src/backend/zipLib.mli b/infer/src/base/ZipLib.mli similarity index 100% rename from infer/src/backend/zipLib.mli rename to infer/src/base/ZipLib.mli