Skip to content
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

Extraction: reduce krml output unless -d/--debug #3528

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
48 changes: 31 additions & 17 deletions ocaml/fstar-lib/generated/FStar_Extraction_Krml.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/extraction/FStar.Extraction.Krml.fst
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,8 @@ let translate_type_decl' env ty: option decl =
Some (DTypeAbstractStruct name)
else if assumed then
let name = string_of_mlpath name in
BU.print1_warning "Not extracting type definition %s to KaRaMeL (assumed type)\n" name;
if Debug.any () then
BU.print1_warning "Not extracting type definition %s to KaRaMeL (assumed type)\n" name;
// JP: TODO: shall we be smarter here?
None
else
Expand Down Expand Up @@ -1381,7 +1382,8 @@ let translate_let' env flavor lb: option decl =
if List.length tvars = 0 then
Some (DExternal (translate_cc meta, translate_flags meta, name, translate_type env t0, arg_names))
else begin
BU.print1_warning "Not extracting %s to KaRaMeL (polymorphic assumes are not supported)\n" (Syntax.string_of_mlpath name);
if Debug.any () then
BU.print1_warning "Not extracting %s to KaRaMeL (polymorphic assumes are not supported)\n" (Syntax.string_of_mlpath name);
None
end

Expand All @@ -1405,7 +1407,7 @@ let translate_let' env flavor lb: option decl =
in
let name = env.module_name, name in
let i, eff, t = find_return_type E_PURE (List.length args) t0 in
if i > 0 then begin
if i > 0 && Debug.any () then begin
let msg = "function type annotation has less arrows than the \
number of arguments; please mark the return type abbreviation as \
inline_for_extraction" in
Expand Down Expand Up @@ -1509,7 +1511,8 @@ let translate_decl env d: list decl =
failwith "todo: translate_decl [MLM_Top]"

| MLM_Exn (m, _) ->
BU.print1_warning "Not extracting exception %s to KaRaMeL (exceptions unsupported)\n" m;
if Debug.any () then
BU.print1_warning "Not extracting exception %s to KaRaMeL (exceptions unsupported)\n" m;
[]

let translate_module uenv (m : mlpath & option (mlsig & mlmodule) & mllib) : file =
Expand Down
Loading