summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
Commit message (Collapse)AuthorAgeFilesLines
* fix #14576 addr of param (including for lent) now works with nim js (#14577)Timothee Cour2020-06-061-0/+1
| | | | | * fix #14576 addr(param) now works in nim js * workaround https://github.com/nim-lang/Nim/issues/14578
* specialize genericReset (#14398)Andreas Rumpf2020-05-191-23/+23
| | | | | | | * progress * make tests green * maybe we also want to reset pointers, dunno * progress * cleanup; fixes #13879 [backport:1.2]
* 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
|