summary refs log tree commit diff stats
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* fix #17286 nim check -b:js works (#19704)flywind2022-04-091-0/+2
| | | | | * fix #17286 nim check -b:js works * fix
* fix stylecheck bug with nre (#19356)flywind2022-04-081-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stylecheck usages part two: stdlib cleanup typeinfo.nim: importCompilerProc => importcompilerproc nre.nim: newLineFlags => newlineFlags system.nim: JSRoot => JsRoot ref #19319 * prefer importCompilerProc * fix stylecheck error with asyncdispatch it is a partial regression since #12842 * add tests * don't use echo in tests * fix stylecheck bug with nre * Update compiler/linter.nim * no need to check dotexpr again * neither did let/var/const
* [nimsuggest] return the type when on symbol in let/var (#19639)Ivan Yonchovski2022-04-071-3/+6
| | | - make sure `suggestSym` is called after `PSym.typ` is set.
* fix #18986; Import/except doesn't work on devel [backport: 1.6] (#19687)flywind2022-04-061-1/+1
| | | | | * fix #18986; Import/except doesn't work on devel [backport: 1.6] * add testcase
* Fix bug in freshVarForClosureIter. Fixes #18474 (#19675) [backport]flywind2022-04-043-21/+17
| | | | | | | | | | * Fix bug in freshVarForClosureIter. Fixes #18474. freshVarForClosureIter was returning non-fresh symbols sometimes. Fixed by making addField return the generated PSym. * remove discardable Co-authored-by: Nick Smallbone <nick@smallbone.se>
* fixes #14318 (#14335)Andreas Rumpf2022-03-261-1/+1
|
* fix #8219; nim check/dump shouldn't run single nimscript project [backport: ↵flywind2022-03-261-1/+2
| | | | | | 1.6] (#19641) * fix #8219; nim check/dump shouldn't run single nimscript project [backport: 1.6]
* remove tmpFramePtr when optStackTrace is absent (#19649)flywind2022-03-261-4/+0
|
* fixes #19603; some pragmas were really only supported as top level ↵Andreas Rumpf2022-03-262-7/+16
| | | | statements. Now this is enforced properly. (#19646)
* mitigates #19364 [backport]; we make this bug more unlikely to appear by ↵Andreas Rumpf2022-03-261-6/+12
| | | | producing better code to begin with; real fix will come later (#19647)
* remove unnecessary framePtr code (#19645)flywind2022-03-251-3/+6
|
* fix nim check nimscript [backport: 1.6] (#19444)flywind2022-03-232-1/+7
| | | | fix #19440; fix #3858
* output byref types into --header file [backport: 1.6] (#19505)flywind2022-03-231-2/+7
| | | | | | | | | * output byref types into --header file fix #19445 * fix comments * set targets
* move assertions out of system (#19599)flywind2022-03-2379-1/+251
|
* 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
* 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)'
* compiler: Handle nkCheckedFieldExpr better in dfa (#19616)Clyybber2022-03-181-4/+2
| | | | | | | Simply recurse into their first child, which is always a nkDotExpr instead of treating them seperately. This fixes the rhs sym of a nkCheckedFieldExpr being checked twice in aliases. This double checking didn't cause any issues, but was unintentional and redundant.
* support useVersion:1.6 (#19601)flywind2022-03-102-0/+5
|
* fixes #19575 (#19596) [backport]Andreas Rumpf2022-03-091-2/+4
| | | | | * fixes #19575 * better bugfix
* fixes #19569 (#19595) [backport]Andreas Rumpf2022-03-092-9/+7
| | | | | * minor code refactorings * fixes #19569
* register callback for marshal in VM (#19578)flywind2022-03-084-45/+40
| | | | | | | | | | | | | * register callback for marshal in VM * remove unrelated code * polish * more tests * more tests * add loadVM and toVM
* apply changes from #18017 and some fixes (#19571)flywind2022-03-013-38/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/369 * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * merge * remove * fix bug Co-authored-by: Araq <rumpf_a@web.de> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Fix #18662 (#19534)Evan Typanski2022-02-282-8/+3
|
* make compileOption("panics") work (#19568)solarizedalias2022-02-271-0/+1
|
* fix #19266; allow reassign discriminant field (#19567)flywind2022-02-253-2/+17
| | | | | * add inUncheckedAssignSection * add one more test
* Remove volatiles when compiling with ARC/ORC (#19545)PMunch2022-02-251-18/+50
| | | | | | | This removes volatiles on ARC/ORC targets in NimMain and PreMainInner. This avoids an issue where they couldn't be optimised out on microcontrollers leading to larger code. Since the stack bottom doesn't have to be initialised this way when using ARC or ORC (or None, which is also covered by this PR) these can be safely removed.
* Document links repect --out in .idx file (#19543)Jake Leahy2022-02-241-1/+4
| | | | | | | * Link in .idx file now respects --out:file switch * Use clearer chained calls Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* compile pragma: cache the result sooner (#19554)Ștefan Talpalaru2022-02-241-1/+3
| | | | | | | | | | | | extccomp.addExternalFileToCompile() relies on hashes to decide whether an external C file needs recompilation or not. Due to short-circuit evaluation of boolean expressions, the procedure that generates a corresponding hash file is not called the first time an external file is compiled, so an avoidable recompilation is triggered the next build. This patch fixes that by moving the proc call with a desired side effect from its boolean expression, so it's executed unconditionally.
* Remove trailing space in `nim r` command; Amend one error message (#19487)locriacyber2022-02-181-1/+2
|
* fixes #19404 by protecting the memory we borrow from. this replaces crashes ↵Andreas Rumpf2022-02-121-8/+13
| | | | | with minor memory leaks which seems to be acceptable. In the longer run we need a better VM that didn't grow hacks over a decade. (#19515) Co-authored-by: flywind <xzsflywind@gmail.com>
* 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>
* setjump => setjmp [backport: 1.2] (#19496)flywind2022-02-061-1/+1
|
* undefine C symbols in JS backend [backport:1.6] (#19437)flywind2022-02-042-3/+5
| | | fix #19330; fix #19059
* correct typos (#19485)flywind2022-02-031-1/+1
|
* move io out of system (#19442)flywind2022-02-022-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | * move io out of system * fix tests * fix tests * next step * rename to syncio * rename * fix nimscript * comma * fix * fix parts of errors * good for now * fix test
* No longer segfault when using a typeclass with a self referencing type (#19467)Jason Beetham2022-02-021-1/+2
|
* fix broken CI (#19472)flywind2022-01-312-0/+3
| | | | | | | * fix broken CI * fix * fix tests
* Merge pull request from GHSA-ggrq-h43f-3w7mDominik Picheta2022-01-291-1/+1
| | | | This fixes a CVE (currently https://github.com/nim-lang/Nim/security/advisories/GHSA-ggrq-h43f-3w7m)
* nvro don't touch cdecl types [backport: 1.6] (#19461)flywind2022-01-286-19/+33
| | | * nvro don't touch cdecl types; fix #19342 again
* support set other GCs after `mm = orc` or `mm = arc` is set in the global ↵flywind2022-01-271-20/+34
| | | | | | | | | config (#19455) * support set other GCs after arc/orc in global config fix #15535 * set before
* bugfix: varargs count as open arrays (#19447)Andreas Rumpf2022-01-251-1/+1
|
* New/better macro pragmas, mark some as experimental (#19406)metagn2022-01-202-116/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New/better macro pragmas, make some experimental fix #15920, close #18212, close #14781, close #6696, close https://github.com/nim-lang/RFCs/issues/220 Variable macro pragmas have been changed to only take a unary section node. They can now also be applied in sections with multiple variables, as well as `const` sections. They also accept arguments. Templates now support macro pragmas, mirroring other routine types. Type and variable macro pragmas have been made experimental. Symbols without parentheses instatiating nullary macros or templates has also been documented in the experimental manual. A check for a redefinition error based on the left hand side of variable definitions when using variable macro pragmas was disabled. This nerfs `byaddr` specifically, however this has been documented as a consequence of the experimental features `byaddr` uses. Given how simple these changes are I'm worried if I'm missing something. * accomodate compiler boot * allow weird pragmas * add test for #10994 * remove some control flow, try remove some logic
* enable weave (#19363) [backport:1.6]flywind2022-01-201-2/+7
| | | | * enable weave * workaround CI
* Don't reject types directly on AST (#19407)metagn2022-01-191-2/+4
| | | | | | | Instead of rejecting type expressions based on node kind, evaluate the expression as a type. This is already the behavior for call results, and it has its own error for non-types, which is the same error you would normally get with 2 words swapped.
* fix term rewriting with sideeffect (#19410)flywind2022-01-191-2/+5
| | | | | | | | | * fix term rewriting with sideeffect fix #6217 * add tests * Update tests/template/template_various.nim
* Optimize lent in JS [backport:1.6] (#19393)hlaaftana2022-01-171-15/+36
| | | | | | | * Optimize lent in JS [backport:1.6] * addr on lent doesn't work anymore, don't use it * use unsafeAddr in test again for older versions
* add mm to compilesettings; deprecate gc (#19394)flywind2022-01-161-0/+1
|
* deprecate unsafeAddr; extend addr (#19373)flywind2022-01-162-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Use openarray of bytes in md5 (#19307)hlaaftana2022-01-154-8/+299
| | | | | | | | | | * Use openarray of bytes in md5 * fix CI * cleanup * use noSideEffect for bootstrapping * fix CI again * actually fix CI by checking if it works * this is getting ridiculous * put old md5 version in compiler, remove vmop
* Fixed concept constraints for static types (#19391)Jason Beetham2022-01-151-0/+9
|