| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
fixes #23858
We should not assign fields to fields for returns of function calls
because calls might have side effects.
|
| |
|
|
|
|
| |
fixes #20865
fixes #20987
|
|
|
|
|
| |
arguments (#23769)
fixes #23748
|
|
|
| |
fixes #23759
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ref #20653
```nim
Error* = object
case kind*: ErrorType
of ErrorA:
discard
of ErrorB:
discard
```
For an object variants without fields, it shouldn't generate empty
brackets for default values since there are no fields at all in case
branches.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23627
```nim
type
TestObj = object of RootObj
TestTestObj = object of RootObj
testo: TestObj
proc `=destroy`(x: TestTestObj) =
echo "Destructor for TestTestObj"
proc testCaseT() =
echo "\nTest Case T"
let tt1 {.used.} = TestTestObj(testo: TestObj())
```
When generating const object fields, it's likely that
we need to generate type infos for the object, which may be an object
with
custom hooks. We need to generate potential consts in the hooks first.
https://github.com/nim-lang/Nim/pull/20433 changed the semantics of
initialization. It should evaluate`BracedInit` first.
|
|
|
|
|
| |
fixes #16671
related to https://github.com/nim-lang/Nim/pull/18911
|
|
|
|
|
| |
`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
|
|
|
| |
mIntToStr, mInt64ToStr, mFloatToStr,
|
|
|
|
|
|
|
|
|
| |
fixes #23422
ref https://github.com/nim-lang/Nim/issues/20997
https://github.com/nim-lang/Nim/pull/21165
The function `cardSet` is used for large sets that are stored in the
form of arrays. It shouldn't be passed as a pointer
|
|
|
|
|
|
| |
cstring to string via cstrToNimstr (#23371)
fixes #12703
ref #19588
|
|
|
|
|
| |
result (#23285)
fixes #23280
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
fixes #22923
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Done:
- [x] Implement conversions to openArray/varargs.
- [x] Implement index/range checking.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
fixes #22669 constructor pragma doesnt init Nim default fields
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
| |
It's used in `newSeqUninitialized`.
---------
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* unpublic the sons field of PType
* tiny fixes
* fixes an omittance
* fixes IC
* fixes
|
|
|
|
|
|
|
| |
* fixes move sideeffects issues [backport]
* fix openarray
* fixes openarray
|
|
|
| |
getTemp and friends now return `TLoc`
|
|
|
| |
`initLocExpr` and friends now return TLoc
|
| |
|
|
|
|
|
| |
* clean up gc:arc/orc in docs
* in error messages
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* wip; use strictdefs for compiler
* checkpoint
* complete the chores
* more fixes
* first phase cleanup
* Update compiler/bitsets.nim
* cleanup
|
|
|
|
|
|
|
| |
(#22376)
Revert "fix #22173 `sink` paramers not moved into closure (refc) (#22359)"
This reverts commit b40da812f7aa590ed16df54a492684c228320549.
|
|
|
|
|
| |
* use genRefAssign when assign to sink string
* add test case
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
* zero initialization union casts
* cleans up and adds a test case for #19101
* uses nimZeroMem
|
|
|
|
|
|
|
| |
(#22113)
* fixes #16331; aliasing of tuple construction within a single assignment, great coding style
* added test case
|
|
|
| |
fixes explicit deref
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* make `move` use `=wasMoved` internally
* fixes tests
* fixes spawn finally
* fixes views
* rename to internalMove
* add a test case
|
|
|
|
|
|
| |
* fixes tests again
* remove helper functions
* fixes closures, owned refs
* final cleanup
|
|
|
|
|
| |
(#21954)
fixes fieldDefect loses enum type info in ORC
|
|
|
|
|
| |
* fix #15428
* add test
|
|
|
|
|
|
|
| |
to get an array's length (#21925)
* fix #10964
* add test
|
| |
|