summary refs log tree commit diff stats
path: root/compiler/pragmas.nim
Commit message (Collapse)AuthorAgeFilesLines
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, ↵Timothee Cour2020-05-111-4/+4
| | | | | | | | | | `--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
* CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static ↵Timothee Cour2020-04-231-1/+5
| | | | | | | | | | | checks (#13926) * -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper * cleanups * import sizeof at CT for {.completeType.} * address comments; revert default enabling of -d:checkAbi for now * mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor * all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
* remove the nilChecks switch; refs #11570Araq2020-04-201-1/+0
|
* drnim: tiny progress (#13882)Andreas Rumpf2020-04-151-1/+1
| | | | | | | | | | | * drnim: tiny progress * refactoring complete * drnim: prove .ensures annotations * Moved code around to avoid code duplication * drnim: first implementation of the 'old' property * drnim: be precise about the assignment statement * first implementation of --assumeUnique * progress on forall/exists handling
* finally de-deprecate the .define and .undef pragmasAndreas Rumpf2020-04-041-2/+0
|
* new feature: ability to turn specific warnings to errorsAndreas Rumpf2020-04-041-19/+16
|
* added an .assert pragma and mentioned the pragmas in the changelogAraq2020-04-021-1/+1
|
* The raises list can now use expressions referencing the generic paramsZahary Karadjov2020-04-011-4/+7
|
* Replace tfHasRequiresInit with a more accurate mechanismZahary Karadjov2020-04-011-1/+1
| | | | | | | | | The new mechanism can deal with more complex scenarios such as not nil field appearing in a non-default case object branch or a field within a generic object that may depend on a when branch. The commit also plugs another hole: the user is no longer able to create illegal default values through seq.setLen(N).
* More sophistication; Allow requiresInit to be specified per-fieldZahary Karadjov2020-04-011-3/+7
|
* First steps, the compiler can boot with enforced requiresInitZahary Karadjov2020-04-011-1/+1
|
* DrNim (Nim compiler with Z3 integration) (#13743)Andreas Rumpf2020-03-311-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | * code cleanups and feature additions * added basic test and koch/CI integration * make it build on Unix * DrNim: now buildable on Unix, only takes 10 minutes, enjoy * added basic documentation for DrNim which can also be seen as the RFC we're following * drnim: change the build setup so that drnim.exe ends up in bin/ * makes simple floating point ranges work * added basic float range check * drnim: teach Z3 about Nim's range types plus code refactoring * drnim: make unsigned numbers work * added and fixed index checking under setLen * first implementation of .ensures, .invariant and .assume (.requires still missing and so is proc type compatibility checking * drnim: .requires checking implemented * drnim: implemented .ensures properly * more impressive test involving min() * drnim: check for proc type compatibility and base method compatibility wrt .requires and .ensures * testament: support for 'pattern <directory> * koch: uses new <directory> feature of testament * drnim: added tiny musings about 'old' * Make testament work with old SSL versions * koch: add support for 'koch drnim -d:release' * drnim: preparations for the param.old notation
* '.push raises: []' now also affects proc types (#13776)Andreas Rumpf2020-03-291-3/+3
| | | | | | | | | * '.push raises: []' now also affects proc types * fixes the regression * less disruptive bugfix * another attempt
* new feature: --staticBoundChecks:on to enforce static array index checking ↵Andreas Rumpf2020-03-181-2/+5
| | | | (#10965)
* sink parameter inference for types that have destructors (#13544)Andreas Rumpf2020-03-041-2/+6
| | | | | | | | | | | | | | * ensure capitalize doesn't take an inferred sink parameter * sink parameter inference: first version, for now disabled. Changed that sink parameters can be consumed multiple times in order to adhere to our spec. * sink inference can now be disabled with .nosinks; sometimes for proc type interop this is required * fixes yet another critical DFA bug * better implementation that also understands if expressions etc * document sink parameter inference and allow for global disabling
* properly handle note override logic/verbosity/config/cmdline using ↵Timothee Cour2020-02-271-0/+1
| | | | modifiedyNotes, cmdlineNotes
* make goto based exceptions available for 'nim cpp' (#13244)Andreas Rumpf2020-01-251-2/+2
| | | | | * make goto based exceptions available for 'nim cpp' * optimize seq.add to be comparable to C++'s emplace_back
* make case-object transitions explicit, make unknownLineInfo a const, replace ↵Jasper Jenkins2020-01-171-1/+1
| | | | a few magic numbers with consts (#13170)
* fixes #13122 (#13126)Andreas Rumpf2020-01-131-4/+2
| | | | | | * fixes #13122 * moved tests to where they belong
* VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (#12877)Timothee Cour2020-01-051-0/+2
| | | | | | | | | | | | | | * 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
* fix #12985 {.push.} now does not apply to generic instantiations (#12986)Timothee Cour2020-01-021-1/+1
|
* --exception:goto switch for deterministic exception handling (#12977)Andreas Rumpf2020-01-011-1/+1
| | | | | 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.
* ARC: cycle detector (#12823)Andreas Rumpf2019-12-171-1/+1
| | | | | | | | | | | | | * first implementation of the =trace and =dispose hooks for the cycle collector * a cycle collector for ARC: progress * manual: the .acyclic pragma is a thing once again * gcbench: adaptations for --gc:arc * enable valgrind tests for the strutils tests * testament: better valgrind support * ARC refactoring: growable jumpstacks * ARC cycle detector: non-recursive algorithm * moved and renamed core/ files back to system/ * refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-61/+61
| | | | | | | | | | | | | | | | | | * 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
* implemented a new localPassc pragma (#12706)Andreas Rumpf2019-11-221-1/+6
|
* fixes and changes the recently introduced 'alignas' to be 'align' (#12666)Andreas Rumpf2019-11-151-2/+2
| | | | | | * fixes and changes the recently introduced 'alignas' to be 'align' * more improvements
* implemented alignas pragma (#12643)Arne Döring2019-11-131-8/+9
| | | | | | | | | | | | * implemented alignas pragma * fix bootstrap * generate c++ compatible syntax for alignas * Make it work. * Multiple alignof expressions. Implement top level alignof.
* .cursor implementation (#12637)Andreas Rumpf2019-11-121-2/+5
| | | | | | | | | | | * cursors: first implementation * added currently failing test * .cursor works for doubly linked lists * make -d:useMalloc work again * added code to nil out refs in a destructor * it's now called --gc:arc * renderer.nim: render nkBreakState properly * make simple closure iterators work without leaking
* fixes #5050; fixes #11826 (#12606) [backport]cooldome2019-11-071-12/+2
|
* pragmas.nim: tiny code formattingAndreas Rumpf2019-11-071-2/+1
|
* remove unused importsnarimiran2019-11-061-1/+1
|
* Fixes semCustomPragma when nkSym (#12414) [backport]Alexander Ivanov2019-10-111-1/+1
|
* Refactor injectdestructors (#12295)Clyybber2019-10-011-6/+1
| | | One improvement over #devel is visible in the transformation of getEnv. With this approach we move to result whenever possible.
* cleanup importjs implementationAndreas Rumpf2019-09-211-12/+5
|
* importjs symbol (#12218)Arne Döring2019-09-201-1/+17
| | | | | * importjs symbol * importjs warning message, minor warning fixes
* fixes #12171 (#12173)Andreas Rumpf2019-09-111-9/+13
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-2/+2
| | | | | * Remove sonsLen * Use Indexable
* exportc now mangles same as importc, fixes #10578 (#12144)Timothee Cour2019-09-061-31/+38
| | | | | | | * fixes #10578 * add tests * add changelog * add {.exportcpp.}
* allows access to .compileTime vars at runtime (#12128)Andreas Rumpf2019-09-051-2/+2
|
* Remove ENDB (#12095)Clyybber2019-08-311-13/+2
|
* refactor sizealignoffset (#12077)Andreas Rumpf2019-08-281-5/+5
| | | | | | | | | | | | | | * small refactoring * refactor computeObjectOffsetFoldFunction with AccumObject * refactor packed object offstes fold function * refactor compute union object offsets fold function * merge normal/packed object offset fold function * compiletime offsetof in c++ inheritance objects * enable c++ inheritance offsetof tests * correct alignment for big sets/enums on weird 32bit platforms * uncomputedSize -> unknownSize * workaround for travis * fixes win32 alignment problems
* fixes #12029; finish the 'unused import' feature (#12064)Andreas Rumpf2019-08-271-1/+1
|
* revert changesAndrii Riabushenko2019-07-251-6/+2
|
* add testAndrii Riabushenko2019-07-251-2/+6
|
* newruntime: refchecks:on|off switchAraq2019-07-121-0/+4
|
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-30/+30
| | | | --styleCheck:error
* linter: refactoringsAraq2019-07-101-1/+1
|
* nim styleChecker: implemented all the missing features (bugfix)Araq2019-07-101-4/+9
|
* [other] new experimental pragma .nodestroy for easier custom destructorsAndreas Rumpf2019-06-201-3/+6
|
* Remove immediate pragma (#11308)Arne Döring2019-05-291-8/+2
| | | | | * remove immediate from tests * remove immediate from the compiler