summary refs log tree commit diff stats
path: root/compiler/ic
Commit message (Collapse)AuthorAgeFilesLines
* IC: fix typo in rodfiles.nim (#20989)Ikko Ashimine2022-12-011-1/+1
| | | preceeded -> preceded
* fix a few "broken link" warnings (#20837)Andrey Makarov2022-11-141-1/+1
|
* 'lock levels' are deprecated, now a noop (#20539)ringabout2022-10-112-3/+2
| | | | | * 'lock levels' are deprecated, now a noop * fixes tests
* time to make IC work with ORC (here we go again...) (#20538)Andreas Rumpf2022-10-112-6/+25
| | | works for me
* refactorings (#20536)Andreas Rumpf2022-10-102-4/+0
| | | | | | | * refactoring * refactoring: removed unused macroUsagesSection * enum instead of bool for better readability
* no ropes WIP (#20433)Andreas Rumpf2022-09-271-1/+1
| | | | | | | | | | | | | * 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
* 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
* Don't require blank line before Markdown code (#20215)Andrey Makarov2022-08-151-2/+1
| | | | Fixes bug reported in https://github.com/nim-lang/Nim/pull/20189 affecting nimforum.
* Change `styleCheck` to ignore foreign packages (#19822)quantimnot2022-07-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change `styleCheck` to ignore foreign packages * Symbols from foreign packages are now ignored. * Fixed `styleCheck` violations in `compiler` package. * Added symbol ownership to custom annotation pragmas. * Minor refactors to cleanup style check callsites. * Minor internal documentation of reasons why a symbol isn't checked. Style violations were fixed in the compiler after thet were exposed by the changes. The compiler wouldn't compile otherwise. Symbol ownership for custom pragma annotations is needed for checking the annotation's style. A NPE was raised otherwise. Fixes #10201 See also nim-lang/RFCs#456 * Fix a misunderstanding about excluding field style checks I had refactored the callsites of `styleCheckUse` to apply the DRY principle, but I misunderstood the field access handling in a template as a general case. This corrects it. * Fix some `styleCheck` violations in `compiler/evalffi` The violations were exposed in CI when the compiler was built with libffi. * Removed some uneeded transitionary code * Add changelog entry Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* Refactor and doc package handling, module name mangling (#19821)quantimnot2022-05-302-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor and doc package handling, module name mangling * Consolidate, de-duplicate and extend package handling * Alter how duplicate module names of a package are handled * Alter how module names are mangled * Fix crash when another package is named 'stdlib' (test case added) * Doc what defines a package in the manual Modules with duplicate names within a package used to be given 'fake' packages to resolve conflicts. That prevented the ability to discern if a module belonged to the current project package or a foreign package. They now have the proper package owner and the names are mangled in a consistent manner to prevent codegen clashes. All module names are now mangled the same. Stdlib was treated special before, but now it is same as any other package. This fixes a crash when a foreign package is named 'stdlib'. Module mangling is altered for both file paths and symbols used by the backends. Removed an unused module name to package mapping that may have been intended for IC. The mapping was removed because it wasn't being used and was complicating the issue of package modules with duplicate names not having the proper package owner assigned. * Fix some tests * Refactor `packagehandling` * Remove `packagehandling.withPackageName` and its uses * Move module path mangling from `packagehandling` to `modulepaths` * Move `options.toRodFile` to `ic` to break import cycle * Changed import style to match preferred style Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* move assertions out of system (#19599)flywind2022-03-239-0/+29
|
* [minor]use `addInt` and `addFloat` (#18733)flywind2021-08-241-2/+2
| | | | | | | * unify int and uint * back * minor
* fixes #17943 (#18045)Andreas Rumpf2021-05-191-0/+3
| | | | | | | | | | | * fixes #17943 * IC: test 'nim check --ic:on' for the full Nim compiler * Update testament/testament.nim Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Clyybber <darkmine956@gmail.com>
* bring back std/ prefix within compiler and ensure it works in bootstrap + ↵Timothee Cour2021-04-301-1/+1
| | | | | | | | | | | | | bsd (#17902) * [WIP] bring back std/ prefix within compiler and ensure it works in bootstrap + bsd * refs https://github.com/nim-lang/Nim/pull/16282#discussion_r616846863 * sounds very similar to https://github.com/nim-lang/Nim/pull/14291 * more: vmops * update tools/ci_generate.nim * auto-generate freebsd.yml as well, to avoid duplication with openbsd.yml * cleanup * undo temporary CI removal
* typos (#17824)Andreas Rumpf2021-04-231-1/+1
|
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-216-10/+10
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* updated the documentation (#17796)Andreas Rumpf2021-04-201-1/+1
|
* IC navigator: added support for include files (#17784)Andreas Rumpf2021-04-192-5/+25
| | | | | | | | | | | | | | | | | * ic fixed navigator crash when track wrong/missed Also fixed an issue with getNimcacheDir not observing the outDir. * closer, but not sure how to test[skip ci][ci skip] * IC navigator: added support for include files * update * make posix happy via expandFilename * update Co-authored-by: Saem Ghani <saemghani+github@gmail.com>
* ic refactoring (#17778)Andreas Rumpf2021-04-197-159/+146
| | | | | * minor IC documentation update * IC: refactoring: removed the 'shared' type and fields, these were a leftover from an earlier design
* [ci skip] document compiler/ic/rodfiles.nim (#17771)Saem Ghani2021-04-191-0/+72
| | | | | | | | | | | | | | | | * [ci skip] document compiler/ic/rodfiles.nim Why? * understand how rodfile module works and a bit of the format * leave notes behind for others * rather than Araq guess what others need, he can fix what other glean * possible model for making the compiler more aproachable Bonus: * might have found a minor bug in `loadSection` * Update compiler/ic/rodfiles.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* IC: fixes a long standing bug about DCE set computations (#17763)Andreas Rumpf2021-04-181-25/+33
|
* -d:nimDebug: calls doAssert false instead of quit (#17739)Timothee Cour2021-04-171-2/+1
|
* IC: yet another embarrassing omission (#17743)Andreas Rumpf2021-04-171-1/+2
| | | | | * IC: yet another embarrassing omission * VM: fewer hacks that kept IC from working
* ic navigator tests (#17735)Andreas Rumpf2021-04-162-2/+3
| | | * IC navigator: first basic test
* `import foo {.all.}` reboot (#17706)Timothee Cour2021-04-162-16/+43
|
* IC: rodfiles: no floats (#17720)Andreas Rumpf2021-04-144-21/+18
|
* IC: first steps towards 'nim check --def --ic:on' (#17714)Andreas Rumpf2021-04-143-7/+172
| | | | | | | | | * IC: first steps towards 'nim check --def --ic:on' * IC navigator: deduplicate output lines * IC navigator: progress * IC navigator: use a different nimcache entry * IC navigator: special logic for templates/macros * IC navigator: proper error messages * IC navigator: prepare for testing code; document only what currently works somewhat
* IC: code cleanup (#17708)Andreas Rumpf2021-04-131-45/+12
|
* IC: serialization bugfix (#17701)Andreas Rumpf2021-04-131-4/+4
|
* IC: integrity checking (#17695)Andreas Rumpf2021-04-113-1/+157
| | | | | | * IC: integrity checking: the plumbing code * progress * progress + bugfix (yes, the code already found a bug) * implemented integrity checking
* IC: added basic test case for methods (#17679)Andreas Rumpf2021-04-092-6/+27
| | | | | * IC: added basic test case for methods * IC: better methods test
* followup custom literals (#17500)Timothee Cour2021-03-271-0/+1
|
* IC: bugfix (#17533)Andreas Rumpf2021-03-271-2/+5
| | | | * cleanups * IC: bugfix
* added a 'koch ic' command for easier adhoc testing of IC (#17508)Andreas Rumpf2021-03-263-6/+29
| | | | | | * added a 'koch ic' command for easier adhoc testing of IC * IC: progress * IC: enable generics test * make tests green
* IC: backend: remember produced type information (#17440)Andreas Rumpf2021-03-233-9/+46
|
* IC: green tests (#17311)Andreas Rumpf2021-03-194-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * IC: renamed to_packed_ast module to ic module * IC: don't store the --forceBuild flag, makes it easier to test * IC: enable hello world test * Codegen: refactorings for IC; changed the name mangling algorithm * fixed the HCR regressions * life is too short for HCR * tconvexhull is now allowed to use deepCopy * IC exposed a stdlib bug, required a refactoring * codegen: code cleanups * IC: even if a module is outdated, its dependencies might come from disk * IC: progress * IC: better name mangling, module IDs are not stable * IC: another refactoring helping with --ic:on --gc:arc * disable arraymancer on Windows for the time being * disable arraymancer altogether * IC: make basic test work with 'nim cpp' * IC: progress on --ic:on --gc:arc * wip; name mangling for type info
* IC: compilerprocs are handled correctly (#17265)Andreas Rumpf2021-03-095-23/+88
| | | | | | | * 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
* IC: further progress (#17150)Andreas Rumpf2021-03-052-9/+19
| | | | | | | * IC: respect the -f switch * IC: better rod file inspection * progress
* fix `UnusedImport` for `nim c compiler/nim` (#17152)Timothee Cour2021-02-231-3/+4
|
* IC: bugfixes (WIP) (#16836)Andreas Rumpf2021-02-025-26/+106
| | | | | | | | * 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-254-23/+127
| | | | | | | | * 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-235-24/+259
| | | | | | | | | | | * 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
* IC: next steps (#16705)Andreas Rumpf2021-01-142-80/+111
| | | | | | | | | | | * 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
* IC: next steps (#16632)Andreas Rumpf2021-01-125-274/+386
| | | | | | | | | | | | | * removed dead code * beginnings of a rodfile reader * IC: record global VM state changes and pragma state changes * IC: replay pragmas and VM state changes * implemented rod load file simuation for easier, extensive testing * critical bugfix * IC: stress test logic; should also help with recursive module dependencies; WIP * IC: loading from .rod files begins to work reliably * removed ugly hacks * yet another silly mistake
* IC: next steps (#16550)Andreas Rumpf2021-01-073-158/+346
| | | | | | | | | | | | | | | | | | * cleanups * ast.nim: cleanups * IC: no more sym.tab field, stored externally in the module graph * nimble compiles again * rodfiles: store bitwidth of integers and the endianness in the cookie because we serialize 'int' directly * rodfiles: added compilerproc and export sections * rodfiles: added all the missing sections * rodfiles: track the missing information * IC: architecture for lazy loading of proc bodies * make tests green again * completed the lazy loading of proc bodies * symbol lookup integration, part 1 * symbol lookup integration, part 2 * symbol lookup integration, part 3 * make tcompilerapi work again * rodfiles: fixed config change handling
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-026-186/+1057
| | | | | | | | | | | | | | | | | | | * 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>
* refactorings to prepare the compiler for IC (#15935)Andreas Rumpf2020-12-175-0/+724
* added ic specific Nim code; WIP * make the symbol import mechanism lazy; WIP * ensure that modules can be imported multiple times * ambiguity checking * handle converters and TR macros properly * make 'enum' test category green again * special logic for semi-pure enums * makes nimsuggest tests green again * fixes nimdata * makes nimpy green again * makes more important packages work