Skip to content

Commit e8cc254

Browse files
committed
adapt ir
1 parent d8d25e0 commit e8cc254

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

mypyc/test-data/irbuild-basic.test

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ def f(x):
622622
L0:
623623
r0 = __main__.globals :: static
624624
r1 = 'g'
625-
r2 = CPyDict_GetItem(r0, r1)
625+
r2 = CPyDict_GetItemUnsafe(r0, r1)
626626
r3 = box(int, x)
627627
r4 = [r3]
628628
r5 = load_address r4
@@ -637,7 +637,7 @@ L0:
637637
r13 = CPyTagged_Add(r7, r12)
638638
r14 = __main__.globals :: static
639639
r15 = 'two'
640-
r16 = CPyDict_GetItem(r14, r15)
640+
r16 = CPyDict_GetItemUnsafe(r14, r15)
641641
r17 = PyObject_Vectorcall(r16, 0, 0, 0)
642642
r18 = unbox(int, r17)
643643
r19 = CPyTagged_Add(r13, r18)
@@ -1147,7 +1147,7 @@ def call_python_function(x):
11471147
L0:
11481148
r0 = __main__.globals :: static
11491149
r1 = 'f'
1150-
r2 = CPyDict_GetItem(r0, r1)
1150+
r2 = CPyDict_GetItemUnsafe(r0, r1)
11511151
r3 = box(int, x)
11521152
r4 = [r3]
11531153
r5 = load_address r4
@@ -1165,7 +1165,7 @@ def return_callable_type():
11651165
L0:
11661166
r0 = __main__.globals :: static
11671167
r1 = 'return_float'
1168-
r2 = CPyDict_GetItem(r0, r1)
1168+
r2 = CPyDict_GetItemUnsafe(r0, r1)
11691169
return r2
11701170
def call_callable_type():
11711171
r0, f, r1 :: object
@@ -1436,7 +1436,7 @@ def f():
14361436
L0:
14371437
r0 = __main__.globals :: static
14381438
r1 = 'x'
1439-
r2 = CPyDict_GetItem(r0, r1)
1439+
r2 = CPyDict_GetItemUnsafe(r0, r1)
14401440
r3 = unbox(int, r2)
14411441
r4 = builtins :: module
14421442
r5 = 'print'
@@ -1680,7 +1680,7 @@ L0:
16801680
r0 = (2, 4, 6)
16811681
r1 = __main__.globals :: static
16821682
r2 = 'f'
1683-
r3 = CPyDict_GetItem(r1, r2)
1683+
r3 = CPyDict_GetItemUnsafe(r1, r2)
16841684
r4 = box(tuple[int, int, int], r0)
16851685
r5 = PyObject_CallObject(r3, r4)
16861686
r6 = unbox(tuple[int, int, int], r5)
@@ -1701,7 +1701,7 @@ L0:
17011701
r0 = (4, 6)
17021702
r1 = __main__.globals :: static
17031703
r2 = 'f'
1704-
r3 = CPyDict_GetItem(r1, r2)
1704+
r3 = CPyDict_GetItemUnsafe(r1, r2)
17051705
r4 = PyList_New(1)
17061706
r5 = object 1
17071707
r6 = list_items r4
@@ -1749,7 +1749,7 @@ L0:
17491749
r6 = CPyDict_Build(3, r0, r3, r1, r4, r2, r5)
17501750
r7 = __main__.globals :: static
17511751
r8 = 'f'
1752-
r9 = CPyDict_GetItem(r7, r8)
1752+
r9 = CPyDict_GetItemUnsafe(r7, r8)
17531753
r10 = CPyTuple_LoadEmptyTupleConstant()
17541754
r11 = PyDict_Copy(r6)
17551755
r12 = PyObject_Call(r9, r10, r11)
@@ -1776,7 +1776,7 @@ L0:
17761776
r4 = CPyDict_Build(2, r0, r2, r1, r3)
17771777
r5 = __main__.globals :: static
17781778
r6 = 'f'
1779-
r7 = CPyDict_GetItem(r5, r6)
1779+
r7 = CPyDict_GetItemUnsafe(r5, r6)
17801780
r8 = PyDict_New()
17811781
r9 = CPyDict_UpdateInDisplay(r8, r4)
17821782
r10 = r9 >= 0 :: signed
@@ -2239,7 +2239,7 @@ L2:
22392239
r19 = box(tuple[object, object], r18)
22402240
r20 = __main__.globals :: static
22412241
r21 = 'NamedTuple'
2242-
r22 = CPyDict_GetItem(r20, r21)
2242+
r22 = CPyDict_GetItemUnsafe(r20, r21)
22432243
r23 = [r9, r19]
22442244
r24 = load_address r23
22452245
r25 = PyObject_Vectorcall(r22, r24, 2, 0)
@@ -2251,7 +2251,7 @@ L2:
22512251
r30 = ''
22522252
r31 = __main__.globals :: static
22532253
r32 = 'Lol'
2254-
r33 = CPyDict_GetItem(r31, r32)
2254+
r33 = CPyDict_GetItemUnsafe(r31, r32)
22552255
r34 = object 1
22562256
r35 = [r34, r30]
22572257
r36 = load_address r35
@@ -2264,7 +2264,7 @@ L2:
22642264
r42 = r41 >= 0 :: signed
22652265
r43 = __main__.globals :: static
22662266
r44 = 'List'
2267-
r45 = CPyDict_GetItem(r43, r44)
2267+
r45 = CPyDict_GetItemUnsafe(r43, r44)
22682268
r46 = load_address PyLong_Type
22692269
r47 = PyObject_GetItem(r45, r46)
22702270
r48 = __main__.globals :: static
@@ -2277,7 +2277,7 @@ L2:
22772277
r55 = CPyDict_GetItem(r53, r54)
22782278
r56 = __main__.globals :: static
22792279
r57 = 'NewType'
2280-
r58 = CPyDict_GetItem(r56, r57)
2280+
r58 = CPyDict_GetItemUnsafe(r56, r57)
22812281
r59 = [r52, r55]
22822282
r60 = load_address r59
22832283
r61 = PyObject_Vectorcall(r58, r60, 2, 0)
@@ -2610,14 +2610,14 @@ L0:
26102610
r1.__mypyc_env__ = r0; r2 = is_error
26112611
r3 = __main__.globals :: static
26122612
r4 = 'b'
2613-
r5 = CPyDict_GetItem(r3, r4)
2613+
r5 = CPyDict_GetItemUnsafe(r3, r4)
26142614
r6 = [r1]
26152615
r7 = load_address r6
26162616
r8 = PyObject_Vectorcall(r5, r7, 1, 0)
26172617
keep_alive r1
26182618
r9 = __main__.globals :: static
26192619
r10 = 'a'
2620-
r11 = CPyDict_GetItem(r9, r10)
2620+
r11 = CPyDict_GetItemUnsafe(r9, r10)
26212621
r12 = [r8]
26222622
r13 = load_address r12
26232623
r14 = PyObject_Vectorcall(r11, r13, 1, 0)
@@ -2681,17 +2681,17 @@ L2:
26812681
typing = r8 :: module
26822682
r9 = __main__.globals :: static
26832683
r10 = 'c'
2684-
r11 = CPyDict_GetItem(r9, r10)
2684+
r11 = CPyDict_GetItemUnsafe(r9, r10)
26852685
r12 = __main__.globals :: static
26862686
r13 = 'b'
2687-
r14 = CPyDict_GetItem(r12, r13)
2687+
r14 = CPyDict_GetItemUnsafe(r12, r13)
26882688
r15 = [r11]
26892689
r16 = load_address r15
26902690
r17 = PyObject_Vectorcall(r14, r16, 1, 0)
26912691
keep_alive r11
26922692
r18 = __main__.globals :: static
26932693
r19 = 'a'
2694-
r20 = CPyDict_GetItem(r18, r19)
2694+
r20 = CPyDict_GetItemUnsafe(r18, r19)
26952695
r21 = [r17]
26962696
r22 = load_address r21
26972697
r23 = PyObject_Vectorcall(r20, r22, 1, 0)
@@ -3320,7 +3320,7 @@ L2:
33203320
r6 = 'dataclasses'
33213321
r7 = PyImport_GetModuleDict()
33223322
r8 = 'dataclasses'
3323-
r9 = CPyDict_GetItem(r7, r8)
3323+
r9 = CPyDict_GetItemUnsafe(r7, r8)
33243324
r10 = CPyDict_SetItem(r0, r6, r9)
33253325
r11 = r10 >= 0 :: signed
33263326
r12 = __main__.globals :: static
@@ -3336,7 +3336,7 @@ L4:
33363336
r18 = 'enum'
33373337
r19 = PyImport_GetModuleDict()
33383338
r20 = 'enum'
3339-
r21 = CPyDict_GetItem(r19, r20)
3339+
r21 = CPyDict_GetItemUnsafe(r19, r20)
33403340
r22 = CPyDict_SetItem(r12, r18, r21)
33413341
r23 = r22 >= 0 :: signed
33423342
return 1
@@ -3377,7 +3377,7 @@ L2:
33773377
r11 = r10 >= 0 :: signed
33783378
r12 = PyImport_GetModuleDict()
33793379
r13 = 'p'
3380-
r14 = CPyDict_GetItem(r12, r13)
3380+
r14 = CPyDict_GetItemUnsafe(r12, r13)
33813381
r15 = 'x'
33823382
r16 = CPyObject_GetAttr(r14, r15)
33833383
r17 = unbox(int, r16)

mypyc/test-data/irbuild-classes.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ L2:
282282
r13 = 'T'
283283
r14 = __main__.globals :: static
284284
r15 = 'TypeVar'
285-
r16 = CPyDict_GetItem(r14, r15)
285+
r16 = CPyDict_GetItemUnsafe(r14, r15)
286286
r17 = [r13]
287287
r18 = load_address r17
288288
r19 = PyObject_Vectorcall(r16, r18, 1, 0)
@@ -322,11 +322,11 @@ L2:
322322
r50 = __main__.S :: type
323323
r51 = __main__.globals :: static
324324
r52 = 'Generic'
325-
r53 = CPyDict_GetItem(r51, r52)
325+
r53 = CPyDict_GetItemUnsafe(r51, r52)
326326
r54 = __main__.globals :: static
327327
r55 = 'T'
328328
r56 = CPyDict_GetItem(r54, r55)
329-
r57 = PyObject_GetItem(r53, r56)
329+
r57 = PyObject_GetItemUnsafe(r53, r56)
330330
r58 = PyTuple_Pack(3, r49, r50, r57)
331331
r59 = '__main__'
332332
r60 = __main__.D_template :: type
@@ -1073,7 +1073,7 @@ L0:
10731073
__mypyc_self__.x = 20
10741074
r0 = __main__.globals :: static
10751075
r1 = 'LOL'
1076-
r2 = CPyDict_GetItem(r0, r1)
1076+
r2 = CPyDict_GetItemUnsafe(r0, r1)
10771077
r3 = cast(str, r2)
10781078
__mypyc_self__.y = r3
10791079
r4 = box(None, 1)

mypyc/test-data/irbuild-set.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ def not_precomputed_non_final_name(i):
661661
L0:
662662
r0 = __main__.globals :: static
663663
r1 = 'non_const'
664-
r2 = CPyDict_GetItem(r0, r1)
664+
r2 = CPyDict_GetItemUnsafe(r0, r1)
665665
r3 = unbox(int, r2)
666666
r4 = PySet_New(0)
667667
r5 = box(int, r3)
@@ -780,7 +780,7 @@ def not_precomputed():
780780
L0:
781781
r0 = __main__.globals :: static
782782
r1 = 'non_const'
783-
r2 = CPyDict_GetItem(r0, r1)
783+
r2 = CPyDict_GetItemUnsafe(r0, r1)
784784
r3 = unbox(int, r2)
785785
r4 = PySet_New(0)
786786
r5 = box(int, r3)

mypyc/test-data/irbuild-singledispatch.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def f(arg):
131131
L0:
132132
r0 = __main__.globals :: static
133133
r1 = 'f'
134-
r2 = CPyDict_GetItem(r0, r1)
134+
r2 = CPyDict_GetItemUnsafe(r0, r1)
135135
r3 = f_obj.__call__(r2, arg)
136136
return r3
137137
def g(arg):
@@ -262,7 +262,7 @@ def f(x):
262262
L0:
263263
r0 = __main__.globals :: static
264264
r1 = 'f'
265-
r2 = CPyDict_GetItem(r0, r1)
265+
r2 = CPyDict_GetItemUnsafe(r0, r1)
266266
r3 = f_obj.__call__(r2, x)
267267
return r3
268268
def test():

0 commit comments

Comments
 (0)