Commit graph

1522 commits

Author SHA1 Message Date
Daniel Kochmanski
e92cfdf437 Unify compilation environment markers
In both bytecmp and c compiler we use si:function-boundary and
si:unwind-protect-boundary where appropriate. Previously bytecmp used an ad-hoc
special variable for function-boundary and didn't mark unwind-protect at all.

Remove recently-introduced ECI package (maybe we will reintroduce it later when
we'll have a common frontend for compilers).
2018-02-15 12:44:49 +01:00
Daniel Kochmanski
50fb814fd1 Accept all valid function names in c::compile
Previously we accepted only symbols, now we use si:valid-funciton-name-p
predicate to allow (setf foo) as well.
2018-02-13 13:22:12 +01:00
Daniel Kochmanski
d9da8648cd Look up a lexical macro before a compiler macro.
Fixes #83. Fixes #237.
2018-02-12 16:02:00 +01:00
Daniel Kochmanski
7ec2f4a939 Major cleanup for environment mark interpretation
Code was previously written with an assumption, that we know whenever function
crosses lexical for closure boundaries before it is compiled (and env-mark for
such boundries was LB and CB appropriately). Later it has changed, but code was
ready to work with LB and CB marks.

Fix these parts of code and replace it with a single mark ECI:FUNCTION. Also
replace CL:UNWIND-PROTECT boundry mark with ECI:UNWIND-PROTECT so we are less
dependent on use-ing CL package. Adjust comments to have this change.
2018-02-10 20:21:11 +01:00
Daniel Kochmanski
82efbab4c0 cmp: update comments in cmptypes
It contained some information which is no longer valid (and makes it hard to
grok a code if the programmer doesn't know what it does already).
2018-02-10 18:14:51 +01:00
Daniel Kochmanski
cae6f0004d cmp: simplify return-from c1form
Now it accepts 3 arguments (not 4) because variable is taken from blk-var.
2018-02-10 18:14:17 +01:00
Daniel Kochmanski
07843b3e86 Don't depend in tag-ref-{ccb,clb} which are broken anyway
We have dummy variable for that, so we refere to

(var-ref-ccb (tag-var blk))
(var-ref-clb (tag-var blk))

Brokeness comes from the fact that closures are computed after function
compilation pass-1 (and tagbody is inside). Analogous change to the previous
commit in cmpblock.

Also improve comments in cmptypes to make it clear that these parts are not
used. Further refactor could make tag inherit from variable - then we wouldn't
have a dummy variable and unnecessary fields whatsoever.
2018-02-10 18:01:55 +01:00
Daniel Kochmanski
78d4e5f923 Don't depend in blk-ref-{ccb,clb} which are broken anyway
We have dummy variable for that, so we refere to

(var-ref-ccb (blk-var blk))
(var-ref-clb (blk-var blk))

Brokeness comes from the fact that closures are computed after function
compilation pass-1 (and block is inside). Fixes #374.

Also improve comments in cmptypes to make it clear that these parts are not
used. Further refactor could make blk inherit from variable - then we wouldn't
have a dummy variable and unnecessary fields whatsoever.
2018-02-10 17:52:30 +01:00
Daniel Kochmanski
3f9c69d5b3 Add unwind-protect transformation when cleanup-forms are empty
This optimization doesn't buy us much but it doesn't cost us anything
either. Note that it emits c1form in case of expression what means that
expression won't be promoted to top-level form after the reduction.
2018-02-10 17:52:30 +01:00
Daniel Kochmanski
c138be5818 cmp: some cleanup changes
Add missing declarations here and there, remove setf to unused variable etc.
2018-02-10 17:51:53 +01:00
Daniel Kochmanski
48d5420b16 cmp: all baboon have now error message
This is useful for identification, where the problem occured. Also add some
indent and line wrap fixes which are estetic. Comment out unused variable.
2018-02-05 18:11:35 +01:00
Marius Gerbershagen
9227f4e342 fix #409: order of evaluation of values forms
the fix for #330 is unaffected
2017-12-29 16:58:27 +01:00
Marius Gerbershagen
a0a1a54747 don't check type declarations for default values of optional and keyword function arguments
almost all other implementations do the same, so we should also
allow this edge case
2017-12-02 21:49:46 +01:00
Daniel Kochmanski
c771b46c5f feature: export make-stream-from-fd interface 2017-10-11 10:25:59 +02:00
Daniel Kochmanski
2a98ce10fe core: si:copy-stream has three arguments
argument `wait' denots, whenever we wait for EOF or yield when there
is no input available in the first stream.
2017-10-09 09:35:54 +02:00
Daniel Kochmanski
d02ec85d24 ffi: void functions return no values 2017-09-30 20:34:08 +02:00
Daniel Kochmanski
fe392867c3 consistency: defcallback always returns just pointer, not a list
Fixes #223.
2017-09-30 12:23:57 +02:00
Daniel Kochmanski
7db4543051 environ: accept empty list as nil environment
To inherit current process environemnt, user has to pass `:default' as
environ (what is a default value).
2017-09-05 20:17:39 +02:00
Daniel Kochmanski
ee059366db expand-vector-push: simplify error condition
assert, that function takes 2 up to 3 (if extended) arguments.
2017-08-10 20:58:37 +02:00
Daniel Kochmanski
bf310ef23a expand-vector-push: further reduce complexity
use return-from for catching forms of illegal number of arguments.
2017-08-10 20:55:11 +02:00
Daniel Kochmanski
8293fb6eb4 expand-vector-push: reduce complexity (one nesting level less)
catch the infinite recursion and do return-form instead of setting
`whole'.
2017-08-10 20:44:35 +02:00
Daniel Kochmanski
7320c9049c mapcar-expand: fix-typo 2017-08-10 20:32:02 +02:00
Daniel Kochmanski
c2af9fe775 cmp: refactor: expand-vector-push: get rid of one nesting level 2017-08-10 20:23:30 +02:00
Daniel Kochmanski
6d8b0e7f62 compiler: expand-mapcar: issue error at runtime
and compiler warning during compilation.
2017-08-10 20:21:04 +02:00
Daniel Kochmanski
d8552498af builder: wrapper: be more explicit with warnings
Add warning that init-name will be ignored for other entities than libraries.
2017-07-21 21:20:48 +02:00
Daniel Kochmanski
bdd17142fb cosmetic: line wrap 2017-07-21 19:34:01 +02:00
Daniel Kochmanski
b15afe097c builder: wrapper: don't output unnecessary code when non needed 2017-07-21 19:33:45 +02:00
Daniel Kochmanski
5a50195666 builder: don't create wrapper when same as init-name 2017-07-21 19:33:27 +02:00
Daniel Kochmanski
7f13cc7e48 cleanup: cmp: compute-init-name: get rid of wrapping code
code simplification.
2017-07-21 18:15:28 +02:00
Daniel Kochmanski
5836dc8bec cmp: builder: warn ASDF that it does the wrong thing.
It shouldn't call compute-init-name.
2017-07-21 18:11:55 +02:00
Daniel Kochmanski
b4a83d2955 cmp: make init function name always unique
Add wrapper separately.
2017-07-21 18:11:13 +02:00
Daniel Kochmanski
d1be9436aa cosmetic: add informative comments 2017-07-21 18:10:03 +02:00
Daniel Kochmanski
9061653116 cosmetic: remove gross aux 2017-07-21 17:24:21 +02:00
Daniel Kochmanski
17e4c5de65 cosmetic: don't leave empty line 2017-07-21 17:23:30 +02:00
Daniel Kochmanski
cffe43f9ae normalize-build-target-name: normalize :fasb 2017-07-21 17:21:39 +02:00
Daniel Kochmanski
cc61a627c2 cosmetic: improve C source comment 2017-07-21 16:32:39 +02:00
Daniel Kochmanski
78fc83e4c9 cmpmain: remove unused variable 2017-07-21 12:04:30 +02:00
Daniel Kochmanski
f42cb506e0 cleanup: fix invalid invocation 2017-07-21 11:38:45 +02:00
Daniel Kochmanski
4d4b01b585 cmp: safe-run-program: refactor to print output on error 2017-07-21 10:48:44 +02:00
Daniel Kochmanski
a15cf408c3 cmp: collect-lines: move function to cmputil
cmputil is moved higher in the dependency tree
2017-07-21 10:45:13 +02:00
Daniel Kochmanski
b2a9100ee7 cosmetic: indent +cmp-module-files+ definition 2017-07-21 10:33:41 +02:00
Fabrizio Fabbri
604c87126d
cmp: #353 fix vector-push vector-push-extend
When call those function with invalid argument
number the generated code instead of signal
a programming error does SIGSEGV
2017-07-06 10:44:34 +02:00
Fabrizio Fabbri
6dc40c869c
Signal error on invalid constant type checking.
Side effet was SIGSEGV on compiled code.
2017-06-28 15:58:20 +02:00
Daniel Kochmański
bfc58c219e add missing function 2017-06-23 17:56:32 +02:00
Yuguo Zhang
52a232b2d1 adjust memory allocation functions in windows API ecl_get_commandline_args.
the caller and the callee maybe use difference compiler and settings.
2017-06-13 18:22:59 +08:00
Fabrizio Fabbri
390caa3e51
Revert "Revert "Merge branch 'develop' into 'develop'""
This reverts commit cf416f6fd4.
2017-06-03 12:57:17 +02:00
Daniel Kochmanski
cf416f6fd4 Revert "Merge branch 'develop' into 'develop'"
This reverts commit b75802f122, reversing
changes made to 5e3ccb1955.
2017-05-26 14:38:52 +02:00
Fabrizio Fabbri
95279fb15f
Code review on merge request !65 2017-05-19 19:34:19 +02:00
Fabrizio Fabbri
539b05a1a2
coverity fix Uninitialized pointer read 2017-05-16 22:43:08 +02:00
Fabrizio Fabbri
8617d61e64
fix coverity Uninitialized pointer read on env0 2017-05-16 22:06:04 +02:00