Skip to content

Set Flambda2 current compilation unit #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions middle_end/compilenv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ let reset ?packname name =
(Ident.create_persistent name)
(current_unit_linkage_name ())
in
Compilation_unit.set_current compilation_unit;
(* The Flambda 2 current compilation unit must be set separately
since a different set of types are used. *)
let module Compilation_unit = Flambda2_compilenv_deps.Compilation_unit in
let module Linkage_name = Flambda2_compilenv_deps.Linkage_name in
let compilation_unit =
Compilation_unit.create
(Ident.create_persistent name)
(Linkage_name.create (make_symbol ~unitname:current_unit.ui_symbol None))
in
Compilation_unit.set_current compilation_unit

let current_unit_infos () =
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ codegen_DIRS = parsing utils typing middle_end bytecomp lambda asmcomp
codegen_OCAMLFLAGS = $(addprefix -I $(TOPDIR)/, $(codegen_DIRS)) -w +40 -g

codegen_LIBS = $(addprefix $(COMPILERLIBSDIR)/,\
ocamlcommon flambda2_compilenv_deps flambda2_backend_intf flambda2 ocamloptcomp)
ocamlcommon flambda2_compilenv_deps flambda2_backend_impl flambda2 ocamloptcomp)

codegen_OBJECTS = $(addsuffix .cmo,\
parsecmmaux parsecmm lexcmm codegen_main)
Expand Down