summary refs log tree commit diff stats
path: root/compiler/ccgcalls.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #23923; type-aliased seq[T] get different backend C/C++ pointer type ↵ringabout2024-08-281-2/+2
| | | | | | | names causing invalid codegen (#23924) … type names causing invalid codegen fixes #23923
* fixes #23858; 2.2.0 rc1 regression with cdecl functions (#23859)ringabout2024-07-181-3/+3
| | | | | | fixes #23858 We should not assign fields to fields for returns of function calls because calls might have side effects.
* refactor: The popular 'r' field is now named 'snippet' (#23829)Andreas Rumpf2024-07-121-19/+19
|
* fixes #20865; fixes #20987; Missing bounds check in array slicing (#23814)ringabout2024-07-101-6/+6
| | | | fixes #20865 fixes #20987
* [backport] fixes #23796; remove extra indirection for args in importc'ed ↵Alexander Kernozhitsky2024-07-061-1/+2
| | | | | functions in cpp (#23800) fixes #23796
* [backport] fixes #23748; do not skip materializing temporaries for proc ↵Alexander Kernozhitsky2024-06-301-4/+15
| | | | | arguments (#23769) fixes #23748
* fixes #22672; Destructor not called for result when exception is thrown (#23267)ringabout2024-06-061-3/+27
| | | fixes #22672
* rework ctypes with gcc 14 (#23636)ringabout2024-06-021-0/+5
|
* fixes `reifiedOpenArray`; `nkHiddenStdConv` is PathKinds1 not PathKinds0 ↵ringabout2024-05-221-2/+8
| | | | (#23633)
* rework `wasMoved`, `move` on the JS backend (#23577)ringabout2024-05-081-1/+1
| | | | | `reset`, `wasMoved` and `move` doesn't support primitive types, which generate `null` for these types. It is now produce `x = default(...)` in the backend. Ideally it should be done by ast2ir in the future
* fixes #23321; Error: internal error: openArrayLoc: ref array[0..0, int] (#23548)ringabout2024-04-291-1/+4
| | | | | | | | fixes #23321 In the function `mapType`, ptrs (tyPtr, tyVar, tyLent, tyRef) are mapped into ctPtrToArray, the dereference of which is skipped in the `genref`. We need to skip these ptrs in the function `genOpenArraySlice`.
* fixes #22597; avoid side effects for call returning openArray types (#23257)ringabout2024-01-261-2/+6
| | | | | | | | | | | | | | fixes #22597 ```nim proc autoToOpenArray*[T](s: Slice[T]): openArray[T] = echo "here twice" result = toOpenArray(s.p, s.first, s.last) ``` For functions returning openarray types, `fixupCall` creates a temporary variable to store the return value: `let tmp = autoToOpenArray()`. But `genOpenArrayConv` cannot handle openarray assignements with side effects. It should have stored the right part of the assignment first instead of calling the right part twice.
* type refactor: part 4 (#23077)Andreas Rumpf2023-12-151-11/+5
|
* fixes yet another strictdefs bug (#23069)ringabout2023-12-151-4/+2
|
* type refactoring: part 2 (#23059)Andreas Rumpf2023-12-131-1/+1
|
* Types: Refactorings; step 1 (#23055)Andreas Rumpf2023-12-121-21/+21
|
* NIR: VM + refactorings (#22835)Andreas Rumpf2023-10-291-7/+7
|
* fixes a strictdef ten years long vintage bug, which counts the same thing ↵ringabout2023-08-241-0/+1
| | | | | twice (#22549) fixes a strictdef ten years long vintage bug
* `getTemp` and friends now return `TLoc` as requested (#22440)ringabout2023-08-101-21/+16
| | | getTemp and friends now return `TLoc`
* `initLocExpr` and friends now return `TLoc` (#22434)ringabout2023-08-101-36/+22
| | | `initLocExpr` and friends now return TLoc
* use out parameters for getTemp (#22399)ringabout2023-08-071-7/+5
|
* use strictdefs for compiler (#22365)ringabout2023-08-061-21/+26
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* implements allow byref to work in params #21873 (#21875)Juan M Gómez2023-05-211-1/+2
|
* adds an experimental `mm:atomicArc` switch (#21798)ringabout2023-05-081-1/+1
|
* fixes #19857; Exception raised in closure may be "skipped" in ORC (#21530)ringabout2023-03-161-0/+1
| | | fixes #19857; Exception raised in closure may be "skipped"
* fixes #20422; emit nimPrepareStrMutationV2 for toOpenArray to keep th… ↵Andreas Rumpf2023-03-021-1/+3
| | | | | (#21459) fixes #20422; emit nimPrepareStrMutationV2 for toOpenArray to keep the abstraction of mutable strings which have immutable string literals
* 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)