Commit Graph

33 Commits

Author SHA1 Message Date
Timothee Cour
e112974920 fix #16752: threadvar now works with importcpp types; osx now uses native TLS (--tlsEmulation:off), which can be orders of magnitude faster (#16750)
* osx now uses native TLS, which can be orders of magnitude faster

* add {.cppNonPod.}

* improve test

* changelog, docs, disable part of windows test
2021-01-27 22:35:43 +01:00
Andreas Rumpf
bc712c28fc fixes #14865 (#14937) 2020-07-08 18:59:34 +02:00
Timothee Cour
9502e39b63 nim doc --backend:js, nim doc --doccmd:-d:foo, nim r --backend:js, --doccmd:skip + other improvements (#14278)
* `nim doc --backend:js|cpp...`
`nim doc --doccmd:'-d:foo --threads:on'`
`nim r --backend:cpp...` (implies --run --usenimcache)
* --usenimcache works with all targets
* --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
2020-05-11 12:01:18 +02:00
alaviss
f500895efe Unexport even more symbols (#13214)
* system/gc: don't export markStackAndRegisters

* compiler/cgen: unexport internal symbols

As these functions are Nim-specific walkaround against C's optimization
schemes, they don't serve any purpose being exported.

* compiler/cgen: don't export global var unless marked

* compiler/ccgthreadvars: don't export threadvar unless marked

* tests/dll/visibility: also check for exports

This ensure that these changes don't break manual exports.

* compiler/cgen: hide all variables created for constants

* compiler/ccgtypes: don't export RTTI variables

* compiler/ccgexprs: make all complex const static

* nimbase.h: fix export for windows

* compiler/cgen, ccgthreadvars: export variables correctly

For C/C++ variables, `extern` means that the variable is defined in an
another unit. Added a new N_LIB_EXPORT_VAR to correctly export
variables.
2020-01-23 13:45:31 +01:00
Andreas Rumpf
c3344862b0 --exception:goto switch for deterministic exception handling (#12977)
This implements "deterministic" exception handling for Nim based on goto instead of setjmp. This means raising an exception is much cheaper than in C++'s table based implementations. Supports hard realtime systems. Default for --gc:arc and the C target because it's generally a good idea and arc is all about deterministic behavior.

Note: This implies that fatal runtime traps are not catchable anymore! This needs to be documented.
2020-01-01 10:01:49 +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
Arne Döring
1da98b1636 Less ropes (#10979)
* convert ropecg to a macro
* fewer intermediate ropes
2019-04-11 09:48:10 +02:00
Andreas Rumpf
5ad1acc60c remove the last global variables in the C code generator 2018-05-28 18:18:43 +02:00
Andreas Rumpf
328e7a1005 options.nim: no global variables anymore 2018-05-13 17:52:21 +02:00
Andreas Rumpf
1284827df2 C code generator compiles again 2018-05-12 23:45:51 +02:00
Araq
57874ed9b8 C++ codegen: emit 'extern C' for importc'ed functions that we declare a prototype for 2017-02-14 14:39:53 +01:00
Andreas Rumpf
fab69661ad new name mangling rules for easier debugging 2017-02-02 16:27:48 +01:00
Andreas Rumpf
3ac6bd8ae1 refactoring: flags instead of bools 2016-05-18 12:40:01 +02:00
Erik Johansson Andersson
f8d98700ac nimrod -> nim 2016-02-05 19:11:43 +01:00
def
39049e151f Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
Araq
a585caebcd bugfix: c++ support for 'NimThreadVarsSize' 2014-10-08 09:10:57 +02:00
Araq
2781fea9e2 Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
Araq
b731e6ef1c case consistency: cs:partial bootstraps on windows 2013-12-29 03:19:10 +01:00
Araq
2df9b442c6 case consistency part 1 2013-12-27 15:48:53 +01:00
Zahary Karadjov
6ddd4e6a3f Revert "Revert "bugfix: emulated thread vars used in combination with the mark & sweep GC""
This reverts commit 75c586bbe1.
2013-08-19 01:27:05 +03:00
Araq
75c586bbe1 Revert "bugfix: emulated thread vars used in combination with the mark & sweep GC"
This reverts commit 420789c278.
2013-05-27 23:20:20 +02:00
Zahary Karadjov
420789c278 bugfix: emulated thread vars used in combination with the mark & sweep GC
resulted in invalid code generation
2013-05-26 11:14:23 +03:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Zahary Karadjov
b11fe5d0b4 more uint related fixes 2012-06-14 17:33:00 +03:00
Zahary Karadjov
df1ec09399 proper indentation in the generated C code 2012-06-12 04:43:58 +03:00
Zahary Karadjov
20d56875de fix threading tests 2012-04-15 02:52:09 +03:00
Zahary Karadjov
d2b45dbe85 C variables are created in their enclosing block instead of their enclosing function 2012-04-12 14:12:32 +03:00
Araq
4f1b89c30c year 2012 for most copyright headers 2012-01-02 23:07:35 +01:00
Araq
5e5e4abfee new compiler option tlsEmulation 2011-10-27 21:03:53 +02:00
Araq
bd1cb9e77b compilation cache: methods have a chance to work 2011-10-23 11:24:52 +02:00
Araq
5b96eaa953 preparations for 0.8.12 2011-07-10 15:48:13 +02:00
Araq
99bcc233cd bugfix: 'set' overloadable; further steps for multi threading support 2011-07-08 01:29:15 +02:00
Araq
4fa80956b8 compiler can emulate thread local variables 2011-06-15 02:09:02 +02:00