summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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]
* reduce openArray-related C undefined behavior (#20795)tersec2022-11-091-5/+7
|
* implements display based subtype checking (6.4x faster without threads; 2.8x ↵ringabout2022-11-081-19/+19
| | | | | | | | faster with threads) (#20781) * WIP: fast 'of' operator based on the literature * implement display based subtype checking Co-authored-by: Araq <rumpf_a@web.de>
* Fix #18079 Illegal storage access compiling call with nested ref/deref (#20738)Bung2022-11-041-1/+10
| | | | | | * add test case * refactoring transformAddrDeref and fix #18079 * fix jsgen
* fixes #20572 (#20585)Andreas Rumpf2022-10-171-1/+1
| | | | | * fixes #20572 * added a test case
* add default field support for object in ARC/ORC (#20480)ringabout2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fresh start * add cpp target * add result support * add nimPreviewRangeDefault * reduce * use orc * refactor common parts * add tuple support * add testcase for tuple * cleanup; fixes nimsuggest tests * there is something wrong with cpp * remove * add support for seqs * fixes style * addd initial distinct support * remove links * typo * fixes tuple defaults * add rangedefault * add cpp support * fixes one more bugs * add more hasDefaults * fixes ordinal types * add testcase for #16744 * add testcase for #3608 * fixes docgen * small fix * recursive * fixes * cleanup and remove tuple support * fixes nimsuggest * fixes generics procs * refactor * increases timeout * refactor hasDefault * zero default; disable i386 * add tuples back * fixes bugs * fixes tuple * add more tests * fix one more bug regarding tuples * more tests and cleanup * remove messy distinct types which must be initialized by original types * add tests * fixes zero default * fixes grammar * fixes tests * fixes tests * fixes tests * fixes comments * fixes and add testcase * undo default values for results Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
* remove hack for deprecated csize in compiler (#20463)metagn2022-10-011-2/+1
| | | | | * remove hack for deprecated csize in compiler * remove test
* store full definition AST for consts, fix noRewrite (#20115)metagn2022-09-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | * continue #9582 for consts, close #9331, fix #20114 also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc * changelog correctly * fix jsgen * update tgetimpl * fix sighashes * fix #19766, add comment about postfix * fix noRewrite LOL refs #16620 * fix changelog * fix destructors
* fixes #20141; dereferencing pointer to incomplete type error with cast (#20147)ringabout2022-09-281-0/+5
| | | Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* no ropes WIP (#20433)Andreas Rumpf2022-09-271-254/+405
| | | | | | | | | | | | | * 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 the regressions caused by the fix for #20107 [backport] (#20287)Andreas Rumpf2022-08-311-0/+1
| | | | * fixes the regressions caused by the fix for #20107 [backport]
* top-down type inference, implements rfc 149 (#20091)metagn2022-08-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * micro implementation of rfc 149 refs https://github.com/nim-lang/RFCs/issues/149 * number/array/seq literals, more statements * try fix number literal alias issue * renew expectedType with if/case/try branch types * fix (nerf) index type handling and float typed int * use typeAllowed * tweaks + const test (tested locally) [skip ci] * fill out more of the checklist * more literals, change @ order, type conversions Not copying the full call tree before the typedesc call check in `semIndirectOp` is also a small performance improvement. * disable self-conversion warning * revert type conversions (maybe separate op later) * deal with CI for now (seems unrelated), try enums * workaround CI different way * proper fix * again * see sizes * lol * overload selection, simplify int literal -> float * range, new @ solution, try use fitNode for nil * use new magic * try fix ranges, new magic, deal with #20193 * add documentation, support templates Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* document compiler procs regarding `&` (#20257)ringabout2022-08-221-2/+2
|
* fixes #20107 (#20246) [backport]Andreas Rumpf2022-08-191-0/+14
|
* Better range error messages (#19867)Tanguy2022-06-151-3/+3
| | | | | | | * Better range error messages * Revert to old behavior for arrays * Small corrections
* fixes #18612; apply cache and memcmp for methods in arc/orc (#19749)flywind2022-04-261-2/+5
| | | | | | | | | | | | | | | | | * try using endsWith * use memcmp * add cache * cleanup * better * minor * fix * improve test coverage for methods with ARC
* use signed comparisons for the index checking in the hope it improves the ↵Andreas Rumpf2022-04-261-7/+7
| | | | code generation (#19712)
* fixes #19615; emit better code for integer divisions when the divisor… ↵Andreas Rumpf2022-03-221-6/+16
| | | | | | | (#19626) * fixes #19615; emit better code for integer divisions when the divisor is known at compile-time * proper bugfix: unsigned numbers cannot be -1
* fix #19266; allow reassign discriminant field (#19567)flywind2022-02-251-1/+15
| | | | | * add inUncheckedAssignSection * add one more test
* fixes an old ARC bug: the produced copy/sink operations don't copy the ↵Andreas Rumpf2021-12-091-0/+8
| | | | hidden type field for objects with enabled inheritance; fixes #19205 [backport:1.6] (#19232)
* define `nimVersion` automatically and avoid needing -d:nimVersion140 (#18726)Timothee Cour2021-10-171-2/+2
| | | | | * define `nimVersion` and avoid needing -d:nimVersion140 * fix changelog
* correct effect tracking for .borrowed procs [backport] (#18882)Andreas Rumpf2021-09-231-2/+2
| | | | | | | | | | | * correct effect tracking for .borrowed procs [backport] * progress * fix error message in a test * correctly fix it Co-authored-by: narimiran <narimiran@disroot.org>
* fix #10128 (#18852)flywind2021-09-141-3/+3
|
* allow building 1.4.0 from devel (#18708)Timothee Cour2021-08-181-4/+17
| | | | | * allow building 1.4.0 from devel * changelog
* properly fix #10053 ; `FieldDefect` msg now shows discriminant value + ↵Timothee Cour2021-08-131-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lineinfo, in all backends (c,vm,js) (#11955) * fix #10053 FieldError for vm * fixup * FieldError now also shows runtime value of discriminant * fix field error reporting in vm * also report culprit line info in err msg * fix errors for newruntime 2 * fix for js * fixup * PRTEMP4 * works * works * works perfect * refactor * std/private/repr_impl * suppport --gc:arc * cleanup * refactor * simplify * simplify * simplify * fixup * move out compiler.vmgen.genCustom * fixup * fixup * add tests * revert compiler/debugutils.nim * simplify reprDiscriminant * fixup * lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim * try to fix D20210812T165220 * honor --declaredlocs * control toFileLineCol via --declaredlocs
* fixes #18643 [backport:1.0] (#18678)Andreas Rumpf2021-08-121-1/+1
|
* make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)Timothee Cour2021-07-201-7/+5
| | | | | | * compiler/vmhooks: add getVar to allow vmops with var params * addFloat vmops with var param * cgen now renders float32 literals in c backend using roundtrip float to string
* ORC: support for custom =trace procs (#18459)Andreas Rumpf2021-07-091-0/+1
| | | | | | | | | | | * ORC: support custom =trace procs (WIP) * Update tests/arc/tcustomtrace.nim Co-authored-by: Clyybber <darkmine956@gmail.com> * =trace is now documented and seems to work * make test green Co-authored-by: Clyybber <darkmine956@gmail.com>
* Renamed `-d:nimCompilerStackraceHints` to `-d:nimCompilerStacktraceHints`. ↵Timothee Cour2021-06-171-2/+2
| | | | (#18283)
* added float32 schubfach algorithm; wip (#18155)Andreas Rumpf2021-06-031-1/+5
| | | | | * added float32 schubfach algorithm; wip * fixes #18418
* ARC: fixes memory leaks with newSeq used in a loop [backport:1.4] (#18040)Andreas Rumpf2021-05-181-1/+6
| | | | * ARC: fixes memory leaks with newSeq used in a loop [backport:1.4] * Update tests/arc/tnewseq_legacy.nim
* IC: codegen: fix (#17931)Andreas Rumpf2021-05-041-1/+3
|
* -d:nimDebug: calls doAssert false instead of quit (#17739)Timothee Cour2021-04-171-2/+2
|
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-7/+7
| | | | cstring, not cString (#17744)
* Genode platform fixes (#17521)Emery Hemingway2021-04-091-4/+10
| | | | | | | | | | | | | | | | | | | * Genode: move dyncall failures to runtime Do not use the "error" pragma to warn that dynamic library loading is not implemented, print a message at runtime and exit. * Genode: use stricter dataspace type in page allocator * Genode: remove compiler configuration from nim.cfg Self-hosting Nim is not supported on Genode and defining the cross-compilation environment can be done externally. * Genode: use new mutex API * Genode: call nim_component_construct as a C procedure * Genode: implement echo for NimStringV2
* Fix #14325 (#17308)Clyybber2021-03-111-30/+22
| | | | | * Fix #14325 * Refactor and fix
* fixes #11225; generic sandwich problems; [backport:1.2] (#17255)Andreas Rumpf2021-03-091-0/+1
| | | | | * fixes #11225; generic sandwich problems; [backport:1.2] * progress * delegating these symbols must be done via 'bind'
* IC: compilerprocs are handled correctly (#17265)Andreas Rumpf2021-03-091-2/+4
| | | | | | | * IC: compilerprocs are handled correctly * IC: special logic for .exportC'ed procs * IC: 'hello world' compiles for the first round (2nd round fails) * IC: hello world seems to work
* fix #17264 [backport:1.4] (#17266)flywind2021-03-051-1/+2
| | | | | * fix #17264 * fix vm * fix js and add tests
* `--nilseqs` is now a deprecated noop (#17211)Timothee Cour2021-03-011-10/+6
| | | | | * --nilseqs is now a deprecated noop * fix tests; fix: future => sugar
* remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 ↵Timothee Cour2021-02-171-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#16918) * nimNoArrayToCstringConversion deadcode * nimbabel deadcode * nimHasalignOf deadcode * nimvarargstyped deadcode * nimhygiene deadcode * nimNewTypedesc deadcode * nimlocks deadcode * nimHasCppDefine deadcode * nimHasRunnableExamples deadcode * nimHasNilChecks deadcode * nimSymKind deadcode * minor macros refactoring * nimVmEqIdent deadcode * nimNoNil deadcode * nimNoZeroTerminator deadcode * nimHasSymOwnerInMacro deadcode * nimVmExportFixed deadcode * nimNewRuntime deadcode * nimAshr deadcode * nimUncheckedArrayTyp deadcode * nimHasTypeof deadcode * nimErrorProcCanHaveBody deadcode * nimHasHotCodeReloading deadcode * nimHasSignatureHashInMacro deadcode * nimHasDefault deadcode * nimMacrosSizealignof deadcode
* IC: bugfixes (WIP) (#16836)Andreas Rumpf2021-02-021-0/+1
| | | | | | | | * minor improvements * IC: added the required logic for compilerProcs * LazySym ftw * we need this testing logic * reimplement the old way we use for module package creation * fixes a regression; don't pick module names if you can avoid it
* IC: final implementation steps (#16801)Andreas Rumpf2021-01-251-1/+0
| | | | | | | | * removed dead code * we need even more laziness for the generic caches * make it bootstrap on older Nims * wrote more deserialization code * IC: replay required methods information
* IC: next steps (#16729)Andreas Rumpf2021-01-231-19/+78
| | | | | | | | | | | * IC: dead code elimination pass * preparations for a different codegen strategy * added documentation to the newly written code * IC: backend code * IC: backend adjustments * optimized the compiler a bit * IC: yet another massive refactoring * fixes regressions * cleanups