From a73d7be9a86b7bc445121c1d83f0ea52a2e3ce45 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Thu, 18 Feb 2016 16:31:15 -0800 Subject: [PATCH] Remove unused support for ocaml < 4.02 Summary:public Now use -safe-string and the Bytes module and bytes type. Reviewed By: jvillard Differential Revision: D2949369 fb-gh-sync-id: 58aa688 shipit-source-id: 58aa688 --- configure.ac | 7 ------- infer/src/Makefile.in | 11 +---------- infer/src/backend/DB.mli | 4 ++-- m4/ac_ocaml_check_native_bytes.m4 | 22 ---------------------- m4/ac_ocaml_check_safe_string.m4 | 20 -------------------- 5 files changed, 3 insertions(+), 61 deletions(-) delete mode 100644 m4/ac_ocaml_check_native_bytes.m4 delete mode 100644 m4/ac_ocaml_check_safe_string.m4 diff --git a/configure.ac b/configure.ac index 2922168f9..afc60e233 100644 --- a/configure.ac +++ b/configure.ac @@ -203,13 +203,6 @@ _ACEOF fi -AC_OCAML_CHECK_NATIVE_BYTES -AC_OCAMLC_CHECK_SAFE_STRING -if test "$OCAML_HAS_NATIVE_BYTES" = "no"; then - AC_ASSERT_OCAML_PKG([bytes]) -fi - - AC_CHECK_TOOL([ATDGEN], [atdgen], [no]) AC_ASSERT_PROG([atdgen], [$ATDGEN]) AC_SUBST([ATDGEN]) diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index 7800e0fd1..7117ec159 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -51,12 +51,6 @@ OCAML_INCLUDES = -I,$(EASYFORMAT_INCLUDE_DIR),-I,$(BINIOU_INCLUDE_DIR),-I,$(YOJS OCAML_LIBS = unix str atdgen extLib zip OCAML_MODS = easy_format bi_util bi_share bi_outbuf bi_inbuf bi_vint bi_io yojson ag_oj_run ag_ob_run ag_util -# backwards compatibility with OCaml version < 4.02.0 -ifeq (@OCAML_HAS_NATIVE_BYTES@,no) -OCAML_INCLUDES := $(OCAML_INCLUDES),-I,@OCAML_PKG_PATH_bytes@ -OCAML_LIBS += bytes -endif - OCAMLBUILD_ANNOT_OPTIONS = ifeq (@ENABLE_OCAML_ANNOT@,yes) OCAMLBUILD_ANNOT_OPTIONS = -cflags -annot @@ -78,6 +72,7 @@ OCAMLBUILD_OPTIONS = \ $(OCAMLBUILD_QUIET_OPTIONS) \ -classic-display \ -cflags -short-paths \ + -cflags -safe-string \ -cflags -principal \ -cflags -strict-formats \ -cflags -strict-sequence \ @@ -108,10 +103,6 @@ OCAMLBUILD_OPTIONS = \ $(addprefix -lib ,$(OCAML_LIBS)) \ $(addprefix -mod ,$(OCAML_MODS)) -ifeq (@OCAMLC_HAS_SAFE_STRING@,yes) -OCAMLBUILD_OPTIONS += -cflags -safe-string -endif - #### Backend declarations #### BACKEND_SOURCES = backend diff --git a/infer/src/backend/DB.mli b/infer/src/backend/DB.mli index ff305f204..9b1ad05f8 100644 --- a/infer/src/backend/DB.mli +++ b/infer/src/backend/DB.mli @@ -138,13 +138,13 @@ val find_source_dirs : unit -> source_dir list val create_dir : string -> unit (** Read a file using a lock to allow write attempts in parallel. *) -val read_file_with_lock : string -> string -> Bytes.t option +val read_file_with_lock : string -> string -> bytes option (** Update the file contents with the update function provided. If the directory does not exist, it is created. If the file does not exist, it is created, and update is given the empty string. A lock is used to allow write attempts in parallel. *) -val update_file_with_lock : string -> string -> (Bytes.t -> Bytes.t) -> unit +val update_file_with_lock : string -> string -> (bytes -> bytes) -> unit (** get the path of the global type environment (only used in Java) *) val global_tenv_fname : unit -> filename diff --git a/m4/ac_ocaml_check_native_bytes.m4 b/m4/ac_ocaml_check_native_bytes.m4 deleted file mode 100644 index 18b0966a9..000000000 --- a/m4/ac_ocaml_check_native_bytes.m4 +++ /dev/null @@ -1,22 +0,0 @@ -dnl Copyright (c) 2015 - present Facebook, Inc. -dnl All rights reserved. -dnl -dnl This source code is licensed under the BSD style license found in the -dnl LICENSE file in the root directory of this source tree. An additional grant -dnl of patent rights can be found in the PATENTS file in the same directory. - -AC_DEFUN([AC_OCAML_CHECK_NATIVE_BYTES], -[dnl - OCAML_HAS_NATIVE_BYTES=no - AC_MSG_CHECKING([if OCaml supports the native 'bytes' type]) - cat > conftest.ml <&5 2>&5 ; then - AC_MSG_RESULT([yes]) - OCAML_HAS_NATIVE_BYTES=yes - else - AC_MSG_RESULT([no]) - fi - AC_SUBST([OCAML_HAS_NATIVE_BYTES]) -]) diff --git a/m4/ac_ocaml_check_safe_string.m4 b/m4/ac_ocaml_check_safe_string.m4 deleted file mode 100644 index 712aa7000..000000000 --- a/m4/ac_ocaml_check_safe_string.m4 +++ /dev/null @@ -1,20 +0,0 @@ -dnl Copyright (c) 2015 - present Facebook, Inc. -dnl All rights reserved. -dnl -dnl This source code is licensed under the BSD style license found in the -dnl LICENSE file in the root directory of this source tree. An additional grant -dnl of patent rights can be found in the PATENTS file in the same directory. - -AC_DEFUN([AC_OCAMLC_CHECK_SAFE_STRING], -[dnl - OCAMLC_HAS_SAFE_STRING=no - AC_MSG_CHECKING([if $OCAMLC supports the '-safe-string' flag]) - printf "" > conftest.ml - if $OCAMLC -safe-string -c conftest.ml >&5 2>&5 ; then - AC_MSG_RESULT([yes]) - OCAMLC_HAS_SAFE_STRING=yes - else - AC_MSG_RESULT([no]) - fi - AC_SUBST([OCAMLC_HAS_SAFE_STRING]) -])