Commit Graph

69 Commits

Author SHA1 Message Date
ringabout
7be2e2bef5 replaces doAssert false with raiseAssert for unreachable branches, which works better with strictdefs (#22436)
replaces `doAssert false` with `raiseAssert`, which works better with strictdefs
2023-08-10 14:26:40 +02:00
ringabout
93ced31353 use strictdefs for compiler (#22365)
* wip; use strictdefs for compiler

* checkpoint

* complete the chores

* more fixes

* first phase cleanup

* Update compiler/bitsets.nim

* cleanup
2023-08-06 14:26:21 +02:00
heterodoxic
546af8c571 simple micro-optimizations of ropes' runtime-formatting (#21962) 2023-05-30 13:41:56 +02:00
Andrey Makarov
081dfea746 Fix "imported but not used" warnings (#20575) 2022-10-16 20:24:16 +02:00
Andreas Rumpf
ca1f3f36b9 no ropes WIP (#20433)
* 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
2022-09-27 10:57:47 +02:00
ringabout
97259a5ab3 fixes #19713; Revert "Remove tlsEmulation enabled from Windows + GCC config" (#19119) (#20327)
* Revert "Remove tlsEmulation enabled from Windows + GCC config (#19119) [backport:1.6]"

This reverts commit 77b696c2c9.

* increase nimTlsSize to 48000

* enable for windows

* fixes tests

* fixes tlsEmulation:on
2022-09-19 09:16:54 +02:00
ringabout
b6bfe38ff5 move formatfloat out of system (#20195)
* move formatfloat out of system

* fixes doc

* Update changelog.md

* careless

* fixes

* deprecate system/formatfloat

* better handling
2022-08-24 13:38:30 +02:00
flywind
ed2bf02a51 remove when declared(cache); cache is always there (#19991) 2022-07-10 09:37:15 +02:00
flywind
dcb28fd061 cache rope when threads are enabled (#19981)
* cache rope

* add threadvar
2022-07-07 14:14:05 +02:00
flywind
7f6e800caf move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
Evan Typanski
207237cec2 Fix #18662 (#19534) 2022-02-28 13:18:41 +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
cc28eef38e Replace countup(x, y) with x .. y 2019-05-07 12:37:28 +02:00
Arne Döring
abb05ab645 fewer ropes (#11037) 2019-04-19 09:05:31 +02:00
Andreas Rumpf
c86b1fbcac fixes a critical GC safety inference bug (#10615)
* fixes a critical GC safety inference bug
* make nimsuggest compile again
* make Nimble compile again
2019-03-05 19:54:44 +01:00
Andreas Rumpf
86556ebfdb compiler refactoring; use typesafe path handing; docgen: render symbols between modules 2018-09-07 19:21:16 +02:00
Andreas Rumpf
dae5450947 WIP: disallow 'nil' for strings and seqs 2018-08-13 11:41:33 +02:00
Andreas Rumpf
669a564492 remove more global variables in the Nim compiler 2018-05-27 11:10:56 +02:00
Andreas Rumpf
a4e2b0c153 platform.nim doesn't use globals anymore; prepare msgs.nim for not using globals 2018-05-18 15:18:00 +02:00
Andreas Rumpf
b2c7910fb6 compiler/ropes.nim has no global error handler anymore 2018-05-17 15:45:41 +02:00
Araq
f89218c8b0 fixes #7730, fixes #7746 2018-05-02 08:27:19 +02:00
Andreas Rumpf
7e0540ed80 the compiler does not rely on the zero terminator anymore 2018-04-29 01:09:05 +02:00
Zahary Karadjov
c446806f75 improve the debugging experience when line directives are used 2017-09-04 18:17:22 +03:00
Andreas Rumpf
ff3cf001a3 fixes #4656; ropes.nim checks properly for file equality 2016-08-26 18:00:12 +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
Jacek Sieka
ff914b89d3 compiler_ropes: more lib_ropes porting 2015-04-08 23:30:03 +08:00
def
39049e151f Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
Jacek Sieka
0f131b9f46 ropes: remove more unnecessary checks 2015-04-03 23:30:42 +08:00
Jacek Sieka
d7a42641ab compiler_ropes: remove unnecessary length check
frmt[frmt.len] isn't an out-of-bounds access for strings (!)
2015-04-03 23:21:19 +08:00
Jacek Sieka
71e785904b compiler_ropes: deprecate old function names 2015-04-01 22:32:15 +08:00
Jacek Sieka
a9ef5bf459 compiler_ropes: TRope -> RopeObj, PRope* -> Rope* 2015-04-01 22:32:15 +08:00
Jacek Sieka
bcdb5b0836 compiler_ropes: toRope -> rope 2015-04-01 22:32:15 +08:00
Jacek Sieka
aafbe5c866 ropes: make lib & compiler frmt more similar, fix out-of-bounds accesses in lib ropes 2015-04-01 22:32:15 +08:00
Jacek Sieka
91f42a2943 compiler_ropes: ropef -> %, appf -> addf 2015-04-01 22:32:15 +08:00
Jacek Sieka
171996465f compiler_ropes: ropeEqualsFile -> equalsFile, no more max rope component length
read file data in bigger blocks, avoiding lots of file api calls

also removed crc step - seems easier to simply compare the bytes rather
than calculating two crc's
2015-04-01 22:32:15 +08:00
Jacek Sieka
80ee28daf7 compiler_ropes: add & and add
Invokations still need to be updated, but that's a lot of changes, so
save for later
2015-04-01 22:32:15 +08:00
Jacek Sieka
c40249cd43 compiler_ropes: ropeToStr -> $ 2015-04-01 22:32:15 +08:00
Jacek Sieka
b4e4ea8d1b compiler_ropes: don't expose newRope 2015-04-01 22:30:39 +08:00
Jacek Sieka
97d2df9bac compiler_ropes: ropeLen -> len 2015-04-01 22:30:39 +08:00
Araq
a541be8935 prepare for upcoming parsing change of unary operators 2015-03-22 09:31:15 +01:00
Federico Ceratto
657dca5c3b Fix typos 2015-02-15 16:20:32 +00:00
Araq
2781fea9e2 Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
Araq
2f43fdb837 renamefest 2014-08-23 01:43:49 +02:00
Zahary Karadjov
afddae5aaf Merge branch 'upstream' into devel
Conflicts:
	compiler/ccgutils.nim
	compiler/msgs.nim
	compiler/sem.nim
	compiler/semexprs.nim
	compiler/seminst.nim
	compiler/semmagic.nim
	compiler/semstmts.nim
	compiler/semtypes.nim
	compiler/semtypinst.nim
	compiler/sigmatch.nim
	compiler/types.nim
	compiler/vmgen.nim
	lib/core/macros.nim
	lib/system.nim
	tests/reject/tenummix.nim
	web/news.txt
2013-12-29 17:21:00 +02:00
Araq
438703f59e case consistency: next steps 2013-12-29 01:13:51 +01:00
Araq
92b8fac94a case consistency part 4 2013-12-27 23:10:36 +01:00
Araq
2df9b442c6 case consistency part 1 2013-12-27 15:48:53 +01:00
Zahary Karadjov
027f30610e static params: expr[T] is now static[T]
This introduces tyStatic and successfully bootstraps and handles
few simple test cases.  Static params within macros are no longer
treated as PNimrodNodes - they are now equivalent to constants
of the designated type.
2013-12-19 01:06:38 +02:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Zahary Karadjov
d0edb1826b adds an option to interleave the generated code with snippets from the original source
Lines from the original source are outputted as comments next to line directives.
Hopefully, this will make debugging codegen problems easier.

Other changes:
The frame setup code now uses a single-line C macro. My motivation was to reduce
the noise in the generated output and make it easier to step over the boiler-plate
code, but counter-intuitively this also improved the overall compilation speed a
little bit so I applied the same treatment to line tracking too (this reduces the size of
the generated files and the explanation is that probably the I/O overhead dominates
the macro expansion costs).
2012-12-02 20:36:29 +02:00