Skip to content

Commit ddd59c1

Browse files
committed
Implement C11 generic Cabsvisit
1 parent a7cf7e4 commit ddd59c1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/frontc/cabsvisit.ml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,16 @@ and childrenExpression vis e =
538538
let b' = visitCabsBlock vis b in
539539
if b' != b then GNU_BODY b' else e
540540
| EXPR_PATTERN _ -> e
541-
| GENERIC _ -> e (*TODO*)
541+
| GENERIC (e, al) ->
542+
let e' = ve e in
543+
let al' = mapNoCopy (fun ((at, ae) as a) ->
544+
let at' = visitCabsSpecifier vis at in
545+
let ae' = ve ae in
546+
if at' != at || ae' != ae then (at', ae') else a
547+
) al
548+
in
549+
if e' != e || al' != al then GENERIC (e', al') else e
550+
542551

543552
and visitCabsInitExpression vis (ie: init_expression) : init_expression =
544553
doVisit vis vis#vinitexpr childrenInitExpression ie

0 commit comments

Comments
 (0)