| FunCall (e1, args) ->
(match Ast_c.unwrap_expr e1 with
| Ident (ident) ->
-
(* recurse *)
args +> List.iter (fun (e,ii) ->
(* could typecheck if arguments agree with prototype *)
| DefineVar, _ ->
pr2 ("Type_annoter: not a macro-func: " ^ s);
Type_c.noTypeHere
+ | Undef, _ ->
+ pr2 ("Type_annoter: not a macro-func: " ^ s);
+ Type_c.noTypeHere
| DefineFunc _, _ ->
- (* normally the FunCall case should have catch it *)
+ (* normally the FunCall case should have caught it *)
pr2 ("Type_annoter: not a macro-func-expr: " ^ s);
Type_c.noTypeHere
)
(* normally the FunCall case should have catch it *)
pr2 ("Type_annoter: not a macro-var: " ^ s);
Type_c.noTypeHere
+ | Undef, _ ->
+ pr2 ("Type_annoter: not a expression: " ^ s);
+ Type_c.noTypeHere
)
| None ->
(match lookup_opt_env lookup_enum s with
add_binding (Macro (s, (defkind, defval) )) true;
- | Undef _
| PragmaAndCo _ -> ()
);
| Binary(e1,Logical(OrLog),e2) -> propagate_test e1; propagate_test e2
| Unary(e1,Not) -> propagate_test e1
| ParenExpr(e) -> propagate_test e
+ | FunCall(e,args) -> (* not very nice, but so painful otherwise *)
+ (match (unwrap e,args) with
+ ((Ident(i),_),[(Left a,_)]) ->
+ let nm = str_of_name i in
+ if List.mem nm ["likely";"unlikely"]
+ then propagate_test a
+ else ()
+ | _ -> ())
| _ -> () in
let bigf = { Visitor_c.default_visitor_c with