Skip to content

Commit 45c612e

Browse files
Make match nicer
1 parent 4d05caf commit 45c612e

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/frontc/cabs2cil.ml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4248,25 +4248,17 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
42484248
* functions alone*)
42494249
let isSpecialBuiltin =
42504250
match f'' with
4251-
Lval (Var fv, NoOffset) ->
4252-
fv.vname = "__builtin_stdarg_start" ||
4253-
fv.vname = "__builtin_va_arg" ||
4254-
fv.vname = "__builtin_va_start" ||
4255-
fv.vname = "__builtin_expect" ||
4256-
fv.vname = "__builtin_next_arg" ||
4257-
fv.vname = "__builtin_tgmath"
4258-
| _ -> false
4251+
| Lval (Var {vname= ("__builtin_stdarg_start" | "__builtin_va_arg" | "__builtin_va_start" | "__builtin_expect" | "__builtin_next_arg" | "__builtin_tgmath"); _}, NoOffset) -> true
4252+
| _ -> false
42594253
in
42604254
let isBuiltinChooseExprOrTgmath =
42614255
match f'' with
4262-
Lval (Var fv, NoOffset) ->
4263-
fv.vname = "__builtin_choose_expr" || fv.vname = "__builtin_tgmath"
4264-
| _ -> false
4256+
| Lval (Var {vname= "__builtin_choose_expr" | "__builtin_tgmath"; _ }, NoOffset) -> true
4257+
| _ -> false
42654258
in
42664259
let isBuiltinNan =
42674260
match f'' with
4268-
| Lval (Var fv, NoOffset) -> fv.vname = "__builtin_nan" || fv.vname = "__builtin_nanf" ||
4269-
fv.vname = "__builtin_nanl" || fv.vname = "__builtin_nans" || fv.vname = "__builtin_nansf" || fv.vname = "__builtin_nansl"
4261+
| Lval (Var {vname= ("__builtin_nan" | "__builtin_nanf" | "__builtin_nanl" | "__builtin_nans" | "__builtin_nansf" | "__builtin_nansl"); _}, NoOffset) -> true
42704262
| _ -> false
42714263
in
42724264
if isBuiltinNan && asconst then

0 commit comments

Comments
 (0)