Skip to content

Commit 542fc4d

Browse files
authored
Merge pull request #3976 from mtzguido/misc
Misc fixes
2 parents 6edb94e + 37b933c commit 542fc4d

File tree

7 files changed

+19
-33
lines changed

7 files changed

+19
-33
lines changed

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ $(FSTAR1_BARE_EXE): .bare1.src.touch .src.ml.touch $(MAYBEFORCE)
119119
CACHE_DIR=stage1/plugins.checked/ \
120120
OUTPUT_DIR=stage1/plugins.ml/ \
121121
CODEGEN=PluginNoLib \
122-
OTHERFLAGS="--ext __guts $(OTHERFLAGS)" \
123122
TAG=plugins \
124123
TOUCH=$@ \
125124
$(MAKE) -f mk/plugins.mk ocaml
@@ -200,7 +199,6 @@ $(FSTAR2_BARE_EXE): .bare2.src.touch .src.ml.touch $(MAYBEFORCE)
200199
CACHE_DIR=stage2/plugins.checked/ \
201200
OUTPUT_DIR=stage2/plugins.ml/ \
202201
CODEGEN=PluginNoLib \
203-
OTHERFLAGS="--ext __guts $(OTHERFLAGS)" \
204202
TAG=plugins \
205203
TOUCH=$@ \
206204
$(MAKE) -f mk/plugins.mk ocaml
@@ -305,14 +303,14 @@ endif
305303
touch $@
306304

307305
.install-stage1.touch: export FSTAR_LINK_LIBDIRS=$(LINK_OK)
308-
.install-stage1.touch: .stage1.src.touch
306+
.install-stage1.touch: .stage1.src.touch $(MAYBEFORCE)
309307
$(call bold_msg, "INSTALL", "STAGE 1")
310308
$(MAKE) -C stage1 install PREFIX=$(CURDIR)/stage1/out
311309
@# ^ pass PREFIX to make sure we don't get it from env
312310
touch $@
313311

314312
.install-stage2.touch: export FSTAR_LINK_LIBDIRS=$(LINK_OK)
315-
.install-stage2.touch: .stage2.src.touch
313+
.install-stage2.touch: .stage2.src.touch $(MAYBEFORCE)
316314
$(call bold_msg, "INSTALL", "STAGE 2")
317315
$(MAKE) -C stage2 install PREFIX=$(CURDIR)/stage2/out FSTAR_DUNE_RELEASE=1
318316
@# ^ pass PREFIX to make sure we don't get it from env

src/data/FStarC.HashMap.fst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module FStarC.HashMap
55
open FStarC
66
open FStarC.Effect
77
open FStarC.Class.Hashable
8-
module BU = FStarC.Util
98

109
let hashmap (k v : Type) : Tot Type0 =
1110
PIMap.t (k & v)

src/extraction/FStarC.Extraction.ML.UEnv.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ let no_fstar_stubs_ns (ns : list mlsymbol) : list mlsymbol =
267267
| "FStar"::"NormSteps"::rest when plug () ->
268268
"Fstarcompiler.FStarC"::"NormSteps"::rest
269269

270-
| "FStar"::"Stubs"::rest when plug_no_lib () && Options.Ext.enabled "__guts" -> "FStarC"::rest
270+
| "FStar"::"Stubs"::rest when plug_no_lib () -> "FStarC"::rest
271271

272272
(* These 3 modules are special, and are not in the guts. They live in src/ml/full and
273273
are visible at the ambient namespace when building the plugin lib. *)

src/fstar/FStarC.Hooks.fst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,13 @@ let lazy_chooser (k:Syntax.Syntax.lazy_kind) (i:Syntax.Syntax.lazyinfo) : Syntax
5454
| Syntax.Syntax.Lazy_embedding (_, t) -> Thunk.force t
5555
| Syntax.Syntax.Lazy_extension s -> FStarC.Syntax.Util.exp_string (Format.fmt1 "((extension %s))" s)
5656

57-
// This is called directly by the Javascript port (it doesn't call Main)
58-
let setup_hooks () =
59-
Syntax.DsEnv.ugly_sigelt_to_string_hook := show;
60-
Errors.set_parse_warn_error Parser.ParseIt.parse_warn_error;
61-
Syntax.Syntax.lazy_chooser := Some lazy_chooser;
62-
Syntax.Util.tts_f := Some show;
63-
Syntax.Util.ttd_f := Some Class.PP.pp;
64-
TypeChecker.Normalize.unembed_binder_knot := Some RE.e_binder;
65-
iter Tactics.Interpreter.register_tactic_primitive_step Tactics.V1.Primops.ops;
66-
iter Tactics.Interpreter.register_tactic_primitive_step Tactics.V2.Primops.ops;
67-
()
57+
let () =
58+
Syntax.DsEnv.ugly_sigelt_to_string_hook := show;
59+
Errors.set_parse_warn_error Parser.ParseIt.parse_warn_error;
60+
Syntax.Syntax.lazy_chooser := Some lazy_chooser;
61+
Syntax.Util.tts_f := Some show;
62+
Syntax.Util.ttd_f := Some Class.PP.pp;
63+
TypeChecker.Normalize.unembed_binder_knot := Some RE.e_binder;
64+
iter Tactics.Interpreter.register_tactic_primitive_step Tactics.V1.Primops.ops;
65+
iter Tactics.Interpreter.register_tactic_primitive_step Tactics.V2.Primops.ops;
66+
()

src/fstar/FStarC.Hooks.fsti

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
*)
1616
module FStarC.Hooks
1717

18-
open FStarC.Effect
19-
20-
(* This function sets ties some know between modules in the compiler source tree,
21-
enabling more recursion and breaking some dependencies.
22-
23-
This is called directly by the Javascript port (it doesn't call Main) and the ocaml tests. *)
24-
val setup_hooks () : unit
18+
(* This module sets ties some know between modules in the compiler source tree,
19+
enabling more recursion and breaking some dependencies. It does this via a
20+
top-level effect. You only need to import this module in order for this to
21+
happen. *)

src/fstar/FStarC.Main.fst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ open FStarC.CheckedFiles
2424
open FStarC.Universal
2525
open FStarC.Util
2626

27+
open FStarC.Hooks (* KEEP: we need this module for its top-level effect. *)
28+
2729
open FStarC.Class.Show
2830

2931
module E = FStarC.Errors
@@ -442,7 +444,6 @@ let handle_error e =
442444

443445
let main () =
444446
try
445-
Hooks.setup_hooks ();
446447
let _, time = Timing.record_ms go in
447448
if FStarC.Options.query_stats()
448449
then print2_error "TOTAL TIME %s ms: %s\n"

src/syntax/FStarC.Syntax.Syntax.fst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,6 @@ instance ord_ident : ord ident =
280280
instance ord_fv : ord lident =
281281
ord_instance_from_cmp (fun x y -> Order.order_from_int (order_fv x y))
282282

283-
let syn p k f = f k p
284-
let mk_fvs () = mk_ref None
285-
let mk_uvs () = mk_ref None
286-
287-
//let memo_no_uvs = mk_ref (Some no_uvs)
288-
//let memo_no_names = mk_ref (Some no_names)
289-
let list_of_freenames (fvs:freenames) = elems fvs
290-
291283
(* Constructors for each term form; NO HASH CONSING; just makes all the auxiliary data at each node *)
292284
let mk (t:'a) r = {
293285
n=t;

0 commit comments

Comments
 (0)