Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cduce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cduce
cduce
Commits
36c302d1
Commit
36c302d1
authored
Oct 05, 2007
by
Pietro Abate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[r2004-06-28 09:02:17 by afrisch] MD5 checksum for dynlinked code
Original author: afrisch Date: 2004-06-28 09:02:17+00:00
parent
057c12c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
13 deletions
+32
-13
driver/librarian.ml
driver/librarian.ml
+7
-1
driver/librarian.mli
driver/librarian.mli
+4
-1
ocamliface/cdo2ml.ml
ocamliface/cdo2ml.ml
+13
-7
ocamliface/mlstub.ml
ocamliface/mlstub.ml
+2
-2
tests/ocaml/Makefile
tests/ocaml/Makefile
+6
-2
No files found.
driver/librarian.ml
View file @
36c302d1
...
...
@@ -226,7 +226,13 @@ let load_from_string id raw dig depend =
let
register_unit
id
raw
dig
depend
=
let
id
=
C
.
mk
(
Ident
.
U
.
mk
id
)
in
let
depend
=
List
.
map
(
fun
(
x
,
y
)
->
(
Ident
.
U
.
mk
x
,
y
))
depend
in
ignore
(
load_from_string
id
raw
dig
depend
)
ignore
(
load_from_string
id
raw
dig
depend
);
id
let
load_unit
id
dig
=
let
id
=
C
.
mk
(
Ident
.
U
.
mk
id
)
in
ignore
(
load_check
id
dig
);
id
let
rec
run
id
=
let
cu
=
find
id
in
...
...
driver/librarian.mli
View file @
36c302d1
...
...
@@ -11,7 +11,10 @@ val run: Types.CompUnit.t -> unit
val
import
:
Types
.
CompUnit
.
t
->
unit
val
import_check
:
Types
.
CompUnit
.
t
->
Digest
.
t
->
unit
val
import_from_string
:
Types
.
CompUnit
.
t
->
string
->
string
->
(
Ident
.
U
.
t
*
Digest
.
t
)
list
->
unit
val
register_unit
:
string
->
string
->
string
->
(
string
*
string
)
list
->
unit
val
register_unit
:
string
->
string
->
string
->
(
string
*
string
)
list
->
Types
.
CompUnit
.
t
val
load_unit
:
string
->
string
->
Types
.
CompUnit
.
t
val
import_and_run
:
Types
.
CompUnit
.
t
->
unit
val
save
:
string
->
Types
.
CompUnit
.
t
->
string
->
unit
...
...
ocamliface/cdo2ml.ml
View file @
36c302d1
...
...
@@ -37,13 +37,19 @@ let () =
|
Some
x
->
x
in
print_endline
"(* Automatically generated by cdo2ml.ml. Do no edit ! *)"
;
if
static
then
(
Printf
.
printf
"let () = CDuce_all.Librarian.register_unit %S %S %S ["
name
raw
digest
;
List
.
iter
(
fun
(
cu
,
chk
)
->
Printf
.
printf
"(%S,%S)"
cu
chk
)
depend
;
Printf
.
printf
"]
\n
"
;
);
if
static
then
(
Printf
.
printf
"let cu = CDuce_all.Librarian.register_unit %S %S %S ["
name
raw
digest
;
List
.
iter
(
fun
(
cu
,
chk
)
->
Printf
.
printf
"(%S,%S)"
cu
chk
)
depend
;
Printf
.
printf
"]
\n
"
)
else
(
Printf
.
printf
"let cu = CDuce_all.Librarian.load_unit %S %S
\n
"
name
digest
);
print_endline
prolog
;
let
code
=
List
.
map
(
fun
x
->
(
x
,
loc
))
code
in
...
...
ocamliface/mlstub.ml
View file @
36c302d1
...
...
@@ -3,7 +3,7 @@
(* TODO:
- optimizations: generate labels and atoms only once.
- MD5 checksum
-
embeded CDuce code in OCaml
-
translate record to open record on positive occurence
*)
...
...
@@ -454,7 +454,7 @@ let stub name ty_env c_env values =
[
<:
str_item
<
open
Cdml
>>;
<:
str_item
<
open
CDuce_all
>>;
<:
str_item
<
value
cu
=
Cdml
.
initialize
$
str
:
String
.
escaped
name
$
>>;
(* <:str_item< value cu = Cdml.initialize $str:String.escaped name$ >>; *)
<:
str_item
<
value
types
=
Librarian
.
registered_types
cu
>>;
<:
str_item
<
declare
$
list
:
exts
$
end
>>;
<:
str_item
<
Librarian
.
run
cu
>>
...
...
tests/ocaml/Makefile
View file @
36c302d1
# Do "make install_cdml" before running this test
STATIC
=
run
:
ocamlc
-c
a.mli
../../cduce
--compile
c.cd
../../cduce
--compile
a.cd
../../cdo2ml
-static
c.cdo
>
c.ml
../../cdo2ml
-static
a.cdo
>
a.ml
../../cdo2ml
$(STATIC)
c.cdo
>
c.ml
../../cdo2ml
$(STATIC)
a.cdo
>
a.ml
ocamlfind ocamlc
-package
cduce
-linkpkg
-o
a c.ml a.ml b.ml
ifeq
($(STATIC),-static)
rm
*
.cdo
endif
./a
clean
:
...
...
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