Rename tezos_protocol_registerer.ml

This commit is contained in:
Grégoire Henry 2017-10-27 19:54:28 +02:00 committed by Benjamin Canou
parent 0afb67dd10
commit 2e477ebb26
8 changed files with 12 additions and 11 deletions

View File

@ -57,7 +57,7 @@ ${COMPILER_OBJS}: SOURCE_DIRECTORIES=${COMPILER_SOURCE_DIRECTORIES}
${COMPILER_OBJS}: TARGET="(compiler.cmxa)" ${COMPILER_OBJS}: TARGET="(compiler.cmxa)"
${COMPILER_OBJS}: OPENED_MODULES=${COMPILER_OPENED_MODULES} ${COMPILER_OBJS}: OPENED_MODULES=${COMPILER_OPENED_MODULES}
compiler/tezos_protocol_registerer.cmi: EXTRA_OCAMLFLAGS = -opaque compiler/registerer.cmi: EXTRA_OCAMLFLAGS = -opaque
.INTERMEDIATE: compiler/tezos_compiler_embedded_cmis.ml .INTERMEDIATE: compiler/tezos_compiler_embedded_cmis.ml
compiler/tezos_compiler_embedded_cmis.cmx: compiler/tezos_compiler_embedded_cmis.cmi compiler/tezos_compiler_embedded_cmis.cmx: compiler/tezos_compiler_embedded_cmis.cmi

View File

@ -152,20 +152,20 @@ $(shell ocamlfind query stdlib)/camlinternalFormatBasics.cmi: \
COMPILER_EMBEDDED_CMIS := \ COMPILER_EMBEDDED_CMIS := \
$(shell ocamlfind query stdlib)/camlinternalFormatBasics.cmi \ $(shell ocamlfind query stdlib)/camlinternalFormatBasics.cmi \
${PACKED_SIGS_V1}.cmi \ ${PACKED_SIGS_V1}.cmi \
compiler/tezos_protocol_registerer.cmi compiler/registerer.cmi
COMPILER_IMPLS := \ COMPILER_IMPLS := \
compiler_main.ml \ compiler_main.ml \
COMPILER_LIB_INTFS := \ COMPILER_LIB_INTFS := \
compiler/tezos_compiler_embedded_cmis.mli \ compiler/tezos_compiler_embedded_cmis.mli \
compiler/tezos_protocol_registerer.mli \ compiler/registerer.mli \
compiler/packer.mli \ compiler/packer.mli \
compiler/tezos_compiler.mli \ compiler/tezos_compiler.mli \
COMPILER_LIB_IMPLS := \ COMPILER_LIB_IMPLS := \
compiler/tezos_compiler_embedded_cmis.ml \ compiler/tezos_compiler_embedded_cmis.ml \
compiler/tezos_protocol_registerer.ml \ compiler/registerer.ml \
compiler/packer.ml \ compiler/packer.ml \
compiler/tezos_compiler.ml \ compiler/tezos_compiler.ml \

View File

@ -25,3 +25,4 @@ let get_exn hash = VersionTable.find versions hash
let get hash = let get hash =
try Some (get_exn hash) try Some (get_exn hash)
with Not_found -> None with Not_found -> None

View File

@ -115,7 +115,7 @@ let tezos_protocol_env =
let register_env = let register_env =
let open Tezos_compiler_embedded_cmis in let open Tezos_compiler_embedded_cmis in
[ [
"Tezos_protocol_registerer", tezos_protocol_registerer_cmi ; "registerer", registerer_cmi ;
] ]
@ -319,7 +319,7 @@ let main () =
create_file register_file create_file register_file
(Printf.sprintf (Printf.sprintf
"module Name = struct let name = %S end\n\ "module Name = struct let name = %S end\n\
\ let () = Tezos_protocol_registerer.register Name.name (module %s.Make)" \ let () = Registerer.register Name.name (module %s.Make)"
(Protocol_hash.to_b58check hash) (Protocol_hash.to_b58check hash)
functor_unit) ; functor_unit) ;
let register_object = compile_ml ~for_pack register_file in let register_object = compile_ml ~for_pack register_file in

View File

@ -9,4 +9,4 @@
val camlinternalFormatBasics_cmi: string val camlinternalFormatBasics_cmi: string
val tezos_protocol_environment_sigs_v1_cmi: string val tezos_protocol_environment_sigs_v1_cmi: string
val tezos_protocol_registerer_cmi: string val registerer_cmi: string

View File

@ -586,7 +586,7 @@ module Registred_protocol = struct
end end
let build_v1 hash = let build_v1 hash =
let (module F) = Tezos_protocol_registerer.get_exn hash in let (module F) = Registerer.get_exn hash in
let module Name = struct let module Name = struct
let name = Protocol_hash.to_b58check hash let name = Protocol_hash.to_b58check hash
end in end in
@ -605,7 +605,7 @@ module Registred_protocol = struct
VersionTable.create 20 VersionTable.create 20
let mem hash = let mem hash =
VersionTable.mem versions hash || Tezos_protocol_registerer.mem hash VersionTable.mem versions hash || Registerer.mem hash
let get_exn hash = let get_exn hash =
try VersionTable.find versions hash try VersionTable.find versions hash

View File

@ -101,11 +101,11 @@ let do_compile hash p =
Lwt.return false Lwt.return false
let compile hash p = let compile hash p =
if Tezos_protocol_registerer.mem hash then if Registerer.mem hash then
Lwt.return true Lwt.return true
else begin else begin
do_compile hash p >>= fun success -> do_compile hash p >>= fun success ->
let loaded = Tezos_protocol_registerer.mem hash in let loaded = Registerer.mem hash in
if success && not loaded then if success && not loaded then
log_error "Internal error while compiling %a" Protocol_hash.pp hash; log_error "Internal error while compiling %a" Protocol_hash.pp hash;
Lwt.return loaded Lwt.return loaded