summary refs log tree commit diff stats
path: root/compiler/cgen.nim
Commit message (Collapse)AuthorAgeFilesLines
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-5/+6
| | | | | | | | | | | | | | | | | * 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)
* make cgen header consistent with jsgen header (#15682)Timothee Cour2020-10-231-16/+9
|
* fix cgen header copyright (#15649)Timothee Cour2020-10-211-3/+1
| | | | * remove copyright Andreas Rumpf from cgen files
* const view types; fixes some cases from ↵Andreas Rumpf2020-10-051-1/+2
| | | | https://github.com/nim-lang/Nim/issues/15428 (#15488)
* .noalias annotation; frontend support (#15419)Andreas Rumpf2020-09-281-0/+3
| | | | | * .noalias annotation; frontend support * added .noalias support to Nim; implements https://github.com/nim-lang/RFCs/issues/204
* allow old styled RTTI for arc/orc (#15331)Andreas Rumpf2020-09-161-3/+6
|
* borrow checking (#15282)Andreas Rumpf2020-09-091-25/+31
| | | | | | | | | | | * refactoring: move procs to typeallowed.nim * frontend preparations for first class openArray support * prepare the code generator for first class openArray * code generation for first class openArray; WIP * code generation for open arrays, progress * added isViewType proc * preparations for borrow checking * added borrow checking to the front end
* Big compiler Cleanup (#14777)Clyybber2020-08-281-1/+1
|
* scoped memory management (#14790)Andreas Rumpf2020-07-041-1/+5
| | | | | | | * fixes the regressions * closes #13936 * scope based memory management implemented * enabled tcontrolflow.nim test case * final cleanups
* Fix #14647 (#14776)Clyybber2020-06-281-6/+3
| | | | | | | | | * Fix #14647 * Correct fix * Typo and add test * For real now :p
* fixes #14240 [backport:1.2] (#14757)Andreas Rumpf2020-06-221-0/+1
|
* fixes #14458 [backport:1.2] (#14756)Andreas Rumpf2020-06-221-3/+6
|
* more checking for --gc:arc, no need for valgrind (#14467)Andreas Rumpf2020-05-291-1/+2
| | | | * sigmatch: removed dead code
* specialize genericReset (#14398)Andreas Rumpf2020-05-191-2/+6
| | | | | | | * progress * make tests green * maybe we also want to reset pointers, dunno * progress * cleanup; fixes #13879 [backport:1.2]
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, ↵Timothee Cour2020-05-111-4/+4
| | | | | | | | | | `--doccmd:skip` + other improvements (#14278) * `nim doc --backend:js|cpp...` `nim doc --doccmd:'-d:foo --threads:on'` `nim r --backend:cpp...` (implies --run --usenimcache) * --usenimcache works with all targets * --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
* Make ./koch temp --gc:arc work (#14186)Clyybber2020-05-011-1/+4
|
* arc: do not unload globals when building a library [backport:1.2] (#14180)Andreas Rumpf2020-05-011-2/+3
|
* HCR: properly handling complex const objects in the codegen - fixes #13915 ↵Viktor Kirilov2020-04-251-6/+28
| | | | (#14115)
* remove the nilChecks switch; refs #11570Araq2020-04-201-2/+0
|
* move tinyc to a separate repo and allow installing external dependencency ↵Timothee Cour2020-04-031-2/+2
| | | | | | | (eg tinyc) from koch / library code (#13850) * remove tinyc * installDeps * update tinyc paths
* fix open file leak when running --debugger:native (#13832)Timothee Cour2020-04-011-2/+3
|
* make nim_temp compile with --gc:arc --sinkInference:off (#13769)cooldome2020-03-261-1/+1
| | | | | | | * make nim_temp compiler with --gc:arc * trigger build Co-authored-by: cooldome <ariabushenko@bk.ru>
* Attempt to finish off araq cpp exceptions (#13695)cooldome2020-03-191-5/+0
| | | | | | | | | | | | | | | * config update * disable a questionable test * remove c++ exception handling IDs, new impl doesn't require it anymore * C++ based exceptions finally work * fixes bootstrapping problem in C++ mode * teach GCC it's 2020 now * more bugfixes for C++ based exception handling * apply cooldome's patch * another attempt to enable C++11 * bug fix Co-authored-by: Araq <rumpf_a@web.de> Co-authored-by: cooldome <ariabushenko@bk.ru>
* added a switch -d:nimEmulateOverflowChecks for broken or old GCC versions ↵Andreas Rumpf2020-03-191-3/+5
| | | | (#13692)
* rewritten goto based exception handling; much cleaner implementation;… ↵Andreas Rumpf2020-03-171-1/+1
| | | | | | (#13677) * rewritten goto based exception handling; much cleaner implementation; fixes #13668
* catchable defects (#13626)Andreas Rumpf2020-03-121-0/+1
| | | | | | | | | | * 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 #13436 (#13615)Andreas Rumpf2020-03-101-3/+9
|
* make goto based exceptions available for 'nim cpp' (#13244)Andreas Rumpf2020-01-251-1/+1
| | | | | * make goto based exceptions available for 'nim cpp' * optimize seq.add to be comparable to C++'s emplace_back
* Unexport even more symbols (#13214)alaviss2020-01-231-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* make case-object transitions explicit, make unknownLineInfo a const, replace ↵Jasper Jenkins2020-01-171-1/+1
| | | | a few magic numbers with consts (#13170)
* VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (#12877)Timothee Cour2020-01-051-1/+1
| | | | | | | | | | | | | | * VM: allow certain hardcoded special var variables at CT * VM: allow all importc var, cast[int](ptr) * fix tests tests/vm/tstaticprintseq.nim, tests/cpp/t8241.nim * VM: == works for ptr/pointer nodes * bugfix: ==, cast now also works for pointer, not just ptr * VM supports cast PtrLikeKinds <=> PtrLikeKinds / int * improve cname handling * fixup + bug fix * VM: support cast from ref to int * address comment: opcLdGlobalDeref => opcLdGlobalDerefFFI * defensive check against typ == nil
* fixes #12978 (#13012)Andreas Rumpf2020-01-031-4/+6
|
* --exception:goto switch for deterministic exception handling (#12977)Andreas Rumpf2020-01-011-30/+24
| | | | | 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.
* minor refactoringsAndreas Rumpf2019-12-271-4/+4
|
* a better bugfixAraq2019-12-241-3/+3
|
* fixes #12826Araq2019-12-241-19/+34
|
* fixes #12899 (#12921)Andreas Rumpf2019-12-181-2/+2
| | | | | | * fixes #12899 * fixes regression: destroy global variables in reverse declaration order, closureleak test relies on it
* completes #12799, fixes #12216 (#12870)Andreas Rumpf2019-12-101-0/+1
|
* fixes #12827 (#12829) [backport]cooldome2019-12-101-4/+5
|
* ARC related bugfixes and refactorings (#12781)Andreas Rumpf2019-12-051-1/+1
|
* better support for PROGMEM like annotations for lets/vars; fixes #12216 (#12799)Andreas Rumpf2019-12-051-5/+15
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-186/+185
| | | | | | | | | | | | | | | | | | * 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
* fixes and changes the recently introduced 'alignas' to be 'align' (#12666)Andreas Rumpf2019-11-151-5/+5
| | | | | | * fixes and changes the recently introduced 'alignas' to be 'align' * more improvements
* ARC: solves phase ordering problems (#12654)Andreas Rumpf2019-11-141-4/+11
|
* implemented alignas pragma (#12643)Arne Döring2019-11-131-1/+7
| | | | | | | | | | | | * implemented alignas pragma * fix bootstrap * generate c++ compatible syntax for alignas * Make it work. * Multiple alignof expressions. Implement top level alignof.
* fix #12426 (#12462)Arne Döring2019-10-201-2/+3
|
* refactoring: use the new strings and seqs when optSeqDestructors is activeAraq2019-10-201-5/+5
|
* refactoring: --newruntime consists of 3 different switchesAraq2019-10-201-1/+1
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-4/+4
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-1/+1
| | | | | * Remove sonsLen * Use Indexable