Skip to content

Commit

Permalink
Revert "Merge pull request ocaml#10718 from voodoos/shapes"
Browse files Browse the repository at this point in the history
This reverts commit 2a11a0a.
  • Loading branch information
trefis committed Nov 23, 2021
1 parent 0f152a8 commit 1100ad4
Show file tree
Hide file tree
Showing 47 changed files with 589 additions and 2,601 deletions.
46 changes: 3 additions & 43 deletions .depend
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ typing/env.cmo : \
utils/warnings.cmi \
typing/types.cmi \
typing/subst.cmi \
typing/shape.cmi \
typing/predef.cmi \
typing/persistent_env.cmi \
typing/path.cmi \
Expand All @@ -599,7 +598,6 @@ typing/env.cmx : \
utils/warnings.cmx \
typing/types.cmx \
typing/subst.cmx \
typing/shape.cmx \
typing/predef.cmx \
typing/persistent_env.cmx \
typing/path.cmx \
Expand All @@ -621,7 +619,6 @@ typing/env.cmi : \
utils/warnings.cmi \
typing/types.cmi \
typing/subst.cmi \
typing/shape.cmi \
typing/path.cmi \
utils/misc.cmi \
parsing/longident.cmi \
Expand Down Expand Up @@ -748,7 +745,6 @@ typing/includemod.cmo : \
typing/types.cmi \
typing/typedtree.cmi \
typing/subst.cmi \
typing/shape.cmi \
typing/printtyp.cmi \
typing/primitive.cmi \
typing/predef.cmi \
Expand All @@ -771,7 +767,6 @@ typing/includemod.cmx : \
typing/types.cmx \
typing/typedtree.cmx \
typing/subst.cmx \
typing/shape.cmx \
typing/printtyp.cmx \
typing/primitive.cmx \
typing/predef.cmx \
Expand All @@ -793,7 +788,6 @@ typing/includemod.cmx : \
typing/includemod.cmi : \
typing/types.cmi \
typing/typedtree.cmi \
typing/shape.cmi \
typing/path.cmi \
parsing/longident.cmi \
parsing/location.cmi \
Expand Down Expand Up @@ -1160,22 +1154,6 @@ typing/rec_check.cmx : \
typing/rec_check.cmi : \
typing/typedtree.cmi \
typing/ident.cmi
typing/shape.cmo : \
typing/path.cmi \
utils/misc.cmi \
utils/identifiable.cmi \
typing/ident.cmi \
typing/shape.cmi
typing/shape.cmx : \
typing/path.cmx \
utils/misc.cmx \
utils/identifiable.cmx \
typing/ident.cmx \
typing/shape.cmi
typing/shape.cmi : \
typing/path.cmi \
utils/identifiable.cmi \
typing/ident.cmi
typing/signature_group.cmo : \
typing/types.cmi \
typing/ident.cmi \
Expand Down Expand Up @@ -1350,7 +1328,6 @@ typing/typecore.cmo : \
typing/typedtree.cmi \
typing/typedecl.cmi \
typing/subst.cmi \
typing/shape.cmi \
typing/rec_check.cmi \
typing/printtyp.cmi \
typing/printpat.cmi \
Expand Down Expand Up @@ -1382,7 +1359,6 @@ typing/typecore.cmx : \
typing/typedtree.cmx \
typing/typedecl.cmx \
typing/subst.cmx \
typing/shape.cmx \
typing/rec_check.cmx \
typing/printtyp.cmx \
typing/printpat.cmx \
Expand Down Expand Up @@ -1410,7 +1386,6 @@ typing/typecore.cmx : \
typing/typecore.cmi : \
typing/types.cmi \
typing/typedtree.cmi \
typing/shape.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
parsing/longident.cmi \
Expand Down Expand Up @@ -1615,7 +1590,6 @@ typing/typedecl_variance.cmi : \
parsing/asttypes.cmi
typing/typedtree.cmo : \
typing/types.cmi \
typing/shape.cmi \
typing/primitive.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
Expand All @@ -1627,7 +1601,6 @@ typing/typedtree.cmo : \
typing/typedtree.cmi
typing/typedtree.cmx : \
typing/types.cmx \
typing/shape.cmx \
typing/primitive.cmx \
typing/path.cmx \
parsing/parsetree.cmi \
Expand All @@ -1639,7 +1612,6 @@ typing/typedtree.cmx : \
typing/typedtree.cmi
typing/typedtree.cmi : \
typing/types.cmi \
typing/shape.cmi \
typing/primitive.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
Expand All @@ -1658,7 +1630,6 @@ typing/typemod.cmo : \
typing/typeclass.cmi \
typing/subst.cmi \
typing/signature_group.cmi \
typing/shape.cmi \
typing/printtyp.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
Expand Down Expand Up @@ -1693,7 +1664,6 @@ typing/typemod.cmx : \
typing/typeclass.cmx \
typing/subst.cmx \
typing/signature_group.cmx \
typing/shape.cmx \
typing/printtyp.cmx \
typing/path.cmx \
parsing/parsetree.cmi \
Expand Down Expand Up @@ -1722,7 +1692,6 @@ typing/typemod.cmi : \
typing/types.cmi \
typing/typedtree.cmi \
typing/typedecl.cmi \
typing/shape.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
parsing/longident.cmi \
Expand Down Expand Up @@ -1769,40 +1738,40 @@ typing/typeopt.cmi : \
typing/env.cmi
typing/types.cmo : \
typing/type_immediacy.cmi \
typing/shape.cmi \
typing/primitive.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/local_store.cmi \
utils/identifiable.cmi \
typing/ident.cmi \
utils/config.cmi \
parsing/asttypes.cmi \
typing/types.cmi
typing/types.cmx : \
typing/type_immediacy.cmx \
typing/shape.cmx \
typing/primitive.cmx \
typing/path.cmx \
parsing/parsetree.cmi \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
utils/local_store.cmx \
utils/identifiable.cmx \
typing/ident.cmx \
utils/config.cmx \
parsing/asttypes.cmi \
typing/types.cmi
typing/types.cmi : \
typing/type_immediacy.cmi \
typing/shape.cmi \
typing/primitive.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/identifiable.cmi \
typing/ident.cmi \
parsing/asttypes.cmi
typing/typetexp.cmo : \
Expand Down Expand Up @@ -3885,7 +3854,6 @@ file_formats/cmt_format.cmo : \
typing/types.cmi \
typing/typedtree.cmi \
typing/tast_mapper.cmi \
typing/shape.cmi \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
Expand All @@ -3899,7 +3867,6 @@ file_formats/cmt_format.cmx : \
typing/types.cmx \
typing/typedtree.cmx \
typing/tast_mapper.cmx \
typing/shape.cmx \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
Expand All @@ -3912,7 +3879,6 @@ file_formats/cmt_format.cmx : \
file_formats/cmt_format.cmi : \
typing/types.cmi \
typing/typedtree.cmi \
typing/shape.cmi \
utils/misc.cmi \
parsing/location.cmi \
typing/env.cmi \
Expand Down Expand Up @@ -5941,7 +5907,6 @@ driver/compile_common.cmo : \
typing/typemod.cmi \
typing/typedtree.cmi \
typing/typecore.cmi \
typing/shape.cmi \
utils/profile.cmi \
typing/printtyped.cmi \
typing/printtyp.cmi \
Expand All @@ -5962,7 +5927,6 @@ driver/compile_common.cmx : \
typing/typemod.cmx \
typing/typedtree.cmx \
typing/typecore.cmx \
typing/shape.cmx \
utils/profile.cmx \
typing/printtyped.cmx \
typing/printtyp.cmx \
Expand Down Expand Up @@ -6444,7 +6408,6 @@ toplevel/byte/topeval.cmo : \
toplevel/topcommon.cmi \
bytecomp/symtable.cmi \
lambda/simplif.cmi \
typing/shape.cmi \
typing/printtyped.cmi \
typing/printtyp.cmi \
lambda/printlambda.cmi \
Expand Down Expand Up @@ -6480,7 +6443,6 @@ toplevel/byte/topeval.cmx : \
toplevel/topcommon.cmx \
bytecomp/symtable.cmx \
lambda/simplif.cmx \
typing/shape.cmx \
typing/printtyped.cmx \
typing/printtyp.cmx \
lambda/printlambda.cmx \
Expand Down Expand Up @@ -6587,7 +6549,6 @@ toplevel/native/topeval.cmo : \
toplevel/native/tophooks.cmi \
toplevel/topcommon.cmi \
lambda/simplif.cmi \
typing/shape.cmi \
typing/printtyped.cmi \
typing/printtyp.cmi \
lambda/printlambda.cmi \
Expand Down Expand Up @@ -6619,7 +6580,6 @@ toplevel/native/topeval.cmx : \
toplevel/native/tophooks.cmx \
toplevel/topcommon.cmx \
lambda/simplif.cmx \
typing/shape.cmx \
typing/printtyped.cmx \
typing/printtyp.cmx \
lambda/printlambda.cmx \
Expand Down
5 changes: 0 additions & 5 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,6 @@ OCaml 4.14.0
(David Allsopp and Nathan Rebours, review by Louis Gesbert,
Nicolás Ojeda Bär and Gabriel Scherer)

- #10718: Add "Shape" information to the cmt files. Shapes are an abstraction of
modules that can be used by external tooling to perform definition-aware
operations. (Ulysse Gérard, Thomas Refis and Leo White, review by Florian
Angeletti)

### Build system:

- #10717: Simplify the installation of man pages
Expand Down
Binary file modified boot/ocamlc
Binary file not shown.
Binary file modified boot/ocamllex
Binary file not shown.
1 change: 0 additions & 1 deletion compilerlibs/Makefile.compilerlibs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ TYPING = \
typing/path.cmo \
typing/primitive.cmo \
typing/type_immediacy.cmo \
typing/shape.cmo \
typing/types.cmo \
typing/btype.cmo \
typing/oprint.cmo \
Expand Down
2 changes: 0 additions & 2 deletions driver/compile_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ let typecheck_impl i parsetree =
i.source_file i.output_prefix i.module_name i.env)
|> print_if i.ppf_dump Clflags.dump_typedtree
Printtyped.implementation_with_coercion
|> print_if i.ppf_dump Clflags.dump_shape
(fun fmt {Typedtree.shape; _} -> Shape.print fmt shape)

let implementation info ~backend =
Profile.record_call info.source_file @@ fun () ->
Expand Down
8 changes: 0 additions & 8 deletions driver/main_args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,6 @@ let mk_dtypedtree f =
"-dtypedtree", Arg.Unit f, " (undocumented)"
;;

let mk_dshape f =
"-dshape", Arg.Unit f, " (undocumented)"
;;

let mk_drawlambda f =
"-drawlambda", Arg.Unit f, " (undocumented)"
;;
Expand Down Expand Up @@ -957,7 +953,6 @@ module type Core_options = sig
val _dsource : unit -> unit
val _dparsetree : unit -> unit
val _dtypedtree : unit -> unit
val _dshape : unit -> unit
val _drawlambda : unit -> unit
val _dlambda : unit -> unit

Expand Down Expand Up @@ -1254,7 +1249,6 @@ struct
mk_dsource F._dsource;
mk_dparsetree F._dparsetree;
mk_dtypedtree F._dtypedtree;
mk_dshape F._dshape;
mk_drawlambda F._drawlambda;
mk_dlambda F._dlambda;
mk_dinstr F._dinstr;
Expand Down Expand Up @@ -1322,7 +1316,6 @@ struct
mk_dsource F._dsource;
mk_dparsetree F._dparsetree;
mk_dtypedtree F._dtypedtree;
mk_dshape F._dshape;
mk_drawlambda F._drawlambda;
mk_dlambda F._dlambda;
mk_dinstr F._dinstr;
Expand Down Expand Up @@ -1731,7 +1724,6 @@ module Default = struct
let _drawlambda = set dump_rawlambda
let _dsource = set dump_source
let _dtypedtree = set dump_typedtree
let _dshape = set dump_shape
let _dunique_ids = set unique_ids
let _dno_unique_ids = clear unique_ids
let _dlocations = set locations
Expand Down
1 change: 0 additions & 1 deletion driver/main_args.mli
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ module type Core_options = sig
val _dsource : unit -> unit
val _dparsetree : unit -> unit
val _dtypedtree : unit -> unit
val _dshape : unit -> unit
val _drawlambda : unit -> unit
val _dlambda : unit -> unit

Expand Down
2 changes: 1 addition & 1 deletion dune
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
asttypes parsetree

;; TYPING
ident path primitive shape types btype oprint subst predef datarepr
ident path primitive types btype oprint subst predef datarepr
cmi_format persistent_env env type_immediacy errortrace
typedtree printtyped ctype printtyp includeclass mtype envaux includecore
tast_iterator tast_mapper signature_group cmt_format untypeast
Expand Down
6 changes: 1 addition & 5 deletions file_formats/cmt_format.ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ type cmt_infos = {
cmt_imports : (string * Digest.t option) list;
cmt_interface_digest : Digest.t option;
cmt_use_summaries : bool;
cmt_uid_to_loc : Location.t Shape.Uid.Tbl.t;
cmt_impl_shape : Shape.t option; (* None for mli *)
}

type error =
Expand Down Expand Up @@ -164,7 +162,7 @@ let record_value_dependency vd1 vd2 =
if vd1.Types.val_loc <> vd2.Types.val_loc then
value_deps := (vd1, vd2) :: !value_deps

let save_cmt filename modname binary_annots sourcefile initial_env cmi shape =
let save_cmt filename modname binary_annots sourcefile initial_env cmi =
if !Clflags.binary_annotations && not !Clflags.print_types then begin
Misc.output_to_file_via_temporary
~mode:[Open_binary] filename
Expand All @@ -190,8 +188,6 @@ let save_cmt filename modname binary_annots sourcefile initial_env cmi shape =
cmt_imports = List.sort compare (Env.imports ());
cmt_interface_digest = this_crc;
cmt_use_summaries = need_to_clear_env;
cmt_uid_to_loc = Env.get_uid_to_loc_tbl ();
cmt_impl_shape = shape;
} in
output_cmt oc cmt)
end;
Expand Down
3 changes: 0 additions & 3 deletions file_formats/cmt_format.mli
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ type cmt_infos = {
cmt_imports : crcs;
cmt_interface_digest : Digest.t option;
cmt_use_summaries : bool;
cmt_uid_to_loc : Location.t Shape.Uid.Tbl.t;
cmt_impl_shape : Shape.t option; (* None for mli *)
}

type error =
Expand Down Expand Up @@ -96,7 +94,6 @@ val save_cmt :
string option -> (* source file *)
Env.t -> (* initial env *)
Cmi_format.cmi_infos option -> (* if a .cmi was generated *)
Shape.t option ->
unit

(* Miscellaneous functions *)
Expand Down
1 change: 0 additions & 1 deletion otherlibs/dynlink/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ COMPILERLIBS_SOURCES=\
typing/path.ml \
typing/primitive.ml \
typing/type_immediacy.ml \
typing/shape.ml \
typing/types.ml \
typing/btype.ml \
typing/subst.ml \
Expand Down

0 comments on commit 1100ad4

Please sign in to comment.