summary refs log tree commit diff stats
path: root/compiler/lowerings.nim
Commit message (Collapse)AuthorAgeFilesLines
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-9/+9
| | | | | | | | | | | | | | | | | | | * reworked ID handling * the packed AST now has its own ID mechanism * basic serialization code works * extract rodfiles to its own module * rodfiles: store and compare configs * rodfiles: store dependencies * store config at the end * precise dependency tracking * dependency tracking for rodfiles * completed loading of PSym, PType, etc * removed dead code * bugfix: do not realloc seqs when taking addr into an element * make IC opt-in for now * makes tcompilerapi green again * final cleanups Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
* fix #15463 (#15831)flywind2020-11-051-0/+1
|
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-29/+32
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* fixes #15076 (#15329)Andreas Rumpf2020-09-151-1/+1
|
* Expand hoisted default params in sem (#15270)Clyybber2020-09-051-11/+0
| | | | | | | | | * Expand hoisted default params in sem Introduce ast.newTree{I,IT} Add test for default params in procs * Cleanup * Simplify hoist transformation and expand test
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-1/+1
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* Step2: fixes #13781, fixes #13805 (#13897)cooldome2020-04-161-0/+7
| | | | | | | | | * Fix sym owner in wrapper proc * threadpool changes * revert lowerings * add newFastMoveStmt * try fixing test by switching to cpp Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes #13708 (#13711)cooldome2020-03-211-2/+2
| | | | | | * fixes #13708 * differentiate between arc and rest of GC Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes #13368 (#13397)cooldome2020-02-141-2/+3
|
* make case-object transitions explicit, make unknownLineInfo a const, replace ↵Jasper Jenkins2020-01-171-1/+1
| | | | a few magic numbers with consts (#13170)
* Sink to MemMove optimization in injectdestructors (#13002)cooldome2020-01-021-2/+8
|
* fixes #12989 (#12992)cooldome2019-12-311-1/+0
| | | | | | | * fixes #12989 * Revert "remove unwanted changes" This reverts commit 501829732a8e44deef2d815c303859efbe452cb5.
* Revert "fixes #12989"Andrii Riabushenko2019-12-311-0/+1
| | | | This reverts commit 928c2fee06bd11a0901c5f563b4953788be76ae6.
* fixes #12989Andrii Riabushenko2019-12-311-1/+0
|
* ARC: fixes cycle detection and move the .cursor attribute into closures (#12872)Andreas Rumpf2019-12-111-0/+1
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-76/+76
| | | | | | | | | | | | | | | | | | * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
* ARC: ported the GC tests over to --gc:arcAraq2019-11-261-0/+1
|
* Revert "ARC: another critical bugfix; temporary tuples we introduce for ↵narimiran2019-11-241-1/+0
| | | | | | tuple unpackaging are not owning the data" This reverts commit 8b2f8f5430e8c328efe5bce94e397f15e3c501af.
* ARC: another critical bugfix; temporary tuples we introduce for tuple ↵Araq2019-11-221-0/+1
| | | | unpackaging are not owning the data
* more arc improvements (#12690)Andreas Rumpf2019-11-201-0/+8
| | | | | * ARC: bugfix for =destroy for inherited objects * added code useful for debugging
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-5/+5
| | | | | * Remove sonsLen * Use Indexable
* Support iterators returning lent T (#11938)cooldome2019-08-311-2/+2
| | | | | | | * lent iterators * rebase tests * update changelog * fix comments, more tests
* int128 on firstOrd, lastOrd and lengthOrd (#11701)Arne Döring2019-08-071-2/+2
| | | | * fixes #11847
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-1/+0
|
* [refactoring] moves transformation for 'spawn' into its own spawn.nim ↵Araq2019-07-141-428/+15
| | | | implementation
* fixes #7057Andreas Rumpf2019-07-061-1/+1
|
* [bugfix] owned closures (#11544)Andreas Rumpf2019-06-201-0/+3
|
* fixes #11215Araq2019-05-121-2/+2
|
* rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227)Arne Döring2019-05-111-2/+2
|
* Replace countup(x, y-1) with x ..< yClyybber2019-05-071-2/+2
|
* added lowerings.evalOnceAraq2019-04-091-0/+16
|
* more destructor based changes (#10885)Andreas Rumpf2019-03-231-1/+1
| | | | | | | | | | | * mark user defined destructors with sfOverriden to simplify the logic * refactoring in preparation to merge liftings and generic instantiations for destructors * ast: introduce nkHiddenTryStmt for destructor generation in order to be able to optimize better the code later on * renamed 'patterns' switch to 'trmacros' as it was totally misleading before * destructors: introduce tfCheckedForDestructor flag in preparation of strict =destroy checking * test for invalid/too late destructor introductions * liftdestructors: make code robust for nimsuggest * --newruntime works for hello world again * newruntime: code generation for closures
* added lowerings.genLen helper procAndreas Rumpf2019-03-141-0/+9
|
* Tuple unpacking now works for `for` vars (#10152)Neelesh Chandola2019-02-231-6/+14
| | | | | | | | * Tuple unpacking now works for `for` vars * Give error if length of tuple vars != length of tuple * Fix error message showing wrong tuple length * unpacking now works now for mutable items * Update changelog
* Destructors: more moves for tuples (#9808)cooldome2018-11-271-1/+1
|
* Change the order of compilation passes, transformation is made lazy at code ↵cooldome2018-10-181-0/+2
| | | | | | | | | | | | | | | gen (#8489) * Ast no transformation * Add getImplNoTransform to the macros module * progress on delaying transf * Fix methods tranformation * Fix lazy lambdalifting * fix create thread wrapper * transform for lambda lifting * improve getImplTransformed * Fix destructor tests * try to fix nimprof for linux
* Field checks for everybody (#8957)LemonBoy2018-10-091-12/+18
| | | | | | | | | | | | | | | | | | | | | * Field checks for JS backend * Clean nkCall nodes with no arguments Generating a nkEmpty in place of no arguments makes no sense form the AST point of view and also trips up the VM codegen. * Field checks for VM backend * Test case for #6612 This patchset fixes #6612 * Add test case for LHS double evaluation * Prevent LHS double-eval for JS backend * Prevent double evaluation in VM backend
* allow referencing other parameters in default parameter valuesZahary Karadjov2018-06-161-0/+12
| | | | | | | | fix #7756 fix #1201 fix #7000 fix #3002 fix #1046
* refactoring: remove idents.legacy global variable and pass the IdentCache ↵Andreas Rumpf2018-05-271-37/+37
| | | | around explicitly
* remove more global variables in the Nim compilerAndreas Rumpf2018-05-271-1/+2
|
* platform.nim doesn't use globals anymore; prepare msgs.nim for not using globalsAndreas Rumpf2018-05-181-2/+2
|
* preparations of making compiler/msgs.nim free of global variablesAndreas Rumpf2018-05-171-1/+1
|
* remove ast.emptyNode global; cleanup configuration.nimAraq2018-05-161-9/+13
|
* options.nim: no global variables anymoreAndreas Rumpf2018-05-131-20/+24
|
* lambda lifting compiles againAndreas Rumpf2018-05-121-62/+62
|
* preparations for language extensions: 'sink' and 'lent' typesAndreas Rumpf2018-01-071-2/+2
|
* implemented undocumented '.liftLocals' featureAndreas Rumpf2017-11-021-2/+4
|
* deprecated unary '<'Andreas Rumpf2017-10-291-2/+2
|
* initial version of the new untested destructor passAndreas Rumpf2017-10-121-0/+11
|
* first implementation of the 'func' keywordAndreas Rumpf2017-09-231-1/+1
|
/a> ^
204dae92 ^













9e751bb8 ^

204dae92 ^

9e751bb8 ^







204dae92 ^





201458e3 ^
9e751bb8 ^
204dae92 ^







201458e3 ^
204dae92 ^




















201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^


201458e3 ^

204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^
201458e3 ^

204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^


201458e3 ^

204dae92 ^
201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^
201458e3 ^

204dae92 ^
201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^
201458e3 ^

204dae92 ^
201458e3 ^
204dae92 ^




201458e3 ^
204dae92 ^








201458e3 ^

204dae92 ^


201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^











201458e3 ^
204dae92 ^

201458e3 ^
9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^




201458e3 ^
204dae92 ^
9e751bb8 ^

204dae92 ^







fd7d8138 ^
204dae92 ^
9e751bb8 ^

204dae92 ^



201458e3 ^
9e751bb8 ^

204dae92 ^

201458e3 ^
598f1b53 ^
fd7d8138 ^

204dae92 ^





201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^

9e751bb8 ^
204dae92 ^

9e751bb8 ^
204dae92 ^

201458e3 ^
9e751bb8 ^

204dae92 ^



201458e3 ^
204dae92 ^


9e751bb8 ^


204dae92 ^

201458e3 ^
204dae92 ^


201458e3 ^





9e751bb8 ^
201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^








201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^








201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^








201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^

201458e3 ^
9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^



201458e3 ^
204dae92 ^
9e751bb8 ^

204dae92 ^


9e751bb8 ^

204dae92 ^









9e751bb8 ^

204dae92 ^



201458e3 ^
9e751bb8 ^

204dae92 ^
201458e3 ^
fd7d8138 ^
204dae92 ^



201458e3 ^
9e751bb8 ^

204dae92 ^





201458e3 ^
204dae92 ^









201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^









201458e3 ^
204dae92 ^


201458e3 ^
204dae92 ^




201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^

201458e3 ^
9e751bb8 ^

204dae92 ^



9e751bb8 ^

204dae92 ^







9e751bb8 ^

204dae92 ^

201458e3 ^
204dae92 ^





201458e3 ^
204dae92 ^

672e3e50 ^


a654e4ec ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714