Commit Graph

6008 Commits

Author SHA1 Message Date
Ico Doornekamp
bfe96e069b Fixed codegen for constant cstring with --gc:arc (#13326)
* Fixed codegen for constant cstring with --gc:arc, fixes  #13321

* Added test for #13321
2020-02-04 17:39:27 +01:00
Timothee Cour
e70294dff2 enable testing -d:nimHasLibFFI mode (#13091) 2020-02-04 14:08:56 +01:00
Timothee Cour
4a747f0250 CT FFI: fix for windows; fix case transition; error msg shows more useful context (#13292)
* evalffi: fix case transition
* evalffi: fix for windows
* evallffi: `cannot import` errmsg now also shows which library it tried to import symbol from
2020-01-30 11:04:06 +01:00
Timothee Cour
81a43791f9 fix critical bug discovered by #11591 (#13290) [backport] 2020-01-29 17:40:03 +01:00
Timothee Cour
9657a83698 removed unused import 2020-01-28 23:36:24 +00:00
Timothee Cour
5676912209 refactor htmldocs; gitignore it 2020-01-28 23:36:24 +00:00
cooldome
46bfb590c8 fixes #13281 (#13282)
* fixes ##13281

* add comment to test
2020-01-28 14:55:54 +01:00
hlaaftana
a71654323d Clearer final objects error; fixes #13256 (#13257) 2020-01-26 18:56:04 +01:00
Araq
a10cc18247 ARC: optimize complete object constructors to use nimNewObjUninit 2020-01-26 13:43:02 +01:00
Andreas Rumpf
6efac70181 make goto based exceptions available for 'nim cpp' (#13244)
* make goto based exceptions available for 'nim cpp'
* optimize seq.add to be comparable to C++'s emplace_back
2020-01-25 20:00:13 +01:00
Timothee Cour
4cbeddddcc nim dump: add libpath (#13249) 2020-01-24 20:06:54 +01:00
Ico Doornekamp
b68eb1cad0 Removed lib/system/allocators.nim. seqs_v2 and strs_v2 now uses allocShared0. (#13190)
* Cleanup, remove lib/system/allocators.nim. seqs_v2 and strs_v2 now use
allocShared0 by default.

* Fixed -d:useMalloc allocShared / reallocShared / deallocShared. These now use the alloc/dealloc/realloc implementation that also takes care of zeroing memory at realloc.

* Removed debug printfs

* Removed unpairedEnvAllocs() from tests/destructor/tnewruntime_misc

* More mmdisp cleanups. The shared allocators do not need to zero memory or throw since the regular ones already do that

* Introduced realloc0 and reallocShared0, these procs are now used by
strs_v2 and seqs_v2. This also allowed the -d:useMalloc allocator to
drop the extra header with allocation length.

* Moved strs_v2/seqs_v2 'allocated' flag into 'cap' field

* Added 'getAllocStats()' to get low level alloc/dealloc counters. Enable with -d:allocStats

* *allocShared implementations for boehm and go allocators now depend on the proper *allocImpl procs
2020-01-23 14:25:22 +01: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
Timothee Cour
b8a436af93 kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes (#13221)
* kochdocs: use a glob instead of hardcoded list; generate docs for compiler/; bugfixes
* fixup after #13212 isRelativeTo got merged
2020-01-23 11:06:28 +01:00
Timothee Cour
b462baed65 VM: allow overriding MaxLoopIterations without rebuilding nim (#13233) 2020-01-23 10:53:30 +01:00
Jasper Jenkins
0606b6a44e fix range[enum] type conversion (#13204) [backport] 2020-01-20 16:56:59 +01:00
alaviss
470faa97c6 compiler/ccgtypes: hide exportc proc unless it has dynlib (#13199)
This hides most of stdlib's internal functions from resulting
binaries/libraries, where they aren't needed on *nix. Static libraries
are not affected by this change (visibility doesn't apply to them).
2020-01-20 10:51:21 +01:00
cooldome
da1bddb084 fixes #13195 (#13198)
* fixes #13195

* extra fix

* fix typo
2020-01-20 10:41:12 +01:00
Andreas Rumpf
41555ca86f fixes #13110 (#13197) 2020-01-19 23:30:45 +01:00
Andrii Riabushenko
6f3476d39c Revert "fixes #13195"
This reverts commit cd7904f2b2.
2020-01-19 20:33:23 +00:00
Andrii Riabushenko
7576387dfe revert last commit 2020-01-19 20:21:26 +00:00
slangmgh
13ddbc46fc Fixes #13186 (#13188) 2020-01-19 14:16:50 +01:00
cooldome
416b4c3612 more on arc codegen (#13178)
* arc codegen for union type

* add more tests

* fix offsetof

* fix tsizeof test

* fix style
2020-01-19 14:14:26 +01:00
Timothee Cour
5010bc1af5 fixes #13144 (#13145)
* fixup: genscript now does not copy nimbase.h but uses -I$nim/lib
2020-01-18 01:21:13 +01:00
Araq
107352f9d7 fixes #13157 2020-01-17 17:52:06 +01:00
Clyybber
451c47634c Fix docs for subdirs too (#13180)
* Fix doc subdirs
* Extract to helper proc, and fix on windows
2020-01-17 16:49:37 +01:00
cooldome
f51613e262 make sink operator optional (#13068)
* make sink operator optional

* bug fix, add changelog entry

* Trigger build

* fix one regression

* fix test

* Trigger build

* fix typos
2020-01-17 11:44:06 +00:00
Andreas Rumpf
7626907401 ARC works for async on Windows (#13179) 2020-01-17 11:14:17 +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
cooldome
2bf337abae fixes #13095 (#13181)
* fixes #13095

* fix typo
2020-01-17 09:17:18 +01:00
Clyybber
e3acb2d12c Cleanup DFA (#13173) 2020-01-16 20:15:50 +01:00
Timothee Cour
1b54be7779 fixes #12998 nim doc regression (#13117) 2020-01-16 14:19:58 +01:00
cooldome
5ef0494677 Working towards arc codegen (#13153)
fixes #13029
2020-01-16 14:16:17 +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
Timothee Cour
d88b52c0bc successX now correctly shows html output for nim doc, nim jsondoc; fix #13121 (#13116)
* successX now correctly shows html output for nim doc
* fixes #13121
* fixup hintSuccessX to be less weird
2020-01-15 15:18:37 +01:00
Ico Doornekamp
79a326759a Added 'ansic' os support for minimal (embedded) targets (#13088)
* os:any implementation
* os:asny: omit flock/funlock calls in echoBinSafe
* Disabled default "unhandled expection" reporting for `--os:any` to reduce
code size. Added unhandledExceptionHook instead which can be used to get
a notification from Nim and handle it from the application.
2020-01-15 11:06:41 +01:00
Andreas Rumpf
675ca997fb fixes #9674 [backport] (#13143) 2020-01-14 16:20:48 +01:00
Andreas Rumpf
8b00586488 fixes #13104 [backport] (#13142) 2020-01-14 15:16:36 +01:00
cooldome
b4545f03de pass platform argument only if vccexe is used (#13078)
* pass platform only if vccexe is used
* fixes #12297
2020-01-14 15:02:10 +01:00
Andreas Rumpf
fadbd8f70d fixes #10665 (#13141) [backport] 2020-01-14 13:51:28 +01:00
Andreas Rumpf
9fc04a555c fixes #13105 (#13138) 2020-01-14 12:57:20 +01:00
Andreas Rumpf
d56848878c fixes #13119 (#13128)
* fixes #13119
* fixes a regression
2020-01-14 09:56:08 +01:00
Timothee Cour
49d1822c8f fixes #13100 nim doc now treats export localSymbol correctly (#13123) [backport]
* fix #13100 nim doc now treats `export localSymbol` correctly
* use owner instead
2020-01-13 22:05:38 +01:00
Andreas Rumpf
eadd1ba9ed fixes #13112 (#13127)
* improve line error information

* fixes #13112
2020-01-13 15:47:17 +01:00
Andreas Rumpf
abea80376a fixes #13122 (#13126)
* fixes #13122

* moved tests to where they belong
2020-01-13 14:11:51 +01:00
Jasper Jenkins
bf2e052e6d fix rtti sizeof for varargs in global scope (#13125) [backport] 2020-01-13 10:17:21 +01:00
Andreas Rumpf
767592a3c3 more arc features (#13098)
* config update
* ARC now supports 'repr' and 'new' with finalizers is supported
2020-01-10 23:17:33 +01:00
Araq
033da35de1 fixes #13072; no test case because it will be added later with more exception handling related bugfixes 2020-01-10 08:32:30 +01:00
Timothee Cour
3f78873898 remove all remaining warnings when build nim (with -d:nimHasLibFFI) (#13084)
* cleanup deprecations in evalffi + elsewhere

* remove dead code getOrdValue64
2020-01-09 13:19:18 +01:00
Andy Davidoff
56fb909676 fix crash due to errant symbols in nim.cfg (#13073) [backport] 2020-01-08 22:25:25 +01:00