summary refs log tree commit diff stats
path: root/compiler/evalffi.nim
Commit message (Collapse)AuthorAgeFilesLines
* prepare for the enforcement of `std` prefix (#22873)ringabout2023-10-291-2/+4
| | | follow up https://github.com/nim-lang/Nim/pull/22851
* use strictdefs for compiler (#22365)ringabout2023-08-061-7/+16
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* Allow `libffi` to work via `koch boot` (#22322)awr12023-08-031-1/+1
| | | | | | | | | | | | | | | | | | | * Divert libffi from nimble path, impl into koch * Typo in koch * Update options.nim comment * Fix CI Test * Update changelog * Clarify libffi nimble comment * Future pending changelog --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fix #12122 (#21096)Bung2022-12-161-4/+4
|
* make implicit cstring conversions explicit (#19488)ee72022-08-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nim manual says that an implicit conversion to cstring will eventually not be allowed [1]: A Nim `string` is implicitly convertible to `cstring` for convenience. [...] Even though the conversion is implicit, it is not *safe*: The garbage collector does not consider a `cstring` to be a root and may collect the underlying memory. For this reason, the implicit conversion will be removed in future releases of the Nim compiler. Certain idioms like conversion of a `const` string to `cstring` are safe and will remain to be allowed. And from Nim 1.6.0, such a conversion triggers a warning [2]: A dangerous implicit conversion to `cstring` now triggers a `[CStringConv]` warning. This warning will become an error in future versions! Use an explicit conversion like `cstring(x)` in order to silence the warning. However, some files in this repo produced such a warning. For example, before this commit, compiling `parsejson.nim` would produce: /foo/Nim/lib/pure/parsejson.nim(221, 37) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] /foo/Nim/lib/pure/parsejson.nim(231, 39) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] This commit resolves the most visible `CStringConv` warnings, making the cstring conversions explicit. [1] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/doc/manual.md#cstring-type [2] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/changelogs/changelog_1_6_0.md#type-system
* Change `styleCheck` to ignore foreign packages (#19822)quantimnot2022-07-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change `styleCheck` to ignore foreign packages * Symbols from foreign packages are now ignored. * Fixed `styleCheck` violations in `compiler` package. * Added symbol ownership to custom annotation pragmas. * Minor refactors to cleanup style check callsites. * Minor internal documentation of reasons why a symbol isn't checked. Style violations were fixed in the compiler after thet were exposed by the changes. The compiler wouldn't compile otherwise. Symbol ownership for custom pragma annotations is needed for checking the annotation's style. A NPE was raised otherwise. Fixes #10201 See also nim-lang/RFCs#456 * Fix a misunderstanding about excluding field style checks I had refactored the callsites of `styleCheckUse` to apply the DRY principle, but I misunderstood the field access handling in a template as a general case. This corrects it. * Fix some `styleCheck` violations in `compiler/evalffi` The violations were exposed in CI when the compiler was built with libffi. * Removed some uneeded transitionary code * Add changelog entry Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-4/+4
| | | | cstring, not cString (#17744)
* Use typeflag insteadClyybber2020-08-101-1/+1
|
* #12103 - CI for OpenBSD (#12105)Euan2020-04-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Working on OpenBSD CI * Condense steps into 2 steps to make output easier to follow. * Move up one directory after csources build. * Remove FreeBSD build manifest and add OpenBSD test ignores for coroutines and hot code reloading. * If runCI fails, run the test results script. * Add email trigger for build failure * Remove .git from repository URL * Disable SFML test on OpenBSD * Disable tgetaddrinfo on OpenBSD as only UDP and TCP protocols are supported. * Remove getFilePermissions as it causes CI test failures with NimScript. * Set clang as cc in nim.cfg and use gmake to build csources. * Add getCurrentDir to nimscript. * Remove duplicate getCurrentDir and check for not weirdTarget. * Add CI badge for OpenBSD. * Disable tests which allocate lots of memory for OpenBSD. * Use `CORO_BACKEND_SETJMP` on OpenBSD rather than ucontext. * Simplify building of koch * Disable t8657 on OpenBSD. See issue #13760. * Fix #12142 - tarray_of_channels fails on OpenBSD * Disable thhtpclient_ssl and tosprocterminate on OpenBSD. These tests can be enabled at a later date after fixing them. * Install libffi. * Set path to libc for openbsd. * Disable tevalffi for now. * Remove tevalffi.nim. * Use ncpuonline sysctl rather than ncpu. * Disable tacceptcloserace and tasynchttpserver on OpenBSD. * Enable tacceptcloserace and tasynchttpserver. * Fix #13775 as suggested by @alaviss - use /bin/cat on OpenBSD rather than /bin/sh. * Enable test on OpenBSD. * Disable tflowvar on OpenBSD.
* enable testing -d:nimHasLibFFI mode (#13091)Timothee Cour2020-02-041-0/+2
|
* CT FFI: fix for windows; fix case transition; error msg shows more useful ↵Timothee Cour2020-01-301-3/+8
| | | | | | | | 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
* remove all remaining warnings when build nim (with -d:nimHasLibFFI) (#13084)Timothee Cour2020-01-091-6/+6
| | | | | | * cleanup deprecations in evalffi + elsewhere * remove dead code getOrdValue64
* VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (#12877)Timothee Cour2020-01-051-10/+3
| | | | | | | | | | | | | | * VM: allow certain hardcoded special var variables at CT * VM: allow all importc var, cast[int](ptr) * fix tests tests/vm/tstaticprintseq.nim, tests/cpp/t8241.nim * VM: == works for ptr/pointer nodes * bugfix: ==, cast now also works for pointer, not just ptr * VM supports cast PtrLikeKinds <=> PtrLikeKinds / int * improve cname handling * fixup + bug fix * VM: support cast from ref to int * address comment: opcLdGlobalDeref => opcLdGlobalDerefFFI * defensive check against typ == nil
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-56/+56
| | | | | | | | | | | | | | | | | | * 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
* Fix code style errors (#12545)Solitude2019-10-281-2/+2
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-5/+5
| | | | | * Remove sonsLen * Use Indexable
* fix compiletimeFFI (#11991)Timothee Cour2019-08-211-1/+1
|
* rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227)Arne Döring2019-05-111-3/+2
|
* Replace countup(x, y-1) with x ..< yClyybber2019-05-071-5/+5
|
* FFI at CT (#10150)Timothee Cour2019-02-231-119/+124
| | | | | | * enable FFI at CT * rename useFFI=>nimHasLibFFI; improve formatting rawExecute traceCode * disable libffi on windows (works for win32, not yet win64)
* remove ast.emptyNode global; cleanup configuration.nimAraq2018-05-161-2/+2
|
* introduce nkTupleConstr AST node for unary tuple construction; breaking changeAndreas Rumpf2018-04-131-3/+3
|
* preparations for language extensions: 'sink' and 'lent' typesAndreas Rumpf2018-01-071-9/+9
|
* deprecated unary '<'Andreas Rumpf2017-10-291-2/+2
|
* Remove expr/stmt (#5857)Arne Döring2017-07-251-8/+8
|
* removed tyArrayConstr completely from the compiler; introduced tyAlias ↵Araq2016-11-141-28/+28
| | | | instead in preparation for further bugfixes
* Use ByteAddress instead of deprecated TAddressdef2016-01-241-8/+8
|
* development version is 0.12.1, not 0.12.0Araq2015-10-291-0/+496
|
* fixes #1805Araq2015-03-211-496/+0
|
* .n.isNil checks for tyTuple PTypes.Max Zerzouri2015-03-071-0/+1
|
* Happy new year!Guillaume Gelin2015-01-061-1/+1
|
* Nimrod renamed to NimAraq2014-08-281-2/+2
|
* implemented region pointersAraq2014-04-091-3/+3
|
* should fix the nkExprColonExpr bug in the vmAraq2014-03-131-1/+1
|
* case consistency for evalffiAraq2014-02-011-28/+28
|
* Merge branch 'upstream' into develZahary Karadjov2013-12-291-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * static params: expr[T] is now static[T]Zahary Karadjov2013-12-191-1/+1
| | | | | | | | | | | | | | 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.
* | vm: FFI improvementsAraq2013-12-231-0/+3
| |
* | new VM: some progress for the FFI supportAraq2013-12-231-14/+20
| |
* | next steps for FFI supportAraq2013-11-251-0/+43
|/
* first steps to implement object construction expressionsAraq2013-03-071-4/+4
|
* FFI at compiletime improvementsAraq2013-01-081-22/+47
|
* next steps for FFI at compile timeAraq2013-01-021-13/+29
|
* fixed a newly introduced c2nim bug; many untested improvements to the FFI at ↵Araq2012-12-311-40/+190
| | | | compile time
* better errors for FFIAraq2012-12-271-9/+13
|
* small improvements for FFIAraq2012-12-261-18/+48
|
* bugfix: openssl import for macosxAraq2012-12-191-0/+3
|
* small examples work with the FFIAraq2012-12-191-20/+37
|
* first steps for FFI support at compile timeAraq2012-12-191-0/+198