Commit Graph

59 Commits

Author SHA1 Message Date
Araq
87ac28d19a fixes #14159 [backport:1.2] 2020-05-02 22:31:19 +02:00
Juan Carlos
afd0afe0a3 Deprecate when declared(echo):echo (#13840) 2020-04-02 02:56:18 +02:00
Andreas Rumpf
a0eca75182 sink parameter inference for types that have destructors (#13544)
* ensure capitalize doesn't take an inferred sink parameter

* sink parameter inference: first version, for now disabled. Changed that sink parameters can be consumed multiple times in order to adhere to our spec.

* sink inference can now be disabled with .nosinks; sometimes for proc type interop this is required

* fixes yet another critical DFA bug

* better implementation that also understands if expressions etc

* document sink parameter inference and allow for global disabling
2020-03-04 14:28:53 +01:00
Andreas Rumpf
240174dd81 fixes #13314 (#13372) 2020-02-09 00:22:34 +01:00
Clyybber
e3acb2d12c Cleanup DFA (#13173) 2020-01-16 20:15:50 +01:00
Andreas Rumpf
a5e67071d2 ARC: misc bugfixes (#13156)
* fixes #13102
* closes #13149
* ARC: fixes a move optimizer bug (there are more left regarding array and tuple indexing)
* proper fix; fixes #12957
* fixes yet another case object '=' code generation problem
2020-01-15 22:13:31 +01:00
Andreas Rumpf
1917ebf082 minor refactorings 2019-12-27 08:29:40 +01:00
Araq
7e6e399d10 fixes #12669 2019-11-29 19:46:21 +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
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
Clyybber
029dcc6259 fix #12037 (#12089) 2019-08-30 06:41:26 +02:00
Araq
07d465ca42 [refactoring] remove unused imports in the compiler and in some stdlib modules 2019-07-18 00:36:03 +02:00
Araq
87a2ced1ba there is only one style -- my style 2019-07-10 19:17:06 +02:00
Araq
73c570d1d9 control flow graph: don't ignore yield statements 2019-07-09 20:15:57 +02:00
Andreas Rumpf
cce8a739da fixes #11633 2019-07-01 23:53:41 +02:00
cooldome
0d50b0c8a7 increase dfa instruction limit (#11579) 2019-06-24 22:34:54 -07:00
Andreas Rumpf
c65a5d754b [bugfix] owned closures (#11544) 2019-06-20 07:40:45 +02:00
Miran
bab5e30972 fixes #10963, disallow implicit mixing of strings and ints/floats (#11292) 2019-05-21 21:32:37 +02:00
Clyybber
f18b3af9d4 Replace countup(x, y-1) with x ..< y 2019-05-07 12:32:05 +02:00
Araq
bb8e2eea38 move analyser: fixes another critical bug 2019-04-29 21:06:38 +02:00
Andreas Rumpf
55aa2129b5 make twidgets example green (#11135) 2019-04-28 13:28:18 +02:00
Andreas Rumpf
eb9043c0e9 fixes #11095 (#11104)
* fixes #11095
2019-04-25 07:59:34 +02:00
Andreas Rumpf
bc7d1de7fd added a note about what to not do 2019-04-19 18:02:43 +02:00
Andreas Rumpf
a394d31746 move analyser is smarter; refs #11053 2019-04-19 18:02:43 +02:00
Araq
850e90ac30 DFA: We are not allowed to take ownership of parameters 2019-04-17 17:18:47 +02:00
Araq
ce024a73bf make move-analysis smarter; see tuse_ownedref_after_move test case 2019-04-16 10:35:43 +02:00
Araq
045e026d0e dfa.nim: track object/tuple field accesses more precisely; sink(o.x); sink(o.y) needs to compile; activate the tuple unpacking transf.nim bugfix 2019-04-16 10:35:43 +02:00
Araq
9565b844dd compute sinks/assignments properly for for-loop iteration variables 2019-04-08 13:53:15 +02:00
Andreas Rumpf
bf592c4e94 more destructor based changes (#10885)
* mark user defined destructors with sfOverriden to simplify the logic
* refactoring in preparation to merge liftings and generic instantiations for destructors
* ast: introduce nkHiddenTryStmt for destructor generation in order to be able to optimize better the code later on
* renamed 'patterns' switch to 'trmacros' as it was totally misleading before
* destructors: introduce tfCheckedForDestructor flag in preparation of strict =destroy checking
* test for invalid/too late destructor introductions
* liftdestructors: make code robust for nimsuggest
* --newruntime works for hello world again
* newruntime: code generation for closures
2019-03-23 00:12:05 +01:00
Andreas Rumpf
f8bf24623c explicit default values for a leaner codegen, .cursor variables for optimization 2019-03-07 12:50:33 +01:00
Andreas Rumpf
cfd5210405 dfa.nim: continues are bad 2019-03-06 09:00:06 +01:00
Andreas Rumpf
4be36d77f6 introduce tfHasOwned for fast must-move checkings; removed tfAcyclic as the GC has ignored this hint for quite some time now 2019-03-05 19:58:54 +01:00
Andreas Rumpf
9c6b628df6 DFA: fixes wrong 'def' instruction emission 2019-03-05 05:54:08 +01:00
Andreas Rumpf
3e922d0fec destructors/dfa: more documentation 2019-03-04 22:41:50 +01:00
cooldome
690f21043d isLastRead regression fix (#10463)
* fixes #10462

* add a test
2019-01-28 08:32:14 +01:00
Andreas Rumpf
11022fea1b control flow graphs: introduce 'join' points for easy analyses based on abstract interpretation 2019-01-23 11:08:51 +01:00
Timothee Cour
beed27b75d improve vmgen.codeListing formatting (#10306)
* improve vmgen.codeListing formatting
* address comments
2019-01-15 19:02:01 +01:00
Andrii Riabushenko
dc935f2b41 use control flow graph for sink params 2018-12-09 18:32:43 +00:00
Araq
234bed1b38 destructors; fixes #9594 2018-11-02 11:29:31 +01:00
Andreas Rumpf
b39302b0d2 DFA: implement exception handling properly 2018-10-14 17:36:55 +02:00
Andreas Rumpf
33cdae8c32 dfa.nim: clarify exception handling 2018-10-13 08:28:56 +02:00
Andreas Rumpf
2fecf4f36a compiler: cleanup dfa.nim 2018-10-12 19:56:51 +02:00
Araq
40e01d8549 don't require an implementation for procs marked with .error; activate the move optimizer for destructors 2018-09-29 16:54:59 +02:00
Andreas Rumpf
669a564492 remove more global variables in the Nim compiler 2018-05-27 11:10:56 +02:00
Andreas Rumpf
feef109e60 make tests green again 2018-05-18 20:53:41 +02:00
Andreas Rumpf
bf6c2c5ccf preparations of making compiler/msgs.nim free of global variables 2018-05-17 15:21:22 +02:00
Andreas Rumpf
fedc136985 transf and vmgen compile again 2018-05-12 09:38:41 +02:00
Andreas Rumpf
1310279691 lambda lifting compiles again 2018-05-12 08:30:55 +02:00
Andreas Rumpf
47335aab41 introduce nkTupleConstr AST node for unary tuple construction; breaking change 2018-04-13 17:45:58 +02:00
Andreas Rumpf
a74dfcfd00 DFA: code cleanups and some support for consuming operations 2017-12-27 12:22:47 +01:00