@@ -277,7 +277,6 @@ and typ =
277277
278278 | TBuiltin_va_list of attributes
279279 (* * This is the same as the gcc's type with the same name *)
280- | TDefault
281280
282281(* * Various kinds of integers *)
283282and ikind =
@@ -538,7 +537,6 @@ and exp =
538537 * It is not printed. Given an lval of type
539538 * [TArray(T)] produces an expression of type
540539 * [TPtr(T)]. *)
541- | Generic of exp * ((typ * exp) list )
542540
543541
544542(* * Literal constants *)
@@ -1528,7 +1526,6 @@ let rec typeAttrs = function
15281526 | TEnum (enum , a ) -> addAttributes enum.eattr a
15291527 | TFun (_ , _ , _ , a ) -> a
15301528 | TBuiltin_va_list a -> a
1531- | TDefault -> []
15321529
15331530
15341531let setTypeAttrs t a =
@@ -1543,7 +1540,6 @@ let setTypeAttrs t a =
15431540 | TEnum (enum , _ ) -> TEnum (enum, a)
15441541 | TFun (r , args , v , _ ) -> TFun (r,args,v,a)
15451542 | TBuiltin_va_list _ -> TBuiltin_va_list a
1546- | TDefault -> TDefault
15471543
15481544
15491545let typeAddAttributes a0 t =
@@ -1566,7 +1562,6 @@ begin
15661562 | TComp (comp , a ) -> TComp (comp, add a)
15671563 | TNamed (t , a ) -> TNamed (t, add a)
15681564 | TBuiltin_va_list a -> TBuiltin_va_list (add a)
1569- | TDefault -> TDefault
15701565end
15711566
15721567let typeRemoveAttributes (anl : string list ) t =
@@ -1582,7 +1577,6 @@ let typeRemoveAttributes (anl: string list) t =
15821577 | TComp (comp , a ) -> TComp (comp, drop a)
15831578 | TNamed (t , a ) -> TNamed (t, drop a)
15841579 | TBuiltin_va_list a -> TBuiltin_va_list (drop a)
1585- | TDefault -> TDefault
15861580
15871581let unrollType (t : typ ) : typ =
15881582 let rec withAttrs (al : attributes ) (t : typ ) : typ =
@@ -1863,7 +1857,6 @@ let getParenthLevel (e: exp) =
18631857
18641858 | Lval (Var _ , NoOffset) -> 0 (* Plain variables *)
18651859 | Const _ -> 0 (* Constants *)
1866- | Generic _ -> 0 (* TODO*)
18671860
18681861
18691862let getParenthLevelAttrParam (a : attrparam ) =
@@ -1960,14 +1953,6 @@ let rec typeOf (e: exp) : typ =
19601953 TArray (t ,_ , a ) -> TPtr (t, a)
19611954 | _ -> E. s (E. bug " typeOf: StartOf on a non-array" )
19621955 end
1963- | Generic (exp , lst ) ->
1964- let typeOfExp = typeOf exp in
1965- let rec findType lst =
1966- match lst with
1967- [] -> voidType
1968- | (t , e ) :: rest -> if t = typeOfExp then typeOf e else findType rest
1969- in
1970- findType lst
19711956
19721957and typeOfInit (i : init ) : typ =
19731958 match i with
@@ -2257,7 +2242,6 @@ let rec alignOf_int t =
22572242
22582243 | TFun _ as t -> raise (SizeOfError (" function" , t))
22592244 | TVoid _ as t -> raise (SizeOfError (" void" , t))
2260- | TDefault -> raise (SizeOfError (" default" , t))
22612245 in
22622246 match filterAttributes " aligned" (typeAttrs t) with
22632247 [] ->
@@ -2570,7 +2554,6 @@ and bitsSizeOf t =
25702554 0
25712555
25722556 | TFun _ -> raise (SizeOfError (" function" , t))
2573- | TDefault -> raise (SizeOfError (" default" , t))
25742557
25752558
25762559and addTrailing nrbits roundto =
@@ -2838,8 +2821,6 @@ let rec isConstant = function
28382821 | AddrOf (Mem e, off) | StartOf (Mem e, off)
28392822 -> isConstant e && isConstantOffset off
28402823 | AddrOfLabel _ -> true
2841- | Generic _ -> false (* TODO*)
2842-
28432824and isConstantOffset = function
28442825 NoOffset -> true
28452826 | Field (fi , off ) -> isConstantOffset off
@@ -3543,14 +3524,6 @@ class defaultCilPrinterClass : cilPrinter = object (self)
35433524
35443525 | StartOf (lv ) -> self#pLval () lv
35453526
3546- | Generic (e , lst ) ->
3547- let rec print_generic_exp l doc =
3548- match l with
3549- | [] -> doc
3550- | (t , e1 ) :: rest -> print_generic_exp rest (doc ++ text " , " ++ (self#pType None () t) ++ text " :" ++ self#pExp () e1)
3551- in
3552- text " _Generic(" ++ self#pExp () e ++ print_generic_exp lst nil ++ text " )"
3553-
35543527 (* Print an expression, given the precedence of the context in which it
35553528 * appears. *)
35563529 method private pExpPrec (contextprec : int ) () (e : exp ) =
@@ -4487,7 +4460,6 @@ class defaultCilPrinterClass : cilPrinter = object (self)
44874460 ++ self#pAttrs () a
44884461 ++ text " "
44894462 ++ name
4490- | TDefault -> text " default"
44914463
44924464
44934465 (* *** PRINTING ATTRIBUTES *********)
@@ -4823,7 +4795,6 @@ class plainCilPrinterClass =
48234795 end
48244796 | TBuiltin_va_list a ->
48254797 dprintf " TBuiltin_va_list(%a)" self#pAttrs a
4826- | TDefault -> dprintf " TDefault"
48274798
48284799
48294800 (* Some plain pretty-printers. Unlike the above these expose all the
@@ -4902,13 +4873,6 @@ class plainCilPrinterClass =
49024873 | StartOf lv -> dprintf " StartOf(%a)" self#pLval lv
49034874 | AddrOf (lv ) -> dprintf " AddrOf(%a)" self#pLval lv
49044875 | AddrOfLabel (sref ) -> dprintf " AddrOfLabel(%a)" self#pStmt ! sref
4905- | Generic (e , lst ) ->
4906- let rec print_generic_exp l doc =
4907- match l with
4908- | [] -> doc
4909- | (t , e1 ) :: rest -> print_generic_exp rest (doc ++ text " ," ++ (self#pType None () t) ++ text " :" ++ self#pExp () e1)
4910- in
4911- text " _Generic(" ++ self#pExp () e ++ text " ," ++ print_generic_exp lst nil
49124876
49134877
49144878
@@ -5422,8 +5386,6 @@ and childrenExp (vis: cilVisitor) (e: exp) : exp =
54225386 | StartOf lv ->
54235387 let lv' = vLval lv in
54245388 if lv' != lv then StartOf lv' else e
5425- | Generic (e , lst ) -> e (* TODO*)
5426-
54275389
54285390and visitCilInit (vis : cilVisitor ) (forglob : varinfo )
54295391 (atoff : offset ) (i : init ) : init =
@@ -6208,7 +6170,6 @@ let rec typeSigWithAttrs ?(ignoreSign=false) doattr t =
62086170 TSFun (typeSig rt, (Util. list_map_opt (fun (_ , atype , _ ) -> (typeSig atype)) args), isva, doattr a)
62096171 | TNamed (t , a ) -> typeSigAddAttrs (doattr a) (typeSig t.ttype)
62106172 | TBuiltin_va_list al -> TSBase (TBuiltin_va_list (doattr al))
6211- | TDefault -> TSBase (TDefault )
62126173
62136174let typeSig t =
62146175 typeSigWithAttrs (fun al -> al) t
0 commit comments