Commit Graph

315 Commits

Author SHA1 Message Date
Saem Ghani
72b89eff82 semLambda removed, semProcAux reworked (#17379)
* simplified proc-like name ident to symbol code

* wip - reworking generic param sem

* wip - closer to removing nkEmpty generic params

* it's hacky but tests pass

* slowly tweaking semProcAux to take on semLambda

* fix pragma superset check proto vs current

* Set the symbol owner earlier

* partial progress reworking proto

found bug where default values between forward and impl lead to overload
resolution issues.

* simplified pragma handling and callConv checks

Co-authored-by: Clyybber <Clyybber@users.noreply.github.com>

* partially working

* cgexprs issue

* It works!

* comment clean-up

* clean-up asserts, comments, and other bits

* add isGenericParams, inline isGeneric queries

* seeing if this is sufficiently consistent
* can use this approach or continue it in a further PR

* commentary about nullary generics and clean-ups

* fixed a mistake in PNode isGenericRoutine

* Some small cleanups

* Small cleanup

* for func lambdas ensure we use lambda pragmas

* add some basic compileTime func tests

* [ci skip] remove comments

Co-authored-by: Clyybber <Clyybber@users.noreply.github.com>
Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-03-17 19:51:50 +01:00
Andreas Rumpf
2f213db7ee fixes #11225; generic sandwich problems; [backport:1.2] (#17255)
* fixes #11225; generic sandwich problems; [backport:1.2]
* progress
* delegating these symbols must be done via 'bind'
2021-03-09 20:19:24 +01:00
flywind
171b03c386 fix #17264 [backport:1.4] (#17266)
* fix #17264
* fix vm
* fix js and add tests
2021-03-05 14:39:46 +01:00
Saem Ghani
260a5dacb7 fixed dot operator recursive loop & macro suggest (#16922)
* basic stability improvements; refs nimsuggest
* fixed dot operator recursive loop & macro suggest
* hacky fix for run away dot operator sem check

Committing this mostly to make the issue more clear. Perhaps get better
feedback.

* semExprWithType seems like a better place to check
* fixed error messages const case expressions
* Clean-up test
* stopped the dot operator madness

No longer get infinite recursion when seming broken code with a dot
operator macro like in jsffi.

Co-authored-by: Araq <rumpf_a@web.de>
2021-02-15 09:51:05 +01:00
Timothee Cour
f6c2450cdb fix #16555, fixes #16405: len, high honors '\0' for cstring in vm (#16610) 2021-01-11 10:16:20 +01:00
Andreas Rumpf
796498525a IC: next steps (#16550)
* 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
2021-01-07 20:26:40 +01:00
flywind
95f599ca2d move asciitables to std/private/ (#16498)
* move asciitables

* minor
2020-12-29 16:20:47 +01:00
Timothee Cour
357729639f fix #16469 vm float constants: do not conflate -0.0 and 0.0 (#16470)
* fix #16469 vm float constants: do not conflate -0.0 and 0.0

* fix test for 32bit
2020-12-27 14:35:01 +01:00
Timothee Cour
bc84d9c8cb [backport => 1.0] fix #16428 vmops now works for generic procs (#16429)
* fix #16428 vmops now works for generic procs

* remove duplication
2020-12-22 02:05:21 +01:00
flywind
1e320bc8c5 [docs minor]space for code-block (#16266)
* [docs minor]space for code-block

* correct more errors

* to runnableExamples

* add newline
2020-12-06 09:54:32 +01:00
Timothee Cour
c731f7ab14 fixes #15939, fixes #15464, fixes #16169, fixes #16226 VM now supports addr(mystring[ind]) (index + index assignment) (#15987)
* fix #15939, fix #15464 VM now supports `addr(mystring[ind])` (index + index assignment), var char return etc
* cleanups
* cstring tests
* add test for bug #15464
* improve test coverage
2020-12-03 16:55:43 +01:00
flywind
e6e1e9574d combine PR#16009 and PR#16012 (#16024)
* fix #15623
* add testcase for #15623
* add testcase
* combine #16009
* support casting nil to NilableTypes in VM
2020-11-18 08:28:05 +01:00
Andrey R (cooldome)
632af8afad Revert "follow #16009 VM supports cast nil to ptr (#16012)"
This reverts commit fec19c980e.
2020-11-17 18:54:33 +00:00
flywind
fec19c980e follow #16009 VM supports cast nil to ptr (#16012)
* follow #16009 VM supports cast nil to ptr

* more testcase
2020-11-17 10:47:01 +00:00
flywind
a8af664e8b fix #15463 (#15831) 2020-11-05 14:00:08 +01:00
flywind
5b4c17b5e7 Closure iterators are not supported by VM (#15818) 2020-11-02 10:58:14 +01:00
flywind
558115fa29 fixes #15717 2020-11-02 10:27:48 +01:00
Timothee Cour
d4c2e2c53f fix #15704 #15597 wrong VM register was freed (#15705)
* fix #15704 #15597 wrong VM register was freed

* same treatment for nkCheckedFieldExpr

* note concerning HighRegisterPressure

* bump NimPatch

* Update lib/system.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-10-26 09:13:37 +01:00
Andreas Rumpf
226595515c explicit ID generation for easier IC (#15559)
* 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)
2020-10-25 08:50:47 +01:00
Timothee Cour
64eb62889a [minor] nimVMDebug: fix codeListing formatting for jump-to-file to work (#15711) 2020-10-25 01:56:07 +03:00
cooldome
ae320b4e7d fix #15662 (#15678)
* fix #15662

* alternative fix

* fix spacing
2020-10-23 11:14:54 +02:00
Andreas Rumpf
4e438f9096 const view types; fixes some cases from https://github.com/nim-lang/Nim/issues/15428 (#15488) 2020-10-05 18:31:46 +02:00
Miran
6a621b35e7 fix warnings for deprecated low and high (#15291) 2020-09-11 01:04:07 +02:00
Clyybber
13e659cfec Big compiler Cleanup (#14777) 2020-08-28 22:18:09 +02:00
Andreas Rumpf
71dd5f85b9 'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011) 2020-07-20 07:50:19 +02:00
Timothee Cour
e30a08103d remove tyOpt, mOpt (#14636)
* remove tyOpt, mOpt

* fixup
2020-06-12 11:03:52 +02:00
Timothee Cour
66db9de714 CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static checks (#13926)
* -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper
* cleanups
* import sizeof at CT for {.completeType.}
* address comments; revert default enabling of -d:checkAbi for now
* mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor
* all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
2020-04-23 11:24:09 +02:00
Arne Döring
2f557652d4 fix operators containing percent for VM usage (#13536)
* fixes #13513
* merge tarithmetics in tarithm
2020-03-11 01:01:25 +01:00
Arne Döring
eb42f38088 Remove dead magics (#13551) 2020-03-03 12:42:43 +01:00
cooldome
c79df2fb6a EndsInNoReturn in expressions extension, fixes #13490 (#13520)
* fix #13490
2020-02-28 09:55:06 +00:00
Timothee Cour
13c08f3ab4 VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (#12877)
* VM: allow certain hardcoded special var variables at CT
* VM: allow all importc var, cast[int](ptr)
* fix tests tests/vm/tstaticprintseq.nim, tests/cpp/t8241.nim
* VM: == works for ptr/pointer nodes
* bugfix: ==, cast now also works for pointer, not just ptr
* VM supports cast PtrLikeKinds <=> PtrLikeKinds / int
* improve cname handling
* fixup + bug fix
* VM: support cast from ref to int
* address comment: opcLdGlobalDeref => opcLdGlobalDerefFFI
* defensive check against typ == nil
2020-01-05 09:11:29 +01:00
Ico Doornekamp
6aade97fe8 Refactored VM registerlayout. The size and location of the registers in (#12775)
the instructions are now all derived from a single definition, allowing
the register layout to be changed.
2019-11-30 13:38:36 +01:00
Araq
0996eb174f fixes #11727 [backport] 2019-11-28 23:00:34 +01:00
Araq
87f0d534d6 fixes #12488 [backport] 2019-11-28 23:00:34 +01:00
Clyybber
7e747d11c6 Cosmetic compiler cleanup (#12718)
* Cleanup compiler code base

* Unify add calls

* Unify len invocations

* Unify range operators

* Fix oversight

* Remove {.procvar.} pragma

* initCandidate -> newCandidate where reasonable

* Unify safeLen calls
2019-11-28 17:13:04 +01:00
Andreas Rumpf
abe07eb75d VM: improvements for var T/addr (#12667); fixes #12489 2019-11-28 09:56:02 +01:00
Andreas Rumpf
56a00da34a fixes #12612 [backport] (#12681) 2019-11-19 12:09:36 +01:00
Andreas Rumpf
a14abc5708 ARC: solves phase ordering problems (#12654) 2019-11-14 23:19:18 +01:00
Araq
1214960a1b fixes #12547 [backport] 2019-10-29 15:07:04 +01:00
Andreas Rumpf
e0d13abaff VM: fixes register leaks [backport] (#12510) 2019-10-25 00:45:06 +02:00
Andreas Rumpf
801a794039 VM: fixes most ran-out-registers problems [backport] (#12485) 2019-10-24 17:29:32 +02:00
Andreas Rumpf
38b3590e40 fixes #12310 [backport] (#12470) 2019-10-20 22:37:31 +02:00
Andreas Rumpf
1964589a29 fixes #12294 [backport] 2019-09-30 20:01:25 +02:00
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
Andreas Rumpf
162d74db91 fixes #10981; fixes #7261 (#12217) 2019-09-19 14:34:56 +02:00
Arne Döring
188ce5f3ee add nodeId proc to macros (#11456)
* add nodeId proc to macros

* add doc comment.

* fix typo
2019-09-18 20:02:30 +02:00
Arne Döring
638a4d9d9f rename cast opcodes, fix for 32bit cast, fix python pretty printer (#12207) 2019-09-18 09:04:37 +02:00
Araq
f1b7c0494e fixes #12195 2019-09-17 15:15:12 +02:00
Clyybber
ed1d41c51e Small ast.nim cleanup (#12156)
* Remove sonsLen
* Use Indexable
2019-09-09 11:54:15 +02:00
Andreas Rumpf
ac6fcab7a4 Merge branch 'devel' into uint-range-checks 2019-09-02 22:03:10 +02:00