Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
verimag
synchrone
lustre-v6
Commits
57c9211c
Commit
57c9211c
authored
Sep 22, 2021
by
erwan
Browse files
feat: add a --2c-include-ext-types that includes <module>_<node>_ext.h in <module>_<node>.h
parent
07ac0744
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/lv6MainArgs.ml
View file @
57c9211c
(* Time-stamp: <modified the
13
/0
7
/2021 (at 11:22) by Erwan Jahier> *)
(* Time-stamp: <modified the
22
/0
9
/2021 (at 11:22) by Erwan Jahier> *)
(*
Le manager d'argument adapt de celui de lutin, plus joli
N.B. solution un peu batarde : les options sont stockes, comme avant, dans Global,
...
...
@@ -40,6 +40,7 @@ type t = {
mutable
rif
:
bool
;
mutable
gen_ocaml
:
bool
;
mutable
launch_cc
:
bool
;
mutable
ext_types
:
bool
;
mutable
launch_exec
:
bool
;
mutable
precision
:
int
option
;
mutable
gen_lic
:
bool
;
...
...
@@ -127,6 +128,7 @@ let (make_opt : unit -> t) =
gen_ocaml
=
false
;
precision
=
None
;
launch_cc
=
false
;
ext_types
=
false
;
launch_exec
=
false
;
keep_aliases
=
false
;
gen_lic
=
false
;
...
...
@@ -421,6 +423,11 @@ let mkoptab (opt:t) : unit = (
global_opt
.
gen_c_inline_predef
<-
false
))
[
"Do not inline predef calls when generating C code"
]
;
mkopt
opt
~
doc_level
:
Advanced
[
"-2c-ext"
;
"--2c-include-ext-types"
]
(
Arg
.
Unit
(
fun
()
->
set_c_options
opt
;
opt
.
ext_types
<-
true
))
[
"Always include <module>_<node>_ext.h in <module>_<node>.h"
]
;
mkopt
opt
~
doc_level
:
Advanced
[
"-2cil"
;
"--2c-inline-loop"
]
(
Arg
.
Unit
(
fun
()
->
global_opt
.
soc2c_inline_loops
<-
true
;
set_c_options
opt
))
...
...
lib/lv6MainArgs.mli
View file @
57c9211c
(* Time-stamp: <modified the
13
/0
7
/2021 (at 11:
44
) by Erwan Jahier> *)
(* Time-stamp: <modified the
22
/0
9
/2021 (at 11:
18
) by Erwan Jahier> *)
type
enum_mode
=
AsInt
(* translate enums into int (for rif-friendlyness *)
...
...
@@ -45,6 +45,7 @@ type t = {
mutable
rif
:
bool
;
mutable
gen_ocaml
:
bool
;
mutable
launch_cc
:
bool
;
mutable
ext_types
:
bool
;
mutable
launch_exec
:
bool
;
mutable
precision
:
int
option
;
mutable
gen_lic
:
bool
;
...
...
lib/soc2c.ml
View file @
57c9211c
(* Time-stamp: <modified the
05
/0
7
/2021 (at 1
7:30
) by Erwan Jahier> *)
(* Time-stamp: <modified the
22
/0
9
/2021 (at 1
1:25
) by Erwan Jahier> *)
(* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *)
...
...
@@ -1047,7 +1047,8 @@ typedef float _float;
"
;
if
needs_hfile
then
puth
(
Printf
.
sprintf
"#include
\"
%s
\"\n
"
ext_hfile0
);
if
needs_hfile
||
args
.
Lv6MainArgs
.
ext_types
then
puth
(
Printf
.
sprintf
"#include
\"
%s
\"\n
"
ext_hfile0
);
puth
(
Printf
.
sprintf
"#ifndef _%s_H_FILE
\n
"
base0
);
puth
(
Printf
.
sprintf
"#define _%s_H_FILE
\n
"
base0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment