summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
Commit message (Collapse)AuthorAgeFilesLines
* C++: ptr fields now pulls the whole type if it's a member in nkDotExpr (#22855)Juan M Gómez2023-10-231-0/+6
|
* NIR: progress (#22817)Andreas Rumpf2023-10-121-3/+0
| | | | | | Done: - [x] Implement conversions to openArray/varargs. - [x] Implement index/range checking.
* NIR: Nim intermediate representation (#22777)Andreas Rumpf2023-10-111-33/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Theoretical Benefits / Plans: - Typed assembler-like language. - Allows for a CPS transformation. - Can replace the existing C backend by a new C backend. - Can replace the VM. - Can do more effective "not nil" checking and static array bounds checking. - Can be used instead of the DFA. - Easily translatable to LLVM. - Reasonably easy to produce native code from. - Tiny memory consumption. No pointers, no cry. **In very early stages of development.** Todo: - [x] Map Nim types to IR types. - [ ] Map Nim AST to IR instructions: - [x] Map bitsets to bitops. - [ ] Implement string cases. - [ ] Implement range and index checks. - [x] Implement `default(T)` builtin. - [x] Implement multi string concat. - [ ] Write some analysis passes. - [ ] Write a backend. - [x] Integrate into the compilation pipeline.
* produce better code for object constructions and 'result' [backport] (#22668)Andreas Rumpf2023-09-111-2/+6
|
* fixes #22669 constructor pragma doesnt init Nim default fields (#22670)Juan M Gómez2023-09-101-19/+25
| | | | | | | fixes #22669 constructor pragma doesnt init Nim default fields --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Make `newSeqOfCap` not initialize memory. (#21842)Amjad Ben Hedhili2023-09-091-1/+1
| | | | | | | It's used in `newSeqUninitialized`. --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fixes #17197; fixes #22560; fixes the dest of newSeqOfCap in refc (#22594)ringabout2023-08-311-0/+1
|
* fixes an issue where sometimes wasMoved produced bad codegen for cpp (#22587)Juan M Gómez2023-08-301-1/+4
|
* unpublic the sons field of PType; the precursor to PType refactorings (#22446)ringabout2023-08-111-2/+2
| | | | | | | | | | | * unpublic the sons field of PType * tiny fixes * fixes an omittance * fixes IC * fixes
* fixes move sideeffects issues [backport] (#22439)ringabout2023-08-101-3/+15
| | | | | | | * fixes move sideeffects issues [backport] * fix openarray * fixes openarray
* `getTemp` and friends now return `TLoc` as requested (#22440)ringabout2023-08-101-37/+29
| | | getTemp and friends now return `TLoc`
* `initLocExpr` and friends now return `TLoc` (#22434)ringabout2023-08-101-235/+164
| | | `initLocExpr` and friends now return TLoc
* simplify isAtom condition (#22430)ringabout2023-08-091-4/+1
|
* clean up `gc:arc` or `gc:orc` in docs and in error messages (#22408)ringabout2023-08-081-1/+1
| | | | | * clean up gc:arc/orc in docs * in error messages
* use out parameters for getTemp (#22399)ringabout2023-08-071-11/+17
|
* use strictdefs for compiler (#22365)ringabout2023-08-061-105/+116
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* Revert "fix #22173 `sink` paramers not moved into closure (refc) (#22… ↵Bung2023-08-031-9/+6
| | | | | | | (#22376) Revert "fix #22173 `sink` paramers not moved into closure (refc) (#22359)" This reverts commit b40da812f7aa590ed16df54a492684c228320549.
* fix #22173 `sink` paramers not moved into closure (refc) (#22359)Bung2023-08-021-6/+9
| | | | | * use genRefAssign when assign to sink string * add test case
* implement `ensureMove` (#22339)ringabout2023-07-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement `ensureMove` * use an additional flag * improve some logics * progress: fixes discard ensureMove * forbids nested expressions * improve error messages * checkpoint * fixes cursor * ADD MORE TESTS * fixes cursorinference again * tiny cleanup * improve error messages * fixes docs * implement comments add more tests * fixes js
* fixes #22268; fixes `move` codegen (#22288)ringabout2023-07-191-0/+7
|
* fixes #22175 (#22229)Andreas Rumpf2023-07-061-2/+5
|
* alternative to #22219; adds a pointer wrapper for T destructor (#22225)ringabout2023-07-061-4/+0
| | | | | | | | | | | | | | | * alternative to #22219; adds a pointer wrapper for T destructor * clean up and add comments * Update compiler/ccgtypes.nim * tidy up * fixes comments * fixes cpp * fixes cpp
* fixes #19101; zero initialization union casts (#22185)ringabout2023-06-291-2/+9
| | | | | | | * zero initialization union casts * cleans up and adds a test case for #19101 * uses nimZeroMem
* fixes #16331; aliasing of tuple construction within a single assignme… ↵Andreas Rumpf2023-06-161-3/+18
| | | | | | | (#22113) * fixes #16331; aliasing of tuple construction within a single assignment, great coding style * added test case
* fixes explicit deref block (#22093)ringabout2023-06-151-2/+0
| | | fixes explicit deref
* make `move` use `=wasMoved` internally (#22032)ringabout2023-06-091-1/+2
| | | | | | | | | | | | | * make `move` use `=wasMoved` internally * fixes tests * fixes spawn finally * fixes views * rename to internalMove * add a test case
* lift the `=dup` hook (#21903)ringabout2023-06-021-10/+0
| | | | | | * fixes tests again * remove helper functions * fixes closures, owned refs * final cleanup
* fixes fieldDefect loses enum type info in ORC; consistent with VM and refc ↵ringabout2023-05-291-10/+13
| | | | | (#21954) fixes fieldDefect loses enum type info in ORC
* fixes #15428 by updating deep open array copy codegen (#21935)heterodoxic2023-05-271-2/+3
| | | | | * fix #15428 * add test
* fix #10964 by honoring pointer deref syntax if a reified openarray is used ↵heterodoxic2023-05-271-2/+11
| | | | | | | to get an array's length (#21925) * fix #10964 * add test
* implements allow byref to work in params #21873 (#21875)Juan M Gómez2023-05-211-7/+7
|
* refactor gettypedesc so it accepts its own kind instead of symkind (#21867)Juan M Gómez2023-05-191-10/+10
|
* fix #21848 (#21852)heterodoxic2023-05-151-7/+8
|
* bring #21802 back; fixes #21753 [backport] (#21815)ringabout2023-05-111-2/+2
| | | | | | | | | | | | | * bring #21802 back; fixes #21753 [backport] * adds tests and multiple fixes * add test cases * refactor and remove startId * fixes custom hooks and adds tests * handle tyUncheckedArray better
* adds an experimental `mm:atomicArc` switch (#21798)ringabout2023-05-081-3/+3
|
* implement `=dup` hook eliminating `wasMoved` and `=copy` pairs (#21586)ringabout2023-05-061-0/+10
| | | | | | | | | | | | | | | | | | | * import `=dup` hook eliminating `wasMoved` and `=copy` pairs * add dup * add a test for dup * fixes documentation * fixes signature * resolve comments * fixes tests * fixes tests * clean up
* amends #21690 to fix broken Nim to C++ source line mappings (#21784)heterodoxic2023-05-041-39/+39
| | | resync fork
* improve C/C++ debug output readability (1/N) (#21690)heterodoxic2023-04-281-40/+40
| | | | | * hacky attempt to reconcile default explicit constructors with enforcement of brace initialization, instead of memsetting imported objects to 0 * improve C/C++ debug output readability (1/N)
* fixes #21540; deref block at transf phase to make injectdestructors function ↵ringabout2023-04-191-14/+1
| | | | | | | | | | | | | properly (#21688) * fixes #21540; deref block at transf phase to make injectdestructors function properly * add a test case * add one more test * fixes the type of block * transform block
* fixes #21632; enforce deref for `wasMoved` in ORC (#21647)ringabout2023-04-121-1/+1
| | | fixes #21632; enforce deref for `wasMoved`
* remove `seq[T]` `setLen` undefined behavior (#21582)tersec2023-03-291-1/+1
| | | remove seq[T] setLen UB
* fixes #20139; hash types based on its path relative to its package path ↵ringabout2023-03-021-2/+2
| | | | | | | | | | | | | | | (#21274) [backport:1.6] * fixes #20139; hash types based on its path relative its project * add a test case * fixes procs * better implementation and test case --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #20422; emit nimPrepareStrMutationV2 for toOpenArray to keep th… ↵Andreas Rumpf2023-03-021-1/+4
| | | | | (#21459) fixes #20422; emit nimPrepareStrMutationV2 for toOpenArray to keep the abstraction of mutable strings which have immutable string literals
* fixes #21333; bad codegen for the at operator; [backport:1.6] (#21344)Andreas Rumpf2023-02-081-1/+1
|
* fix #15117 zero size array cause incorrect codegen for VCC compiler (#21197)Bung2022-12-301-0/+2
| | | fix #15117
* fix #14667 (#21190)Bung2022-12-281-0/+4
|
* fix #20997 calling system.card[T](x: set[T]) with T of int8 or uint8 … ↵Bung2022-12-231-1/+1
| | | | | | | (#21010) * fix #20997 calling system.card[T](x: set[T]) with T of int8 or uint8 uses mismatched C array sizes * fullfil set variant
* fix #21045; getTime with vmopsDanger is broken; alternative to #21054 (#21056)ringabout2022-12-101-0/+1
| | | | | * fix #21045 getTime with vmopsDanger is broken; alternative to #21054 * typo
* fixes #20954; bounchecks for len(toOpenArray()) [backport] (#20956)ringabout2022-12-051-0/+4
| | | | | * bounchecks for len(toOpenArray()) * add a testcase
* Revert "fixes #20699; generate an empty struct for void type" (#20806)Andreas Rumpf2022-11-121-1/+6
| | | | | | | * Revert "fixes #20699; generate an empty struct for void type (#20790)" This reverts commit 8fcb9380f076e55bde29e365d395bd0603fc6229. * better fix [backport]