Commit graph

1398 commits

Author SHA1 Message Date
Daniel Kochmański
899f51106e cmpc: when infinity is used, emit macro "INFINITY"
and "-INFINITY" for negative infinity. These corner-cases lead to
compilation error, so no regression will be imposed even against
non-c99 compilers.

INFINITY and NAN macros are introduced by C99 standard, so such code
requires C-backend to support this math extension. Fixes #156.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-09-04 21:32:08 +02:00
Matthew Mondor
8f07cd58d8 The ECL code no longer uses tabulator characters, they were replaced
by spaces.

A custom script was used to insert/replace Emacs and ViM per-file editor
settings according to their type and the new ECL coding style.
2015-09-03 07:35:47 -04:00
Daniel Kochmański
a2ceed9cb3 deftype: use destructure directly, remove unused arg
Removes ENV arg, which were ignored by using destructure directly.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-18 15:39:29 +02:00
Daniel Kochmański
64a96a537b cosmetic: deduplicate expand-deftype function definition
Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-18 12:07:57 +02:00
Daniel Kochmański
0359b79c81 deftype: make deftype accept macro lambda-lists
Fixes #86.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-18 12:06:03 +02:00
Daniel Kochmański
6b2b2ac598 cmpprop: fix repeated required arguments
Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-17 12:59:43 +02:00
Daniel Kochmański
7b3373ece8 lambda-list: Improve error message in c-compiler
Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-17 12:58:32 +02:00
Daniel Kochmański
8869a54bde flet/labels: make same function name error message more descriptive
Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-17 12:15:53 +02:00
Daniel Kochmański
e289af9500 LET: signal an error when multiple bindings of the same name occur
This situation is unspecified by ANSI spec – also hard to find
situation, when such construct wouldn't be an error.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-17 10:07:31 +02:00
Daniel Kochmański
bacece3827 Revert "cmp: ffi: cast `ecl_make_foreign_data' 3rd argument to *(void **)"
This reverts commit ab50a55fb1.

We can't cast every 3rd argument to *(void **) - this breaks *things*.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-08 08:36:43 +02:00
Daniel Kochmański
ab50a55fb1 cmp: ffi: cast `ecl_make_foreign_data' 3rd argument to *(void **)
Some compilers doesn't allow putting function pointers when parameter
type is declared (void *), but it's necessary if we want to use
callbacks. Fixes #99.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-31 14:19:35 +02:00
Daniel Kochmański
f40e183770 cmp: search for tag only when name is unique
fasl and program init function names are always the same, don't search
for tag in binary files for this two targets.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-31 09:29:56 +02:00
Daniel Kochmański
1ada997e7c cmp: use unique names for inititalization functions of libraries
Fixes #74.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-30 21:22:25 +02:00
Daniel Kochmański
8bc260c377 cmp: embed unique tag with init function name in each exported module
This is necessary if we want to retrieve function name from compiled
binary, what is necessary if we want to use unique names for this
function. This is necessary for fix of issue #41.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-30 21:20:15 +02:00
Daniel Kochmański
29cd90c448 cmp: make init-function-name consistant with compute-init-name
Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-30 08:35:03 +02:00
Daniel Kochmański
8972fb38d3 cmp: remove redundant compute-main-name function
Same functionality is provided by compute-init-name

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-30 08:32:02 +02:00
Daniel Kochmański
d75552027a compiler: bind lexically *readtable* when file is compiled
Both byte and C compilers didn't bind lexically *readtable*, what lead
to pollution of other compiled packages. Fixes #95 and #59.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-28 14:25:29 +02:00
Daniel Kochmański
a04b6ff8b8 cmp: mapcar: evaluate function only once
When function is a closure, all lexical environment were reinitialized
on each function call, because it was expanded multiple times. Do it
only once and use result in funcall. Fixes #17.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-07-16 07:52:52 +02:00
Daniel Kochmański
4d19a27424 cosmetic: untabify
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-21 14:38:20 +02:00
Daniel Kochmański
ff865d1c59 cmplet: Remove invalid declaration. Fixes #28. 2015-04-07 21:34:01 +02:00
Daniel Kochmański
7229cfefc9 compilator: fixes issue #3 (regression on package :lapack).
cmptype-arith.lsp: problem introduced in commit
c0b23555c6 which added empty &optional
clause and &allow-other-keys capability to typespec for values.

Problem was, that multiple &optional keywords in typespec it
considered error, while

'(VALUES &OPTIONAL T &OPTIONAL T)

should return as optional part, list (T &optional T) - even if it
looks weird.
2015-03-05 23:45:22 +01:00
Daniel Kochmański
0d97f64c60 cmpc-machine.lsp: --with-sse=yes build failure fix. Closes #301.
Typo in rewriting cmpc-machine in order to enable cross-compilation for ecl.
Related ticket: https://sourceforge.net/p/ecls/bugs/301/
2015-02-26 15:48:58 +01:00
Stas Boukarev
3f0ce7f7d4 Fix VALUES declaration processing.
A change to C::SPLIT-VALUES-TYPE got the order reversed.

Fixes #275.
2014-03-02 21:45:45 +01:00
Stas Boukarev
e2e53dc679 Fix FTYPE declaration to X from being applied to (SETF X).
C1LAMBDA-EXPR used the block-name to get declarations, but BLOCK name
is a symbol, and for a function named (SETF X) the block would have
the name X, resulting in wrong declarations.

Fixes #262.
2014-03-02 21:36:56 +01:00
Juanjo Garcia-Ripoll
c8a4d98da6 (INTEGER *) and other type names made of lists are now allowed as declaration names. 2013-10-29 22:25:42 +01:00
Juanjo Garcia-Ripoll
db2925daf6 Fixed the routines that deal with VALUES types, extracting primary types, splitting them, etc 2013-10-10 23:45:37 +02:00
Juanjo Garcia-Ripoll
c0b23555c6 SPLIT-VALUES-TYPE and VALUES-TYPE-PRIMARY-TYPE redesigned to work with &allow-other-keys and empty &optional 2013-10-10 22:47:56 +02:00
Juanjo Garcia-Ripoll
e7daee08e8 Fixed wrong proclamation for ensure-directories-exist. 2013-10-09 21:41:57 +02:00
Juan Jose Garcia Ripoll
44c86e083c Implemented FFI:C-PROGN 2013-07-03 17:08:59 +02:00
Juan Jose Garcia Ripoll
c503bfa99b APPLY should not be inlined when using frame arguments. 2013-07-03 16:58:27 +02:00
Juan Jose Garcia Ripoll
a40c1907cf Added the special form FFI:C-PROGN 2013-06-27 23:09:37 +02:00
Juan Jose Garcia Ripoll
08594e60a9 Clean-up COERCE-LOCS 2013-06-23 00:15:09 +02:00
Juan Jose Garcia Ripoll
a84cf0df47 Introduced C-type declarations in the compiler. 2013-06-22 21:55:51 +02:00
Juan Jose Garcia Ripoll
6ffd74aa05 Slight simplification in the detection of alien declarations 2013-06-22 20:41:28 +02:00
Juan Jose Garcia Ripoll
914ce253d1 FSET only can work specially when it is a toplevel form 2013-06-19 22:13:48 +02:00
Juan Jose Garcia Ripoll
5b82b34f5c Fixed order of loading files 2013-06-08 22:24:14 -07:00
Juan Jose Garcia Ripoll
63640b0a79 Added newlines to the C templates. 2013-06-08 22:04:06 -07:00
Juan Jose Garcia Ripoll
e92f8c418f Added a 'machine' object that represents the features of a cross compilation target in the compiler. Inline forms now are created with one such machine on mind, and recreated if the machine changes. 2013-06-02 22:49:54 +02:00
Juan Jose Garcia Ripoll
2798c5caea Remove unused lines. 2013-06-02 10:06:42 +02:00
Juan Jose Garcia Ripoll
5bbb85fd7f When type propagation errors happen, show the function context. 2013-05-26 11:09:53 +02:00
Juan Jose Garcia Ripoll
3662e43229 The value of *env-lvl* was not saved in cmptop.lsp 2013-05-25 00:59:18 +02:00
Juan Jose Garcia Ripoll
2bbc16ac33 Fixed different uses of *volatile*, which indented wrong or placed it in the wrong place 2013-05-23 13:47:38 +02:00
Juan Jose Garcia Ripoll
d1030a643c Improve slightly the indentation of the C code generated by FLET, removing spurious variable assignments. 2013-05-23 12:39:55 +02:00
Juan Jose Garcia Ripoll
92054ae38c The declaration of CLV variables had too many newlines. 2013-05-23 11:16:49 +02:00
Juan Jose Garcia Ripoll
d90e3c0e90 The definition of env0 missed a newline character before it. 2013-05-23 11:13:25 +02:00
Juan Jose Garcia Ripoll
94e04b5484 Fix the order of statements in the compiler macro expansion of DPB and LDB. 2013-04-17 23:45:55 +02:00
Juan Jose Garcia Ripoll
3c0a911ebf HASH-TABLE-COUNT now updates the list of live entries in weak hash tables 2013-04-16 23:11:01 +02:00
Juan Jose Garcia Ripoll
e0e9eb731e Don't create extra strings on platforms without limitation on the string size. 2013-04-14 22:27:21 +02:00
Juan Jose Garcia Ripoll
c603e57ef3 In *.data we have to add a final newline character to ensure that the compiler does not complain. 2013-04-14 21:47:17 +02:00
Juan Jose Garcia Ripoll
03a38affeb The length of the string that stores compiled data was off by 1 character 2013-04-13 22:59:18 +02:00