summary refs log tree commit diff stats
path: root/compiler/semfold.nim
Commit message (Collapse)AuthorAgeFilesLines
* fix regression with uint constant losing abstract type (#24105)metagn2024-09-141-1/+0
| | | | | | | | fixes #24104, refs #23955 The line `result.typ = dstTyp` added in #23955 changes the type of `result`, which was the type of `n` due to the argument passed to `newIntNodeT`, to the abstract type skipped `dstTyp`. The line is removed to just keep the type as abstract.
* fixes for 32bit system (#23980)ringabout2024-08-191-1/+1
|
* fixes #23954; uint8 > 8 bit at compile-time (#23955)ringabout2024-08-151-1/+2
| | | fixes #23954
* fixes #14522 #22085 #12700 #23132; no range check for uints (#23930)ringabout2024-08-111-3/+8
| | | | | | | | | | fixes #14522 fixes #22085 fixes #12700 fixes #23132 closes https://github.com/nim-lang/Nim/pull/22343 (succeeded by this PR) completes https://github.com/nim-lang/RFCs/issues/175 follow up https://github.com/nim-lang/Nim/pull/12688
* fixes #22389; fixes #19840; don't fold paths containing `addr` (#23807)ringabout2024-07-091-4/+1
| | | | fixes #22389; fixes #19840
* fixes #23784; don't allow fold paths containing `nkAddr` (#23792)ringabout2024-07-031-1/+1
| | | | | | | fixes #23784 notes that before https://github.com/nim-lang/Nim/pull/23477, it didn't fold paths containing `addr`/`unsafeAddr` because it retained the form of the magic function: `mAddr`.
* fixes #5901 #21211; don't fold cast function types because of gcc 14 (#23683)ringabout2024-06-051-1/+2
| | | | | | | | | follow up https://github.com/nim-lang/Nim/pull/6265 fixes #5901 fixes #21211 It causes many problems with gcc14 if we fold the cast function types. Let's check what it will break
* remove unused magics: mIntToStr, mInt64ToStr, mFloatToStr (#23486)ringabout2024-04-091-2/+0
| | | mIntToStr, mInt64ToStr, mFloatToStr,
* Types: Refactorings; step 1 (#23055)Andreas Rumpf2023-12-121-2/+2
|
* IC: progress and refactorings (#22961)Andreas Rumpf2023-11-201-3/+3
|
* prepare for the enforcement of `std` prefix (#22873)ringabout2023-10-291-3/+4
| | | follow up https://github.com/nim-lang/Nim/pull/22851
* fix isNil folding for compile time closures (#22574)metagn2023-09-021-1/+7
| | | fixes #20543
* replaces `doAssert false` with `raiseAssert` for unreachable branches, which ↵ringabout2023-08-101-2/+1
| | | | | works better with strictdefs (#22436) replaces `doAssert false` with `raiseAssert`, which works better with strictdefs
* use strictdefs for compiler (#22365)ringabout2023-08-061-5/+23
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* replaces `pairs` with `keys` and `items`; saves 8 bytes (#21319)ringabout2023-02-021-3/+3
| | | replace `pairs` with `keys` and `items`
* fix for bad error message with const in case statement (#21182)metagn2022-12-271-0/+4
| | | | | | | * preliminary fix for bad error message with const * add test case * fix tmatrixconcept and tmatrixlib
* generic `define` pragma + string alias (#20979)metagn2022-12-131-26/+83
| | | | | | | | | * generic `define` pragma + string alias * clean * add tests and document * remove char/float, minimize changelog
* fix #19426 compile error using when/elif/else and typedesc in template (#20550)Bung2022-10-211-0/+1
|
* store full definition AST for consts, fix noRewrite (#20115)metagn2022-09-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | * 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
* move formatfloat out of system (#20195)ringabout2022-08-241-1/+1
| | | | | | | | | | | | | | | * move formatfloat out of system * fixes doc * Update changelog.md * careless * fixes * deprecate system/formatfloat * better handling
* [semfold] fix #19199; properly fold uint to float conversion (#19890) [backport]flywind2022-06-131-1/+1
| | | fix #19199; properly fold float conversion
* move assertions out of system (#19599)flywind2022-03-231-0/+3
|
* allow `HSlice` bounded by constants of distinct types (#19219) [backport:1.2]Etan Kissling2021-12-061-8/+8
| | | | | | | | | When creating heterogenous slices of distinct types, the compiler does not initialize the internal type's `size` before accessing it. This then leads to this crash message: ``` compiler/int128.nim(594, 11) `false` masking only implemented for 1, 2, 4 and 8 bytes [AssertionError] ``` This patch initializes the `size` properly, fixing the problem.
* remove exception (#18906)flywind2021-10-221-7/+1
|
* get rid of the warnings during bootstrapping (#18741)Miran2021-08-241-1/+1
| | | | | * fix bootstrapping hints and warnings * revert removals in ccgtypes
* allow building 1.4.0 from devel (#18708)Timothee Cour2021-08-181-0/+1
| | | | | * allow building 1.4.0 from devel * changelog
* make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)Timothee Cour2021-07-201-1/+0
| | | | | | * 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
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-2/+2
| | | | cstring, not cString (#17744)
* fixes #16076 (#17486)Andreas Rumpf2021-03-231-1/+2
|
* IC: next steps (#16705)Andreas Rumpf2021-01-141-97/+103
| | | | | | | | | | | * code cleanups * refactorings for IC * more refactorings for IC * IC: attach the 'nil' type to its module * IC: refactorings and improvements * IC: progress * IC: more serialization fixes * IC: embarrassing omission * code cleanups
* fix #16650 (#16660)flywind2021-01-101-1/+6
|
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-2/+2
| | | | | | | | | | | | | | | | | | | * reworked ID handling * the packed AST now has its own ID mechanism * basic serialization code works * extract rodfiles to its own module * rodfiles: store and compare configs * rodfiles: store dependencies * store config at the end * precise dependency tracking * dependency tracking for rodfiles * completed loading of PSym, PType, etc * removed dead code * bugfix: do not realloc seqs when taking addr into an element * make IC opt-in for now * makes tcompilerapi green again * final cleanups Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
* fixes #16069; [backport:1.2] [backport:1.4] (#16115)Andreas Rumpf2020-11-241-0/+1
| | | | | * fixes #16069; refs https://github.com/nim-lang/RFCs/issues/257 [backport:1.2] [backport:1.4] * make tests green again
* Disallow nil dereference at compile time (#16032)cooldome2020-11-181-0/+4
| | | | | | | | | | | | | * bring back the semfold of nil * remove space * fix test * proc type can't be dereferenced * disallow nil dereference at compile time * changelog
* Semfold for nil cast (#16030)cooldome2020-11-181-1/+1
| | | | | | | | | * bring back the semfold of nil * remove space * fix test * proc type can't be dereferenced
* combine PR#16009 and PR#16012 (#16024)flywind2020-11-181-1/+1
| | | | | | | | * fix #15623 * add testcase for #15623 * add testcase * combine #16009 * support casting nil to NilableTypes in VM
* Revert "fix #15623 (#16009)"Andrey R (cooldome)2020-11-171-1/+1
| | | | This reverts commit 0f7f159a35bc10a43ff15bcb6c20eefdc574138e.
* fix #15623 (#16009)flywind2020-11-171-1/+1
| | | | | | | | | * fix #15623 * add testcase for #15623 * fix * add testcase
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-85/+46
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* fixes #15532 (#15534)Andreas Rumpf2020-10-091-0/+2
|
* Big compiler Cleanup (#14777)Clyybber2020-08-281-1/+1
|
* Deprecated laxStrings for mutating the internal zero terminator on strings ↵Juan Carlos2020-06-231-2/+0
| | | | | and its Deprecated code cleaned out (#14766) Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-2/+2
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* fix #14007 (#14012) [backport]cooldome2020-04-181-2/+6
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* Fix semfold handling of {.str/int/bool-define.} (#13964)Oscar Nihlgård2020-04-131-0/+6
|
* fix last remaining warning when building nim (`intVal should be Int128`) + ↵Timothee Cour2020-04-021-23/+4
| | | | minor cleanups (#13841)
* Continue bool conversion fixing (#13751)cooldome2020-03-251-0/+9
| | | | | | | | | * continue fixing #13744 * improve style * improve test Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes #13661 (#13664) [backport]Andreas Rumpf2020-03-161-1/+0
|
* fix operators containing percent for VM usage (#13536)Arne Döring2020-03-111-2/+2
| | | | * fixes #13513 * merge tarithmetics in tarithm
* Remove dead magics (#13551)Arne Döring2020-03-031-9/+1
|