summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
Commit message (Collapse)AuthorAgeFilesLines
* Fix #14160 (#14161)Clyybber2020-04-301-1/+7
| | | | | * Fix #14160 * Add testcase
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-1/+1
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* forward type alignment information to seqs (#12430)Arne Döring2020-04-191-10/+10
|
* fix #13902 distinct uint64 type corruption on 32-bit with borrow (#13907) ↵Timothee Cour2020-04-081-1/+1
| | | | | | | [backport:1.2] * fix #13902 distinct uint64 type corruption on 32-bit with borrow Co-authored-by: Timothee Cour <timothee.cour2+lightsail@gmail.com>
* Fix typeSym.getImpl for ref types (#13752)zah2020-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | * Fix typeSym.getImpl for ref types * Fix a codegen issue affecting the test suite of nim-beacon-chain * Fix tests/stdlib/tjsonmacro To understand the fix better it may help to take a look at the history of the replaced code. The nil check that is removed in this commit was introduced in another fix that failed to identify the root cause of the issue - namely that we allow an object type to exist for which no ast is present: https://github.com/nim-lang/Nim/pull/9601/files The original intention of the code is more obvious here: https://github.com/nim-lang/Nim/pull/9538/files
* fixes #13744 (#13749)cooldome2020-03-251-0/+2
| | | | | | | * fixes #13744 * improve style Co-authored-by: cooldome <ariabushenko@gmail.ru>
* fixes #13698 (#13706)Andreas Rumpf2020-03-201-1/+3
|
* cycle breaker (#13593)Andreas Rumpf2020-03-191-16/+24
| | | | * cycle breaking as an alternative to cycle detection
* arc optimizations (#13325)Andreas Rumpf2020-03-181-0/+4
| | | | | * scope based destructors * handle 'or' and 'and' expressions properly, see the new test arc/tcontrolflow.nim * make this branch mergable, logic is disabled for now
* catchable defects (#13626)Andreas Rumpf2020-03-121-54/+72
| | | | | | | | | | * allow defects to be caught even for --exceptions:goto (WIP) * implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180 * new implementation for integer overflow checking * produce a warning if a user-defined exception type inherits from Exception directly * applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic' * fixes #13627 * don't inherit from Exception directly
* fixes #13240Araq2020-03-111-1/+8
|
* fix operators containing percent for VM usage (#13536)Arne Döring2020-03-111-2/+0
| | | | * fixes #13513 * merge tarithmetics in tarithm
* ARC hotfix; proper destruction of seqs and strings after a moveAraq2020-03-031-2/+2
|
* Remove dead magics (#13551)Arne Döring2020-03-031-31/+3
|
* Fixed codegen for constant cstring with --gc:arc (#13326)Ico Doornekamp2020-02-041-1/+1
| | | | | | * Fixed codegen for constant cstring with --gc:arc, fixes #13321 * Added test for #13321
* fix critical bug discovered by #11591 (#13290) [backport]Timothee Cour2020-01-291-1/+1
|
* ARC: optimize complete object constructors to use nimNewObjUninitAraq2020-01-261-10/+14
|
* Removed lib/system/allocators.nim. seqs_v2 and strs_v2 now uses ↵Ico Doornekamp2020-01-231-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | allocShared0. (#13190) * Cleanup, remove lib/system/allocators.nim. seqs_v2 and strs_v2 now use allocShared0 by default. * Fixed -d:useMalloc allocShared / reallocShared / deallocShared. These now use the alloc/dealloc/realloc implementation that also takes care of zeroing memory at realloc. * Removed debug printfs * Removed unpairedEnvAllocs() from tests/destructor/tnewruntime_misc * More mmdisp cleanups. The shared allocators do not need to zero memory or throw since the regular ones already do that * Introduced realloc0 and reallocShared0, these procs are now used by strs_v2 and seqs_v2. This also allowed the -d:useMalloc allocator to drop the extra header with allocation length. * Moved strs_v2/seqs_v2 'allocated' flag into 'cap' field * Added 'getAllocStats()' to get low level alloc/dealloc counters. Enable with -d:allocStats * *allocShared implementations for boehm and go allocators now depend on the proper *allocImpl procs
* Unexport even more symbols (#13214)alaviss2020-01-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * system/gc: don't export markStackAndRegisters * compiler/cgen: unexport internal symbols As these functions are Nim-specific walkaround against C's optimization schemes, they don't serve any purpose being exported. * compiler/cgen: don't export global var unless marked * compiler/ccgthreadvars: don't export threadvar unless marked * tests/dll/visibility: also check for exports This ensure that these changes don't break manual exports. * compiler/cgen: hide all variables created for constants * compiler/ccgtypes: don't export RTTI variables * compiler/ccgexprs: make all complex const static * nimbase.h: fix export for windows * compiler/cgen, ccgthreadvars: export variables correctly For C/C++ variables, `extern` means that the variable is defined in an another unit. Added a new N_LIB_EXPORT_VAR to correctly export variables.
* fixes #13195 (#13198)cooldome2020-01-201-2/+2
| | | | | | | | * fixes #13195 * extra fix * fix typo
* Revert "fixes #13195"Andrii Riabushenko2020-01-191-1/+2
| | | | This reverts commit cd7904f2b29e623998a1d32ee726d000f56fc5ce.
* revert last commitAndrii Riabushenko2020-01-191-2/+1
|
* more on arc codegen (#13178)cooldome2020-01-191-11/+44
| | | | | | | | | | | | * arc codegen for union type * add more tests * fix offsetof * fix tsizeof test * fix style
* fixes #13157Araq2020-01-171-3/+6
|
* make case-object transitions explicit, make unknownLineInfo a const, replace ↵Jasper Jenkins2020-01-171-6/+6
| | | | a few magic numbers with consts (#13170)
* Working towards arc codegen (#13153)cooldome2020-01-161-31/+39
| | | fixes #13029
* fixes #13105 (#13138)Andreas Rumpf2020-01-141-1/+1
|
* more arc features (#13098)Andreas Rumpf2020-01-101-1/+5
| | | | | * config update * ARC now supports 'repr' and 'new' with finalizers is supported
* fix enumtostr crash for enum-range (#13035)Jasper Jenkins2020-01-051-1/+1
|
* --exception:goto switch for deterministic exception handling (#12977)Andreas Rumpf2020-01-011-2/+5
| | | | | This implements "deterministic" exception handling for Nim based on goto instead of setjmp. This means raising an exception is much cheaper than in C++'s table based implementations. Supports hard realtime systems. Default for --gc:arc and the C target because it's generally a good idea and arc is all about deterministic behavior. Note: This implies that fatal runtime traps are not catchable anymore! This needs to be documented.
* fixes another regressionAraq2019-12-241-4/+11
|
* fixes a silly regressionAraq2019-12-241-1/+3
|
* a better bugfixAraq2019-12-241-30/+33
|
* fixes a regressionAraq2019-12-241-4/+4
|
* fixes #12826Araq2019-12-241-18/+33
|
* fixes #12899 (#12921)Andreas Rumpf2019-12-181-2/+4
| | | | | | * fixes #12899 * fixes regression: destroy global variables in reverse declaration order, closureleak test relies on it
* ARC: cycle detector (#12823)Andreas Rumpf2019-12-171-16/+26
| | | | | | | | | | | | | * first implementation of the =trace and =dispose hooks for the cycle collector * a cycle collector for ARC: progress * manual: the .acyclic pragma is a thing once again * gcbench: adaptations for --gc:arc * enable valgrind tests for the strutils tests * testament: better valgrind support * ARC refactoring: growable jumpstacks * ARC cycle detector: non-recursive algorithm * moved and renamed core/ files back to system/ * refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish
* better support for PROGMEM like annotations for lets/vars; fixes #12216 (#12799)Andreas Rumpf2019-12-051-36/+40
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-300/+298
| | | | | | | | | | | | | | | | | | * 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
* conversions to unsigned numbers are not checked anymore; implements /… ↵Andreas Rumpf2019-11-201-1/+2
| | | | | | | | (#12688) [backport] * conversions to unsigned numbers are not checked anymore; implements / fixes https://github.com/nim-lang/RFCs/issues/175 * change the spec yet again to be less consistent but to make more sense; updated the changelog
* --gc:destructors: simple closures workAndreas Rumpf2019-11-021-2/+0
|
* --gc:destructors now means Nim uses pure refcounting (#12557)Andreas Rumpf2019-10-301-1/+1
|
* refactoring: use the new strings and seqs when optSeqDestructors is activeAraq2019-10-201-20/+20
|
* refactoring: --newruntime consists of 3 different switchesAraq2019-10-201-5/+5
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-11/+11
| | | | | * Remove sonsLen * Use Indexable
* fixes a critical --gc:boehm regressionAndreas Rumpf2019-09-061-1/+3
|
* allows access to .compileTime vars at runtime (#12128)Andreas Rumpf2019-09-051-0/+3
|
* fix min/max for float numbers (#12068)Arne Döring2019-09-021-6/+1
|
* gc:destructors progressAraq2019-09-011-1/+1
|
ang/Nim/commit/tools/nimweb.nim?h=devel&id=f71eaf66be35b2f4e7c12ebbb16ec301564bb0ab'>f71eaf66b ^
69d4eb14b ^
00a4e19e8 ^
f71eaf66b ^
69d4eb14b ^
00a4e19e8 ^
c0f78ec01 ^




bab41babe ^



17ce01c3e ^
bab41babe ^
ddaedab83 ^
e792940f5 ^
ddaedab83 ^
67a30d837 ^
76c3b314d ^

ecae77995 ^
ed9d0809a ^
f9c93d23b ^


c0f78ec01 ^





f9c93d23b ^
c0f78ec01 ^
f9c93d23b ^
ddaedab83 ^
69d4eb14b ^
ddaedab83 ^



439aa2d04 ^
3f3dda5a7 ^
ddaedab83 ^
053309e60 ^
a5efe8492 ^
ddaedab83 ^


755225d0e ^

ddaedab83 ^

ddaedab83 ^


17ce01c3e ^
ddaedab83 ^

17ce01c3e ^































16381364c ^

17ce01c3e ^



















ddaedab83 ^


76c8d6164 ^


c0f78ec01 ^

76c8d6164 ^







7e0da3e8f ^
ddaedab83 ^
ecdf60450 ^

ddaedab83 ^
bab41babe ^




278c265c6 ^
bf165cb43 ^

bab41babe ^

bf165cb43 ^


bab41babe ^

278c265c6 ^
2ed784992 ^


baa77387d ^

c0f78ec01 ^
baa77387d ^
2ed784992 ^
1b56334c4 ^

ddaedab83 ^

278c265c6 ^


ddaedab83 ^
c0f78ec01 ^

278c265c6 ^

ddaedab83 ^
c0f78ec01 ^

278c265c6 ^

f35b51c68 ^
c0f78ec01 ^

278c265c6 ^


bab41babe ^
c0f78ec01 ^
ddaedab83 ^
581572b28 ^
ed9d0809a ^
053309e60 ^
7db3d97cf ^
053309e60 ^
6effe4553 ^
053309e60 ^
c0f78ec01 ^
053309e60 ^
6effe4553 ^

053309e60 ^
2e4447ca8 ^



053309e60 ^





fde74b709 ^
439aa2d04 ^
ddaedab83 ^
278c265c6 ^

c0f78ec01 ^

278c265c6 ^
bab41babe ^
ddaedab83 ^
515a5a444 ^
b992e0b05 ^
515a5a444 ^
d4e766c8d ^
b992e0b05 ^






d4e766c8d ^

b992e0b05 ^


515a5a444 ^














ecae77995 ^
515a5a444 ^








17ce01c3e ^
515a5a444 ^


adf34082f ^
515a5a444 ^



2e26734ea ^
515a5a444 ^







515a5a444 ^
b992e0b05 ^

515a5a444 ^
b992e0b05 ^
515a5a444 ^
2e26734ea ^
a3cf1cff5 ^
515a5a444 ^




16381364c ^
515a5a444 ^
b992e0b05 ^
515a5a444 ^



cf70fe629 ^













7982fc4f0 ^


cf70fe629 ^


e0f6d0cd1 ^
cf70fe629 ^



16381364c ^
76c8d6164 ^
16381364c ^
e0f6d0cd1 ^
c0f78ec01 ^
16381364c ^






c0f78ec01 ^
16381364c ^


e0f6d0cd1 ^
16381364c ^








e0f6d0cd1 ^

16381364c ^


6fa4809bd ^
439aa2d04 ^
e95f155af ^
f081ac0e5 ^
17ce01c3e ^
f081ac0e5 ^
ddaedab83 ^

515a5a444 ^
0cb3d3161 ^
e0f6d0cd1 ^
c0f78ec01 ^








6fa4809bd ^


c0f78ec01 ^
cd6668fa4 ^



c0f78ec01 ^
ddaedab83 ^
ecae77995 ^





c0f78ec01 ^

ecae77995 ^




ddaedab83 ^



76c3b314d ^

ed9d0809a ^

76c3b314d ^
ecae77995 ^
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