Skip to content

Commit 06f67f0

Browse files
committed
use existing convention for primitives
1 parent 0b889ec commit 06f67f0

File tree

11 files changed

+26
-26
lines changed

11 files changed

+26
-26
lines changed

compiler/core/lam_analysis.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ let rec no_side_effects (lam : Lam.t) : bool =
5959
(* bool primitives *)
6060
| Psequand | Psequor | Pnot | Pboolcomp _ | Pboolorder | Pboolmin | Pboolmax
6161
(* int primitives *)
62-
| Pnegint | Paddint | Psubint | Pmulint | Ppowint | P_bitnot_int | Pandint
62+
| Pnegint | Paddint | Psubint | Pmulint | Ppowint | Pnotint | Pandint
6363
| Porint | Pxorint | Plslint | Plsrint | Pasrint | Pintcomp _ | Pintorder
6464
| Pintmin | Pintmax
6565
(* float primitives *)
@@ -68,8 +68,8 @@ let rec no_side_effects (lam : Lam.t) : bool =
6868
| Pfloatmin | Pfloatmax
6969
(* bigint primitives *)
7070
| Pnegbigint | Paddbigint | Psubbigint | Pmulbigint | Ppowbigint
71-
| P_bitnot_bigint | Pandbigint | Porbigint | Pxorbigint | Plslbigint
72-
| Pasrbigint | Pbigintcomp _ | Pbigintorder | Pbigintmin | Pbigintmax
71+
| Pnotbigint | Pandbigint | Porbigint | Pxorbigint | Plslbigint | Pasrbigint
72+
| Pbigintcomp _ | Pbigintorder | Pbigintmin | Pbigintmax
7373
(* string primitives *)
7474
| Pstringlength | Pstringrefu | Pstringrefs | Pstringcomp _ | Pstringorder
7575
| Pstringmin | Pstringmax

compiler/core/lam_compile_primitive.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,11 @@ let translate output_prefix loc (cxt : Lam_compile_context.t)
283283
match args with
284284
| [e1; e2] -> E.bigint_op Asr e1 e2
285285
| _ -> assert false)
286-
| P_bitnot_int -> (
286+
| Pnotint -> (
287287
match args with
288288
| [e] -> E.int_bnot e
289289
| _ -> assert false)
290-
| P_bitnot_bigint -> (
290+
| Pnotbigint -> (
291291
match args with
292292
| [e] -> E.int_bnot e
293293
| _ -> assert false)

compiler/core/lam_convert.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t =
253253
| Pandint -> prim ~primitive:Pandint ~args loc
254254
| Porint -> prim ~primitive:Porint ~args loc
255255
| Pxorint -> prim ~primitive:Pxorint ~args loc
256-
| P_bitnot_int -> prim ~primitive:P_bitnot_int ~args loc
256+
| Pnotint -> prim ~primitive:Pnotint ~args loc
257257
| Plslint -> prim ~primitive:Plslint ~args loc
258258
| Plsrint -> prim ~primitive:Plsrint ~args loc
259259
| Pasrint -> prim ~primitive:Pasrint ~args loc
@@ -297,7 +297,7 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t =
297297
| Pandbigint -> prim ~primitive:Pandbigint ~args loc
298298
| Porbigint -> prim ~primitive:Porbigint ~args loc
299299
| Pxorbigint -> prim ~primitive:Pxorbigint ~args loc
300-
| P_bitnot_bigint -> prim ~primitive:P_bitnot_bigint ~args loc
300+
| Pnotbigint -> prim ~primitive:Pnotbigint ~args loc
301301
| Plslbigint -> prim ~primitive:Plslbigint ~args loc
302302
| Pasrbigint -> prim ~primitive:Pasrbigint ~args loc
303303
| Pbigintcomp x -> prim ~primitive:(Pbigintcomp x) ~args loc

compiler/core/lam_primitive.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type t =
7777
| Pandint
7878
| Porint
7979
| Pxorint
80-
| P_bitnot_int
80+
| Pnotint
8181
| Plslint
8282
| Plsrint
8383
| Pasrint
@@ -112,7 +112,7 @@ type t =
112112
| Pandbigint
113113
| Porbigint
114114
| Pxorbigint
115-
| P_bitnot_bigint
115+
| Pnotbigint
116116
| Plslbigint
117117
| Pasrbigint
118118
| Pbigintcomp of Lam_compat.comparison
@@ -203,15 +203,15 @@ let eq_primitive_approx (lhs : t) (rhs : t) =
203203
| Psequand | Psequor | Pnot | Pboolcomp _ | Pboolorder | Pboolmin | Pboolmax
204204
(* int primitives *)
205205
| Pisint | Pnegint | Paddint | Psubint | Pmulint | Pdivint | Pmodint | Ppowint
206-
| P_bitnot_int | Pandint | Porint | Pxorint | Plslint | Plsrint | Pasrint
206+
| Pnotint | Pandint | Porint | Pxorint | Plslint | Plsrint | Pasrint
207207
| Pintorder | Pintmin | Pintmax
208208
(* float primitives *)
209209
| Pintoffloat | Pfloatofint | Pnegfloat | Paddfloat | Psubfloat | Pmulfloat
210210
| Pdivfloat | Pmodfloat | Ppowfloat | Pfloatorder | Pfloatmin | Pfloatmax
211211
(* bigint primitives *)
212212
| Pnegbigint | Paddbigint | Psubbigint | Pmulbigint | Pdivbigint | Pmodbigint
213-
| Ppowbigint | P_bitnot_bigint | Pandbigint | Porbigint | Pxorbigint
214-
| Plslbigint | Pasrbigint | Pbigintorder | Pbigintmin | Pbigintmax
213+
| Ppowbigint | Pnotbigint | Pandbigint | Porbigint | Pxorbigint | Plslbigint
214+
| Pasrbigint | Pbigintorder | Pbigintmin | Pbigintmax
215215
(* string primitives *)
216216
| Pstringlength | Pstringrefu | Pstringrefs | Pstringadd | Pstringcomp _
217217
| Pstringorder | Pstringmin | Pstringmax

compiler/core/lam_primitive.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type t =
7272
| Pandint
7373
| Porint
7474
| Pxorint
75-
| P_bitnot_int
75+
| Pnotint
7676
| Plslint
7777
| Plsrint
7878
| Pasrint
@@ -107,7 +107,7 @@ type t =
107107
| Pandbigint
108108
| Porbigint
109109
| Pxorbigint
110-
| P_bitnot_bigint
110+
| Pnotbigint
111111
| Plslbigint
112112
| Pasrbigint
113113
| Pbigintcomp of Lam_compat.comparison

compiler/core/lam_print.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ let primitive ppf (prim : Lam_primitive.t) =
119119
| Pandint -> fprintf ppf "and"
120120
| Porint -> fprintf ppf "or"
121121
| Pxorint -> fprintf ppf "xor"
122-
| P_bitnot_int -> fprintf ppf "~~"
122+
| Pnotint -> fprintf ppf "~~"
123123
| Plslint -> fprintf ppf "lsl"
124124
| Plsrint -> fprintf ppf "lsr"
125125
| Pasrint -> fprintf ppf "asr"
@@ -162,7 +162,7 @@ let primitive ppf (prim : Lam_primitive.t) =
162162
| Pandbigint -> fprintf ppf "and"
163163
| Porbigint -> fprintf ppf "or"
164164
| Pxorbigint -> fprintf ppf "xor"
165-
| P_bitnot_bigint -> fprintf ppf "~~"
165+
| Pnotbigint -> fprintf ppf "~~"
166166
| Plslbigint -> fprintf ppf "lsl"
167167
| Pasrbigint -> fprintf ppf "asr"
168168
| Pbigintcomp Ceq -> fprintf ppf "=="

compiler/ml/lambda.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ type primitive =
210210
| Pandint
211211
| Porint
212212
| Pxorint
213-
| P_bitnot_int
213+
| Pnotint
214214
| Plslint
215215
| Plsrint
216216
| Pasrint
@@ -246,7 +246,7 @@ type primitive =
246246
| Pandbigint
247247
| Porbigint
248248
| Pxorbigint
249-
| P_bitnot_bigint
249+
| Pnotbigint
250250
| Plslbigint
251251
| Pasrbigint
252252
| Pbigintcomp of comparison

compiler/ml/lambda.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ type primitive =
177177
| Pandint
178178
| Porint
179179
| Pxorint
180-
| P_bitnot_int
180+
| Pnotint
181181
| Plslint
182182
| Plsrint
183183
| Pasrint
@@ -213,7 +213,7 @@ type primitive =
213213
| Pandbigint
214214
| Porbigint
215215
| Pxorbigint
216-
| P_bitnot_bigint
216+
| Pnotbigint
217217
| Plslbigint
218218
| Pasrbigint
219219
| Pbigintcomp of comparison

compiler/ml/printlambda.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ let primitive ppf = function
152152
| Pandint -> fprintf ppf "and"
153153
| Porint -> fprintf ppf "or"
154154
| Pxorint -> fprintf ppf "xor"
155-
| P_bitnot_int -> fprintf ppf "~~"
155+
| Pnotint -> fprintf ppf "~~"
156156
| Plslint -> fprintf ppf "lsl"
157157
| Plsrint -> fprintf ppf "lsr"
158158
| Pasrint -> fprintf ppf "asr"
@@ -194,7 +194,7 @@ let primitive ppf = function
194194
| Pandbigint -> fprintf ppf "and"
195195
| Porbigint -> fprintf ppf "or"
196196
| Pxorbigint -> fprintf ppf "xor"
197-
| P_bitnot_bigint -> fprintf ppf "~~"
197+
| Pnotbigint -> fprintf ppf "~~"
198198
| Plslbigint -> fprintf ppf "lsl"
199199
| Pasrbigint -> fprintf ppf "asr"
200200
| Pdivbigint -> fprintf ppf "/"

compiler/ml/translcore.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ let primitives_table =
276276
("%mulint", Pmulint);
277277
("%divint", Pdivint);
278278
("%modint", Pmodint);
279-
("%bitnot_int", P_bitnot_int);
279+
("%bitnot_int", Pnotint);
280280
("%andint", Pandint);
281281
("%orint", Porint);
282282
("%xorint", Pxorint);
@@ -323,7 +323,7 @@ let primitives_table =
323323
("%lebigint", Pbigintcomp Cle);
324324
("%gtbigint", Pbigintcomp Cgt);
325325
("%gebigint", Pbigintcomp Cge);
326-
("%bitnot_bigint", P_bitnot_bigint);
326+
("%bitnot_bigint", Pnotbigint);
327327
("%andbigint", Pandbigint);
328328
("%orbigint", Porbigint);
329329
("%xorbigint", Pxorbigint);

compiler/ml/unified_ops.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ let entries =
213213
form = Unary;
214214
specialization =
215215
{
216-
int = P_bitnot_int;
216+
int = Pnotint;
217217
bool = None;
218218
float = None;
219-
bigint = Some P_bitnot_bigint;
219+
bigint = Some Pnotbigint;
220220
string = None;
221221
};
222222
};

0 commit comments

Comments
 (0)