summary refs log tree commit diff stats
path: root/compiler/sempass2.nim
Commit message (Collapse)AuthorAgeFilesLines
* correct effect tracking for .borrowed procs [backport] (#18882)Andreas Rumpf2021-09-231-4/+9
| | | | | | | | | | | * correct effect tracking for .borrowed procs [backport] * progress * fix error message in a test * correctly fix it Co-authored-by: narimiran <narimiran@disroot.org>
* we need something better than warningAsError for effect handling viol… ↵Andreas Rumpf2021-09-041-2/+2
| | | | | | (#18796) * we need something better than warningAsError for effect handling violations
* implements https://github.com/nim-lang/RFCs/issues/407 (#18793)Andreas Rumpf2021-09-031-0/+2
|
* fixes #18786 (#18788)Andreas Rumpf2021-09-031-6/+5
|
* strict effects (#18777)Andreas Rumpf2021-09-021-31/+85
| | | | | | | | | | | | | | | | | * fixes #17369 * megatest is green for --cpu:arm64 * docgen output includes more tags/raises * implemented 'effectsOf' * algorithm.nim: uses new effectsOf annotation * closes #18376 * closes #17475 * closes #13905 * allow effectsOf: [a, b] * added a test case * parameters that are not ours cannot be declared as .effectsOf * documentation * manual: added the 'sort' example * bootstrap with the new better options
* mitigates #12815 (#18557)Andreas Rumpf2021-07-221-2/+6
| | | | | | | | | * mitigates #12815 * Update doc/nimc.rst Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fixes #12815 (#18554)Andreas Rumpf2021-07-221-1/+4
|
* fixes #18550 (#18553)Andreas Rumpf2021-07-211-0/+16
| | | | | * fixes #18550 * update the manual to reflect reality
* Extended side effect error messages (#18418)quantimnot2021-07-151-17/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extended side effect error messages * Applied feedback: - refactored `markSideEffect` - refactored string interpolations - single message - skip diagnostics in `system.compiles` context Other: - started a test of diagnostic messages [ci skip] Tests aren't updated yet because messaging isn't nailed down. * - Added hints of where for side effect call locations. - Tried to clarify the reasons. * fix tests * Applied PR review feedback: - moved collection of side effects from TSym to TContext - used pragma shorthand form `.sideEffect` and `.noSideEffect` in messages - added leading '>' to structured messages for readability - changed `sempass2.markSideEffect` to a proc - replaced `system.echo` in the test to make the test compatible with Windows * Applied NEP1 formatting suggestion Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* fixes #18240 (#18354)Andreas Rumpf2021-06-251-12/+25
| | | | | * ORC: track escaping parameters properly * fixes #18240
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-1/+1
| | | | cstring, not cString (#17744)
* implement RFCs/294 ; disallow enum <=> enum conversion (#16351)Timothee Cour2021-04-031-3/+3
| | | | | | | | | | | * fix https://github.com/nim-lang/RFCs/issues/294 ; disallow enum <=> enum conversion * fix the runnableExamples that was the instigator of this RFC * legacy -d:nimLegacyConvEnumEnum * use -d:nimLegacyConvEnumEnum in important_package nimgame2 * add test for enum cast * improve changelog * add changelog: Changes affecting backward compatibility * cleanup changelog * fix changelog
* better error messages for .raise effect analysis (#17595)Andreas Rumpf2021-03-311-5/+7
|
* added nkError to the AST (#17567)Andreas Rumpf2021-03-291-1/+3
| | | | | | | | | | | | | * added nkError to the AST * Update lib/core/macros.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update compiler/ast.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fixes a bug that keeps Nimbus from compiling with --gc:orc (#17005)Andreas Rumpf2021-02-111-2/+15
| | | | | * fixes a bug that keeps Nimbus from compiling with --gc:orc * better fix
* IC: next steps (#16729)Andreas Rumpf2021-01-231-6/+6
| | | | | | | | | | | * 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
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-1/+1
| | | | | | | | | | | | | | | | | | | * 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>
* Nil type check implementation (#15287)Alexander Ivanov2020-12-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Nil checking * Enable current older not nil checking again, run new checking only under flag, skip our test * Enable tests, work on try/except and bugs, fix notnil tests * Enable strictNotNil tests (currently with lowercase category) and add some expected output * Work on try/except/finally: still some things unclear and a lot of code can raise out of try * Fix the notnil build by going back to the old version of a test which I shouldn't have changed * Fix test : use action compile * Work on mutation and aliasing: not finished * Render var parititions graph, try to understand it, fix a nilcheck if bug * Rebase, progress on working with partitions * Improve time logic * Fix some bugs, use graph indices instead of symbol in nil map * Fix bugs, test simpler ident aliasing for now, support two mutation levels * Support ContentMutation and ReAssignment: for now just detect possible re assignment for var parameters of calls * Enable several simple passing tests * Cleanup a bit, fix condition/branch infix-related bug * Remove some files, address some comments by Araq * Use internalError and no quit for now * Separate tests with expected warnings and with expected ok, fix a bug with if with a single branch related to copyMap * Fix new data structures, bugs: make tests pass, disable some for now * Work on fixing errors with non-sym nodes, aliasing: tests fail * Work on alias support: simple set-based logic, todo more tests and ref sets? * Use ref sets: TODO can we think of handle seq-s similar to varpartitions' Araq ones * Handle defers in one place, stop raising in reverse to make an async test compile with strictNotNil, add a commented out test * Dot expressions: call/reassignment. Other refactorings and distinct, SeqOfDistinct support. Checkout an older varpartitions * Work on field tracking * Backup : trying to fix bugs when running some stdlib stuff for running an async test * Start a section about strict not nil checking in experimental manual * Fix experimental strict not nil manual section and move it to another file based on Araq feedback * Fix unstructured flow and double warning problems, fix manual, cleanup * Fix if/elif/else : take in account structure according to Araq feedback * Refactor a bit * Work on bracket expr support, re-enable tests, clarify in manual/tests/implementation static index support for now * Work on compiling stdlib and compiler with strictNotNil * Small fixes to the manual for strictNotNil * Fix idgen for strict check nil rebase * Enable some simple tests, remove old stuff, comment out code/print * Copy the original varpartitions source instead of my changes * Remove some files
* fix #16120 (#16145)cooldome2020-11-261-52/+52
|
* fix #15707 (#15870)cooldome2020-11-091-2/+2
|
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-9/+9
| | | | | | | | | | | | | | | | | * 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)
* Tables, use sink val arguments more actively (#15625)cooldome2020-10-191-19/+20
|
* renamed '=' to '=copy' [backport:1.2] (#15585)Andreas Rumpf2020-10-151-1/+2
| | | | | | | | | * Assign hook name changed to `=copy` * Adapt destructors.rst * [nobackport] Duplicate tests for =copy hook * Fix tests * added a changelog entry Co-authored-by: Clyybber <darkmine956@gmail.com>
* fixes #15510 (#15523)Andreas Rumpf2020-10-081-1/+4
|
* effects: exclude swap() from "indirect calls" assumption (#15504)Paul Tan2020-10-061-1/+1
| | | | | swap() will never call any procs passed to it, and so it can be safely excluded from the "assume indirect calls are taken" effects tracking rule.
* New hint for unused exceptions in .raises (#15492)IDF2020-10-061-3/+5
| | | | | | | * New hint for unused exceptions in .raises * Fix effects test * Further adapt teffects1.nim
* implements https://github.com/nim-lang/RFCs/issues/258 (#15503)Andreas Rumpf2020-10-061-26/+82
| | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/258 * don't be too strict with custom pragma blocks * cast pragmas: documentation * added most missing inference query procs to effecttraits.nim
* refactoring, fixes yet another strictFuncs regression (#15446)Andreas Rumpf2020-10-011-1/+4
|
* spec for view types (#15424)Andreas Rumpf2020-09-291-2/+2
| | | | | | | | | | | * spec for view types * spec additions * refactoring; there are two different kinds of views * refactorings and spec additions * enforce that view types are initialized * enforce borrowing from the first formal parameter * enforce lifetimes for borrowing of locals * typo in the manual * clarify in the implementation what a borrow operation really is
* more precise borrow checking of 'result' (#15406)Andreas Rumpf2020-09-241-1/+1
|
* fixes #15403 (#15404)Andreas Rumpf2020-09-241-1/+2
|
* borrow checking (#15282)Andreas Rumpf2020-09-091-2/+5
| | | | | | | | | | | * refactoring: move procs to typeallowed.nim * frontend preparations for first class openArray support * prepare the code generator for first class openArray * code generation for first class openArray; WIP * code generation for open arrays, progress * added isViewType proc * preparations for borrow checking * added borrow checking to the front end
* Expand hoisted default params in sem (#15270)Clyybber2020-09-051-1/+1
| | | | | | | | | * Expand hoisted default params in sem Introduce ast.newTree{I,IT} Add test for default params in procs * Cleanup * Simplify hoist transformation and expand test
* fix #15238 (#15262)cooldome2020-09-041-0/+1
| | | | | * fix_15238 * fix test
* fixes #15129 [backport:1.2] (#15144)Andreas Rumpf2020-08-011-1/+1
|
* fixes #15122 [backport:1.2] (#15139)Andreas Rumpf2020-08-011-0/+1
|
* cursor and mutation tracking fixes (#15113)Andreas Rumpf2020-07-301-0/+2
| | | | | | | | * fixes #15110 * fixes #15096 * prepare varpartitions for cursor inference * new cursor inference begins to work * make tests green
* fixes #15076 (#15095)Andreas Rumpf2020-07-271-15/+14
|
* fixes #15038 [backport:1.2]Andreas Rumpf2020-07-261-0/+2
|
* strict func: much better error messages (#15068)Andreas Rumpf2020-07-251-2/+3
| | | | | * strict func: much better error messages * documented the 'strict funcs' mode
* writing to a location counts as "side effect"; implements ↵Andreas Rumpf2020-07-251-4/+7
| | | | https://github.com/nim-lang/RFCs/issues/234 (#15030)
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-96/+123
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* more precise analysis about 'observable stores' [backport:1.2] (#14582)Andreas Rumpf2020-06-061-1/+5
|
* fix #14314 do not analyze importc procs for effects (#14319)Timothee Cour2020-05-121-1/+6
|
* do not track 'raise Defect' in the .raises: [] clause anymore (#14298)Andreas Rumpf2020-05-111-1/+4
| | | | | | | | | * do not track 'raise Defect' in the .raises: [] clause anymore * --panics:on maps 'raise Defect' to an unrecoverable fatal error * make tests green again * update the documentation too
* fixes #14177Araq2020-05-021-2/+3
|
* fixes #14079 [backport:1.2] (#14163)Andreas Rumpf2020-04-291-1/+2
|
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-1/+1
| | | | | | | | | | | | | | * 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.
* drnim: tiny progress (#13882)Andreas Rumpf2020-04-151-61/+22
| | | | | | | | | | | * drnim: tiny progress * refactoring complete * drnim: prove .ensures annotations * Moved code around to avoid code duplication * drnim: first implementation of the 'old' property * drnim: be precise about the assignment statement * first implementation of --assumeUnique * progress on forall/exists handling
* added an .assert pragma and mentioned the pragmas in the changelogAraq2020-04-021-1/+1
|