Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
82520f64
Commit
82520f64
authored
9 months ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[region] useless named lv-region
parent
3eb276f8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/region/annot.ml
+6
-10
6 additions, 10 deletions
src/plugins/region/annot.ml
src/plugins/region/annot.mli
+0
-1
0 additions, 1 deletion
src/plugins/region/annot.mli
src/plugins/region/logic.ml
+1
-2
1 addition, 2 deletions
src/plugins/region/logic.ml
with
7 additions
and
13 deletions
src/plugins/region/annot.ml
+
6
−
10
View file @
82520f64
...
...
@@ -36,7 +36,6 @@ type path = {
and
step
=
|
Var
of
varinfo
|
Region
of
string
|
AddrOf
of
path
|
Star
of
path
|
Index
of
path
...
...
@@ -54,12 +53,11 @@ type region = {
(* -------------------------------------------------------------------------- *)
let
atomic
=
function
|
Var
_
|
Region
_
|
AddrOf
_
|
Star
_
|
Index
_
|
Field
_
->
true
|
Var
_
|
AddrOf
_
|
Star
_
|
Index
_
|
Field
_
->
true
|
Shift
_
|
Cast
_
->
false
let
rec
pp_step
fmt
=
function
|
Var
x
->
Varinfo
.
pretty
fmt
x
|
Region
a
->
Format
.
pp_print_string
fmt
a
|
Field
(
p
,
f
)
->
pfield
p
f
fmt
|
Index
a
->
Format
.
fprintf
fmt
"%a[..]"
pp_atom
a
|
Shift
a
->
Format
.
fprintf
fmt
"%a+(..)"
pp_atom
a
...
...
@@ -120,12 +118,10 @@ let getCompoundType env ~loc typ =
|
TComp
(
comp
,_
)
->
comp
|
_
->
error
env
~
loc
"Expected compound type for term"
let
parse_name
(
env
:
env
)
~
loc
x
=
try
match
env
.
context
.
find_var
x
with
|
{
lv_origin
=
Some
v
}
->
{
loc
;
typ
=
v
.
vtype
;
step
=
Var
v
}
|
_
->
error
env
~
loc
"Variable '%s' is not a C-variable"
x
with
Not_found
->
{
loc
;
typ
=
TVoid
[]
;
step
=
Region
x
}
let
parse_variable
(
env
:
env
)
~
loc
x
=
match
env
.
context
.
find_var
x
with
|
{
lv_origin
=
Some
v
}
->
{
loc
;
typ
=
v
.
vtype
;
step
=
Var
v
}
|
_
->
error
env
~
loc
"Variable '%s' is not a C-variable"
x
let
parse_field
env
~
loc
comp
f
=
try
List
.
find
(
fun
fd
->
fd
.
fname
=
f
)
(
Option
.
value
~
default
:
[]
comp
.
cfields
)
...
...
@@ -149,7 +145,7 @@ let parse_typ env ~loc t =
let
rec
parse_lpath
(
env
:
env
)
(
e
:
lexpr
)
=
let
loc
=
e
.
lexpr_loc
in
match
e
.
lexpr_node
with
|
PLvar
x
->
parse_
nam
e
env
~
loc
x
|
PLvar
x
->
parse_
variabl
e
env
~
loc
x
|
PLunop
(
Ustar
,
p
)
->
let
lv
=
parse_lpath
env
p
in
if
Cil
.
isPointerType
lv
.
typ
then
...
...
This diff is collapsed.
Click to expand it.
src/plugins/region/annot.mli
+
0
−
1
View file @
82520f64
...
...
@@ -30,7 +30,6 @@ type path = {
and
step
=
|
Var
of
varinfo
|
Region
of
string
|
AddrOf
of
path
|
Star
of
path
|
Index
of
path
...
...
This diff is collapsed.
Click to expand it.
src/plugins/region/logic.ml
+
1
−
2
View file @
82520f64
...
...
@@ -26,7 +26,6 @@ open Memory
let
rec
add_lval
(
m
:
map
)
(
p
:
path
)
:
node
=
match
p
.
step
with
|
Var
x
->
add_root
m
x
|
Region
a
->
add_label
m
a
|
Field
(
lv
,
fd
)
->
Memory
.
add_field
m
(
add_lval
m
lv
)
fd
|
Index
lv
->
Memory
.
add_index
m
(
add_lval
m
lv
)
lv
.
typ
|
Star
e
|
Cast
(
_
,
e
)
->
add_pointer
m
e
...
...
@@ -41,7 +40,7 @@ and add_pointer (m:map) (p:path): Memory.node =
and
add_exp
(
m
:
map
)
(
p
:
path
)
:
Memory
.
node
option
=
match
p
.
step
with
|
(
Var
_
|
Field
_
|
Index
_
|
Star
_
|
Cast
_
|
Region
_
)
->
|
(
Var
_
|
Field
_
|
Index
_
|
Star
_
|
Cast
_
)
->
let
r
=
add_lval
m
p
in
add_value
m
r
p
.
typ
|
AddrOf
p
->
Some
(
add_lval
m
p
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment