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
pub
frama-c
Commits
735ff34c
Commit
735ff34c
authored
Aug 21, 2019
by
Julien Signoles
Browse files
[typing] reimplement Typing.Datatype
parent
e20c54bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/e-acsl/typing.ml
View file @
735ff34c
...
...
@@ -56,27 +56,33 @@ module D =
let
reprs
=
[
Gmpz
;
Real
;
Nan
;
c_int
]
include
Datatype
.
Undefined
(* TODO RATIONAL: re-implement this datatype *)
(*
let
compare
ty1
ty2
=
match
ty1
,
ty2
with
|
C_type
i1
,
C_type
i2
->
if
i1
=
i2
then
0
else
if
Cil
.
intTypeIncluded
i1
i2
then
-
1
else
1
| (Other | C_type _), Gmp | Other, C_type _ -> -1
| Gmp, (C_type _ | Other) | C_type _, Other -> 1
| Gmp, Gmp | Other, Other -> 0
|
(
C_type
_
|
Gmpz
|
Real
)
,
Nan
|
(
C_type
_
|
Gmpz
)
,
Real
|
C_type
_
,
Gmpz
->
-
1
|
(
Gmpz
|
Real
|
Nan
)
,
C_type
_
|
(
Real
|
Nan
)
,
Gmpz
|
Nan
,
Real
->
1
|
Gmpz
,
Gmpz
|
Real
,
Real
|
Nan
,
Nan
->
0
let
equal
=
Datatype
.
from_compare
let
hash
=
function
| Gmp -> 787
| Other -> 1011
| C_type ik -> Hashtbl.hash ik
|
C_type
ik
->
7
*
Hashtbl
.
hash
ik
|
Gmpz
->
787
|
Real
->
1011
|
Nan
->
1277
let
pretty
fmt
=
function
| Gmp -> Format.pp_print_string fmt "GMP"
|
C_type
k
->
Printer
.
pp_ikind
fmt
k
| Other -> Format.pp_print_string fmt "OTHER"*)
|
Gmpz
->
Format
.
pp_print_string
fmt
"Gmpz"
|
Real
->
Format
.
pp_print_string
fmt
"Real"
|
Nan
->
Format
.
pp_print_string
fmt
"Nan"
end
)
(******************************************************************************)
...
...
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