Skip to content

Commit 0dd98d4

Browse files
committed
CIL: update for Nov 27 goblint-cil opam update
1 parent ee95371 commit 0dd98d4

File tree

11 files changed

+35
-24
lines changed

11 files changed

+35
-24
lines changed

CodeHawk/CHB/bchcil/bCHCilToCBasic.ml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,16 @@ and cil_fieldinfo_to_bfieldinfo (f: GoblintCil.fieldinfo): bfieldinfo_t = {
200200
}
201201

202202

203-
and cil_eitem_to_beitem (i: (string * GoblintCil.exp * GoblintCil.location)): beitem_t =
204-
let (ename, eexp, eloc) = i in
205-
(ename, cil_exp_to_bexp eexp, cil_location_to_b_location eloc)
203+
and cil_eitem_to_beitem
204+
(i: (string
205+
* GoblintCil.attributes
206+
* GoblintCil.exp
207+
* GoblintCil.location)): beitem_t =
208+
let (ename, attrs, eexp, eloc) = i in
209+
(ename,
210+
cil_attributes_to_b_attributes attrs,
211+
cil_exp_to_bexp eexp,
212+
cil_location_to_b_location eloc)
206213

207214

208215
and cil_enuminfo_to_benuminfo (e: GoblintCil.enuminfo): benuminfo_t = {

CodeHawk/CHB/bchlib/bCHBCDictionary.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,16 +720,17 @@ object (self)
720720
}
721721

722722
method index_enumitem (eitem: beitem_t) =
723-
let (name, exp, loc) = eitem in
723+
let (name, attrs, exp, loc) = eitem in
724724
let tags = [name] in
725-
let args = [self#index_exp exp; self#index_location loc] in
725+
let args =
726+
[self#index_exp exp; self#index_location loc; self#index_attributes attrs] in
726727
enumitem_table#add (tags, args)
727728

728729
method get_enumitem (index: int): beitem_t =
729730
let (tags, args) = enumitem_table#retrieve index in
730731
let t = t "beitem_t" tags in
731732
let a = a "beitem_t" args in
732-
(t 0, self#get_exp (a 0), self#get_location (a 1))
733+
(t 0, self#get_attributes (a 2), self#get_exp (a 0), self#get_location (a 1))
733734

734735
method index_enuminfo (einfo: benuminfo_t) =
735736
let tags = [einfo.bename; ikind_mfts#ts einfo.bekind] in

CodeHawk/CHB/bchlib/bCHBCTypes.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ and bfieldinfo_t = {
246246
bfieldlayout: fieldlayout_t option
247247
}
248248

249-
and beitem_t = string * bexp_t * b_location_t
249+
and beitem_t = string * b_attributes_t * bexp_t * b_location_t
250250

251251
and benuminfo_t = {
252252
bename: string;

CodeHawk/CHC/cchcil/cHCilDeclarations.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ object (self)
175175
compinfo_table#add (tags, args)
176176

177177
method index_enumitem (eitem: enumitem) =
178-
let (name, exp, loc) = eitem in
178+
let (name, attrs, exp, loc) = eitem in
179179
let tags = [name] in
180180
let locix_r = self#index_location loc in
181181
match locix_r with
182182
| Ok locix ->
183-
let args = [cd#index_exp exp; locix] in
183+
let args = [cd#index_exp exp; locix; cd#index_attributes attrs] in
184184
enumitem_table#add (tags, args)
185185
| Error e ->
186186
begin

CodeHawk/CHC/cchcil/cHCilTypes.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ open CHTraceResult
3535
open CHXmlDocument
3636

3737
type funarg = string * typ * attributes
38-
type enumitem = string * exp * location
38+
type enumitem = string * attributes * exp * location
3939

4040
class type cildictionary_int =
4141
object

CodeHawk/CHC/cchcil/cHCilTypes.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ open CHXmlDocument
3636

3737

3838
type funarg = string * typ * attributes
39-
type enumitem = string * exp * location
39+
type enumitem = string * attributes * exp * location
4040

4141

4242
class type cildictionary_int =

CodeHawk/CHC/cchlib/cCHBasicTypes.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ and fieldinfo = {
157157
floc : location
158158
}
159159

160-
and eitem = string * exp * location
160+
and eitem = string * attributes * exp * location
161161

162162
and enuminfo = {
163163
ename : string ;

CodeHawk/CHC/cchlib/cCHDeclarations.ml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,20 @@ object (self)
237237
cattr = cd#get_attributes (a 2);
238238
cfields = List.map self#get_fieldinfo (get_list_suffix args 3) }
239239

240-
method index_enumitem (eitem:enumitem) =
241-
let (name,exp,loc) = eitem in
240+
method index_enumitem (eitem: enumitem) =
241+
let (name, attrs, exp, loc) = eitem in
242242
let tags = [name] in
243-
let args = [cd#index_exp exp; self#index_location loc] in
244-
enumitem_table#add (tags,args)
243+
let args = [
244+
cd#index_exp exp;
245+
self#index_location loc;
246+
cd#index_attributes attrs] in
247+
enumitem_table#add (tags, args)
245248

246249
method get_enumitem (index:int):enumitem =
247250
let (tags,args) = enumitem_table#retrieve index in
248251
let t = t "enumitem" tags in
249252
let a = a "enumitem" args in
250-
(t 0, cd#get_exp (a 0), self#get_location (a 1))
253+
(t 0, cd#get_attributes (a 2), cd#get_exp (a 0), self#get_location (a 1))
251254

252255
method index_enuminfo (einfo:enuminfo) =
253256
let tags = [einfo.ename; ikind_mfts#ts einfo.ekind] in

CodeHawk/CHC/cchlib/cCHLibTypes.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class type cdictionary_int =
186186

187187
(** {1 Declarations} *)
188188

189-
type enumitem = string * exp * location
189+
type enumitem = string * attributes * exp * location
190190

191191
class type cdeclarations_int =
192192
object

CodeHawk/CHC/cchlib/cCHTypesCompare.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ and exp_compare (e1:exp) (e2:exp) =
310310
l0
311311

312312

313-
and eitem_compare (eitem1:eitem) (eitem2:eitem) =
314-
let (iname1,iexp1,_) = eitem1 in
315-
let (iname2,iexp2,_) = eitem2 in
313+
and eitem_compare (eitem1: eitem) (eitem2: eitem) =
314+
let (iname1,_, iexp1, _) = eitem1 in
315+
let (iname2,_, iexp2, _) = eitem2 in
316316
let l0 = Stdlib.compare iname1 iname2 in
317317
if l0 = 0 then
318318
exp_compare iexp1 iexp2

0 commit comments

Comments
 (0)