summary refs log tree commit diff stats
path: root/compiler/ccgcalls.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #20026; marks system procs which can raise defects (#20864)ringabout2022-11-221-1/+2
| | | | | | | | | * marks system procs which can raise defects * add tests * add more systemRaisesDefect * add comment
* reduce openArray-related C undefined behavior (#20795)tersec2022-11-091-5/+12
|
* fixes #20572 (#20585)Andreas Rumpf2022-10-171-1/+1
| | | | | * fixes #20572 * added a test case
* new move analyser2 (#20471)Andreas Rumpf2022-10-011-1/+1
| | | | | | | | * produce better code for closure environment creation * new 'first write' analysis; * scope based move analyser * code cleanup Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* no ropes WIP (#20433)Andreas Rumpf2022-09-271-96/+108
| | | | | | | | | | | | | * refactorings in preparation for ropes elimination of the C code generator; mostly the usual ': Rope' -> 'result: var Rope' rewrite * rewrote ccgcalls.nim * refactored ccgexprs.nim * ccgliterals: refactoring * refactoring: code dealing with name mangling * refactoring: getRecordFieldsAux * ropes are strings (insert obscene joke here) * optimize JS code gen * optimizations and code improvements * more optimizations * final cleanups
* fixes #19631 (#19618)Andreas Rumpf2022-03-201-3/+8
| | | Aliasing is hard and we have to watch out not to compile 'x = f(x.a)' into 'f(x.a, addr x)'
* don't use a temp for addr [backport: 1.6] (#19503)flywind2022-02-081-2/+2
| | | | | | | | | | | | | * don't use a temp for addr fix #19497 * Update compiler/ccgcalls.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * add a test Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* nvro don't touch cdecl types [backport: 1.6] (#19461)flywind2022-01-281-3/+3
| | | * nvro don't touch cdecl types; fix #19342 again
* allow converting static vars to `openArray` (#19035)Etan Kissling2021-10-221-1/+1
| | | | | | | | | | | When assigning constant output to a seq, and then passing that static seq to other functions that take `openArray`, the compiler may end up producing errors, as it does not know how to convert `static[seq[T]]` to `openArray[T]`. By ignoring the `static` wrapper on the type for the purpose of determining data memory location and length, this gets resolved cleanly. Unfortunately, it is relatively tricky to come up with a minimal example, as there are followup problems from the failing conversion, e.g., this may lead to `internal error: inconsistent environment type`, instead of the relevant `openArrayLoc` error message.
* Removes deprecated {.injectStmt.}. Fixes #18666 (#18984)Dominik Picheta2021-10-131-1/+0
|
* fixes #12642 (#18811)Andreas Rumpf2021-09-061-0/+1
| | | | | | | | | | | | | | | | | | | * fixes #12642 * update important packages; refs #18804 * fixes #18805; refs #18806 * fixes a regression * Update testament/categories.nim Co-authored-by: flywind <xzsflywind@gmail.com> * progress * progress Co-authored-by: flywind <xzsflywind@gmail.com>
* strict effects (#18777)Andreas Rumpf2021-09-021-2/+2
| | | | | | | | | | | | | | | | | * fixes #17369 * megatest is green for --cpu:arm64 * docgen output includes more tags/raises * implemented 'effectsOf' * algorithm.nim: uses new effectsOf annotation * closes #18376 * closes #17475 * closes #13905 * allow effectsOf: [a, b] * added a test case * parameters that are not ours cannot be declared as .effectsOf * documentation * manual: added the 'sort' example * bootstrap with the new better options
* fixes #18558 again (#18586)Andreas Rumpf2021-07-261-0/+2
|
* fixes #18558 (#18563)Andreas Rumpf2021-07-231-16/+28
| | | | | * fixes #18558 * better fix
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-1/+1
| | | | cstring, not cString (#17744)
* fix #17512 (#17520)flywind2021-03-301-1/+8
|
* fixes #17170 (#17171)Andreas Rumpf2021-02-241-0/+1
|
* ARC Analysis in one pass v3 (#17068)Clyybber2021-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut * Cache alias results This improves performance by a lot, since many CFG locations map to a single PNode * Improve performance * Improve performance * Cleanup * Fix #17025 * Grammar * Expand testcase
* Revert "ARC: Analysis in one pass v2 (#17000)" (#17046)Clyybber2021-02-151-2/+2
| | | This reverts commit 216be4060a853b3425501318537d598c4842eefc.
* ARC: Analysis in one pass v2 (#17000)Clyybber2021-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut * Cache alias results This improves performance by a lot, since many CFG locations map to a single PNode * Improve performance * Improve performance * Cleanup
* Revert "ARC Analysis in one pass (#16849)" (#16984)Clyybber2021-02-091-2/+2
| | | This reverts commit ab740cb5b9bfbacece26956fa2444763a790ccd1.
* ARC Analysis in one pass (#16849)Clyybber2021-02-091-2/+2
| | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut
* fixes https://github.com/status-im/nimbus-eth2/issues/1549 (#16146)Andreas Rumpf2020-11-261-6/+8
| | | | | * fixes https://github.com/status-im/nimbus-eth2/issues/1549 [backport:1.4] * test fixup
* fixes a C code generator regression, no need to backport, only the 1.4 line ↵Andreas Rumpf2020-10-141-1/+1
| | | | is affected (#15569)
* better support for view types (#15436)Andreas Rumpf2020-09-301-2/+4
| | | | | * you can put borrows into tables * enforces mutating views only mutate mutable data
* produce runtime type information for reified openArrays (#15415)Andreas Rumpf2020-09-271-2/+5
| | | | | * produce runtime type information for reified openArrays * added a test case
* better support for slices as views (#15414)Andreas Rumpf2020-09-271-37/+48
| | | | | | * moved view tests to tests/views * refactoring * more refactorings * better support for system.toOpenArray for first class view types
* borrow checking (#15282)Andreas Rumpf2020-09-091-3/+18
| | | | | | | | | | | * 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
* Fix #14396 (#14793)Clyybber2020-07-041-44/+101
| | | | | | | | | | | | | | | | | | | | | | * Correct Left-To-Right evaluation of proc args * Fix CPP backend * Add testcase * closes #14396 * closes #14345 * Improve test and optimize * Improve testcase and optimize literals * Fix bug * Expand testcase and use DFA to optimize * Turn genParams into proc * Turn withTmpIfNeeded into a proc * Cleanup * Fix crash * Better analysis * Cleanup * Trailing newline.. * Fix build * Tiny cleanup Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* scoped memory management (#14790)Andreas Rumpf2020-07-041-0/+26
| | | | | | | * fixes the regressions * closes #13936 * scope based memory management implemented * enabled tcontrolflow.nim test case * final cleanups
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-7/+7
| | | | | | | | | | | * 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
* more precise analysis about 'observable stores' [backport:1.2] (#14582)Andreas Rumpf2020-06-061-3/+9
|
* fixes #14514 [backport:1.2] (#14533)Andreas Rumpf2020-06-011-1/+3
|
* warn about observerable stores but don't prevent them for 1.2.2 ↵Andreas Rumpf2020-05-301-2/+3
| | | | [backport:1.2]; refs https://github.com/nim-lang/RFCs/issues/230 (#14510)
* fixes #14126 [backport:1.2] (#14390)Andreas Rumpf2020-05-201-5/+24
| | | | | * fixes #14126 [backport:1.2] * used more logic to optimize it further; updated Nimble version
* fixes #14003 (#14006) [backport:1.2]cooldome2020-04-171-6/+12
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes #13782 (#13834)Andreas Rumpf2020-04-011-19/+56
|
* enable --tlsEmulation:on for --gc:arc (#13685)Andreas Rumpf2020-03-181-1/+1
| | | | * enable --tlsEmulation:on for --gc:arc * make -d:useMalloc work with --gc:arc --threads:on
* rename sfAlwaysReturn to sfNeverRaisesAraq2020-03-161-1/+1
|
* catchable defects (#13626)Andreas Rumpf2020-03-121-2/+14
| | | | | | | | | | * 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
* --exception:goto switch for deterministic exception handling (#12977)Andreas Rumpf2020-01-011-0/+4
| | | | | 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.
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-129/+125
| | | | | | | | | | | | | | | | | | * 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
* no commas for empty importcpp splat params (#12183)Jasper Jenkins2019-09-121-5/+8
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-16/+16
| | | | | * Remove sonsLen * Use Indexable
* hashes: implement murmur3 (#12022)Miran2019-09-011-6/+8
| | | | | | | | * hashes: implement murmur3 * refactoring; there is only one murmurHash and it works at compile-time via VM hooks * fixes JS tests * makes toOpenArrayByte work with C++ * make it bootstrap in C++ mode for 0.20
* fixes #12042 (#12083)Andreas Rumpf2019-08-291-1/+11
| | | | | | * fixes #12042 * make tests green again
* - adding _actual as a suffix only for calls to an actual proc and not ↵Viktor Kirilov2019-08-231-3/+3
| | | | | | through a global function pointer - fixes https://github.com/nim-lang/Nim/issues/11996 (#12007) - adding forward declarations for reloadable functions within a module - fix compilation errors when 2 such functions reference each other - fixes https://github.com/nim-lang/Nim/issues/11608 - preserve permissions of copied executable binaries
* int128 on firstOrd, lastOrd and lengthOrd (#11701)Arne Döring2019-08-071-1/+1
| | | | * fixes #11847
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-1/+1
| | | | --styleCheck:error
* fixes #11412Araq2019-06-061-3/+3
|