Commit Graph

68 Commits

Author SHA1 Message Date
Andreas Rumpf
25745ad195 IC: final implementation steps (#16801)
* 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
2021-01-25 20:52:26 +01:00
Andreas Rumpf
8241e55023 IC: next steps (#16729)
* 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
2021-01-23 08:06:15 +01:00
cooldome
58b9191354 fix #16516 method dispatch for sink args (#16594)
* fix #16516

* fix comment

* Trigger build
2021-01-06 10:47:03 +00:00
Andreas Rumpf
73a8b950cb big steps torwards an efficient, simple IC implementation (#16543)
* 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>
2021-01-02 07:30:39 +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
Clyybber
38068f9778 Make explicit {.nimcall.} a seperate calling convention 2020-08-08 12:36:20 +02:00
Andreas Rumpf
fb641483f0 arc optimizations (#13325)
* scope based destructors
* handle 'or' and 'and' expressions properly, see the new test arc/tcontrolflow.nim
* make this branch mergable, logic is disabled for now
2020-03-18 16:57:34 +01:00
Jasper Jenkins
796aafe7e0 make case-object transitions explicit, make unknownLineInfo a const, replace a few magic numbers with consts (#13170) 2020-01-17 10:34:31 +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
Clyybber
ed1d41c51e Small ast.nim cleanup (#12156)
* Remove sonsLen
* Use Indexable
2019-09-09 11:54:15 +02:00
Araq
07d465ca42 [refactoring] remove unused imports in the compiler and in some stdlib modules 2019-07-18 00:36:03 +02:00
Andreas Rumpf
ef8ddef47b fixes #10912 (#11317)
* fixes #10912

* update the tutorial examples
2019-05-24 18:33:53 +02:00
Arne Döring
b92fd30282 rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227) 2019-05-11 10:11:08 +02:00
Clyybber
cc28eef38e Replace countup(x, y) with x .. y 2019-05-07 12:37:28 +02:00
Clyybber
f18b3af9d4 Replace countup(x, y-1) with x ..< y 2019-05-07 12:32:05 +02:00
Miran
afeca3d9fe multi-methods need to be explicitly enabled (#10856)
* multi-methods need to be explicitly enabled

* update changelog, manual and tutorial
2019-03-18 08:21:37 +01:00
Andreas Rumpf
4181baf400 multi-methods: remove hack, make tmethod_various compile under strict C++ [backport] 2019-03-14 09:03:21 +01:00
Araq
366b6be4fb compiler refactoring: TSymSeq is gone for good 2018-12-11 12:37:05 +01:00
cooldome
eaca5be9d6 Change the order of compilation passes, transformation is made lazy at code gen (#8489)
* Ast no transformation
* Add getImplNoTransform to the macros module
* progress on delaying transf
* Fix methods tranformation
* Fix lazy lambdalifting
* fix create thread wrapper
* transform for lambda lifting
* improve getImplTransformed
* Fix destructor tests
* try to fix nimprof for linux
2018-10-18 20:21:25 +02:00
Araq
7ac1e6e528 fixes #5479 2018-10-02 23:31:39 +02:00
LemonBoy
03c8fdc6cb Pick the and symbol we need explicitly (#8249)
Using getSysSym made the compiler pick a random `and` symbol: if the
symbol table is shuffled we may end up selecting one of the wrong
overloads.

Fixes #8246
2018-07-08 22:00:32 +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
Araq
2a7fc84c86 remove ast.emptyNode global; cleanup configuration.nim 2018-05-16 03:06:07 +02:00
Andreas Rumpf
bb8c47b496 pragmas compiles again 2018-05-11 18:53:18 +02:00
Andreas Rumpf
e4081a7201 preparations for language extensions: 'sink' and 'lent' types 2018-01-07 23:09:26 +01:00
Yuriy Glukhov
baf685461b Fixes #5946 (#6017) 2017-06-26 21:31:56 +02:00
Parashurama
2e420dfa38 fixes multiple nil-checks for methods (#5806) 2017-05-12 11:21:43 +02:00
Andreas Rumpf
1268ca79e5 fixes #5599 (#5610) 2017-03-26 09:30:59 +02:00
Araq
d91d338d03 fixes #5432 2017-02-26 00:32:07 +01:00
Araq
fa98edc78c another attempt to make test green again 2017-02-24 15:52:52 +01:00
Andreas Rumpf
f8914cc3b0 fixes a multimethod regression 2017-02-24 13:02:36 +01:00
Andreas Rumpf
46efaf294b big compiler refactoring; avoid globals for multi method dispatcher generation 2017-02-22 16:27:52 +01:00
Araq
e6c5622aa7 removed tyArrayConstr completely from the compiler; introduced tyAlias instead in preparation for further bugfixes 2016-11-14 23:18:30 +01:00
Andreas Rumpf
a6d17b5503 some progress on --symbolfiles:on 2016-11-02 08:39:51 +01:00
Araq
68e30d7d52 tester cleanup; enable some rod tests 2016-08-27 13:38:39 +02:00
Andreas Rumpf
f5fa5dae85 generic multi-methods should work now 2016-07-28 20:23:24 +02:00
Andreas Rumpf
2d8572e948 fixes #4428 2016-07-19 15:24:42 +02:00
trustable-code
3c557a0144 fix issue #3550 2015-12-24 00:07:03 +01:00
Araq
528cf3eae4 better error handling for bug #3550 2015-11-18 13:32:16 +01:00
Araq
698b1fc954 fixes #3550 2015-11-18 12:33:09 +01:00
Araq
aa36e73ecf fixes #3431, fixes #3370, fixes #3468 2015-10-25 02:22:50 +01:00
Yuriy Glukhov
2166b7bc46 Fixed ret by var in js 2015-10-15 16:04:53 +03:00
Araq
dc047931bb fixes #2590; methods now require a .base annotation 2015-09-06 02:31:28 +02:00
Adam Strzelecki
d681812465 compiler: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:03:22 +02:00
Araq
a53e97fc89 Merge branch 'devel' into bigbreak
Conflicts:
	lib/pure/osproc.nim
2014-11-03 22:50:55 +01:00
Reimer Behrends
ce9a57fcfd Fix dispatcher creation for method prototypes.
When method prototypes were involved (e.g. forward declarations
for mutual recursion), calls were sometimes dispatched to the
wrong method implementation. One of the reasons was that method
dispatchers were then not always attached to method ASTs in
the correct place.
2014-11-02 23:35:41 +01:00
Reimer Behrends
1fc8bab643 Reset location when creating a method dispatcher
When creating a method dispatcher, the location of the underlying
method was copied. Under some circumstances, the name of the
location (loc.r) was already initialized, in which case the
method dispatcher shared a name with one of the methods, leading
to a C compiler error. By setting loc.r to nil when copying
the dispatcher information from the original method, we ensure
that the dispatcher C function gets its proper name.
2014-11-01 04:07:42 +01:00
Araq
5946747970 updated the compiler to use the new symbol names 2014-08-28 23:48:42 +02:00
Araq
2781fea9e2 Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00