Commit graph

5417 commits

Author SHA1 Message Date
Leonardo de Moura
348ccf533c feat(library/compiler): borrowed annotations 2019-02-11 10:08:47 -08:00
Leonardo de Moura
7e8f9e6f66 feat(library/compiler): add [extern] attribute 2019-02-09 18:53:44 -08:00
Leonardo de Moura
04ddd55b32 fix(library/derive_attribute): , is also an attribute terminator 2019-02-09 18:06:02 -08:00
Leonardo de Moura
d8c9740902 chore(library/compiler/builtin): fix compiler warning 2019-02-09 18:03:53 -08:00
Leonardo de Moura
e8758a1707 chore(library/compiler/export_attribute): exporting constructors is messy
It is much simpler and only slightly more verbose to export an
auxiliary function that just invokes the constructor.
2019-02-09 18:00:27 -08:00
Leonardo de Moura
bf15ee48fd refactor(library/compiler): export_name ==> export_attribute 2019-02-09 17:59:46 -08:00
Leonardo de Moura
9aed74a5e0 refactor(library/compiler): move extension for storing LLNF code 2019-02-09 17:59:46 -08:00
Leonardo de Moura
a4f305a443 fix(library/compiler/export_name): allow constructors to be exported with a different name 2019-02-08 16:36:08 -08:00
Leonardo de Moura
b09be6d0a5 fix(library/compiler/emit_cpp): missing { } 2019-02-08 11:06:29 -08:00
Leonardo de Moura
4339afc802 chore(library/compiler): [extname] ==> [export] 2019-02-08 10:25:21 -08:00
Max Wagner
3164801a83 fix(library/vm): unary op dummies copy-paste error 2019-02-08 09:56:20 -08:00
Max Wagner
e663f75fb2 chore(library/compiler): move builtins into the environment 2019-02-08 09:56:03 -08:00
Leonardo de Moura
ba449aa9f4 chore(library/compiler/llnf): fix compilation warning 2019-02-07 15:02:26 -08:00
Sebastian Ullrich
25ffbdda57 chore(src/*): fix style 2019-02-07 15:41:12 +01:00
Leonardo de Moura
14dd0d4907 feat(library/compiler): treat a function named main as the main function 2019-02-06 17:20:23 -08:00
Leonardo de Moura
16c0e62fa1 feat(library/compiler/emit_cpp): emit main 2019-02-06 14:34:52 -08:00
Leonardo de Moura
b85f4aac88 feat(library/compiler/extname): add validation 2019-02-06 13:24:42 -08:00
Leonardo de Moura
a8e2e535a2 feat(library/compiler): preserve the arity of entry points 2019-02-06 12:58:18 -08:00
Leonardo de Moura
b4a7bb4f4c refactor(library/compiler): [cppname] ==> [extname]
We will use this atttribute for all backends.
2019-02-06 12:53:12 -08:00
Leonardo de Moura
f38de694b0 feat(frontends/lean/definition_cmds): compile code after attributes have been applied
@kha do you see any problem with this change?
2019-02-06 12:14:53 -08:00
Leonardo de Moura
d103ff70fe feat(library/compiler): avoid cnstr_set_scalar when possible 2019-02-06 10:49:58 -08:00
Sebastian Ullrich
57b2607463 fix(library/compiler/specialize): declare specialized functions before caller 2019-02-06 09:36:36 -08:00
Sebastian Ullrich
58830be91f chore(library/compiler/emit_cpp): ignore warnings under GCC 2019-02-06 09:35:51 -08:00
Sebastian Ullrich
34110945f2 refactor(library/compiler/llnf): replace is_runtime_builtin_cnstr with just is_builtin_constant 2019-02-06 09:35:16 -08:00
Sebastian Ullrich
11860a65eb fix(library/compiler/emit_cpp): replace constructor tag on reuse 2019-02-06 09:34:14 -08:00
Sebastian Ullrich
eb85081a03 fix(library/compiler/emit_cpp): let y = f x; let z = ...; y is not a tail call 2019-02-06 09:33:38 -08:00
Leonardo de Moura
a35a951374 chore(library/compiler/emit_cpp): add uint* aliases 2019-02-05 17:01:10 -08:00
Leonardo de Moura
914b023920 feat(library/compiler): treat decidable as an enumeration type
Before this commit, `decidable` was not being treated as an
enumeration type, and this was very inconvenient because `bool` and
`decidable` were using a different representation at runtime.

This commit does not complete the modification. We still have to
regenerate `boot`, and then fix the builtin declarations at `runtime`.

cc @kha
2019-02-05 16:08:23 -08:00
Leonardo de Moura
2058d33d07 feat(runtime,library/compiler): add name.dec_eq builtin 2019-02-05 14:36:02 -08:00
Leonardo de Moura
3444a295e7 feat(library/compiler,runtime): builtin support for lean.name 2019-02-05 12:57:46 -08:00
Leonardo de Moura
c5b0258e49 feat(library/compiler/util): do not box unit 2019-02-04 16:19:48 -08:00
Leonardo de Moura
e57401232c fix(library/compiler/emit_cpp): bug at emit 0-ary constructor of non enum type (e.g., list.nil) 2019-02-04 16:07:31 -08:00
Leonardo de Moura
7c355d3ba6 feat(library/compiler): thunk support 2019-02-04 15:22:18 -08:00
Leonardo de Moura
4d66836255 fix(library/compiler/llnf): bug at process_cases
We should not decrement the RC of borrowed variables.
2019-02-04 12:51:51 -08:00
Leonardo de Moura
7eb9c46bc6 fix(library/compiler): functions marked as @[noinline] were not being replaced by their reduced arity version 2019-02-04 12:23:37 -08:00
Leonardo de Moura
25ec21b498 feat(library/compiler/name_mangling): new name mangling procedure that produces more readable output 2019-02-04 10:31:38 -08:00
Leonardo de Moura
67f4fb603d chore(library/compiler/emit_cpp): unnecessary line break 2019-02-03 19:19:01 -08:00
Leonardo de Moura
79e8358f9c fix(library/compiler/emit_cpp): tail call optimization 2019-02-03 19:16:50 -08:00
Leonardo de Moura
e5e245d0f2 chore(library/compiler/emit_cpp): missing space 2019-02-03 10:41:41 -08:00
Leonardo de Moura
5aab81d773 chore(library/compiler/emit_cpp): ignore unused labels 2019-02-03 10:37:34 -08:00
Leonardo de Moura
73f4100a46 feat(library/compiler/emit_cpp): tail call optimization 2019-02-03 10:31:39 -08:00
Leonardo de Moura
65e7e785ff fix(library/compiler/llnf): include closures at is_unboxed 2019-02-03 10:04:21 -08:00
Leonardo de Moura
90499abd94 fix(library/compiler/llnf): inc is only needed if variable has type _obj 2019-02-01 17:53:58 -08:00
Leonardo de Moura
e31f026bb2 fix(library/compiler/emit_cpp): add extern for constants declared in other modules 2019-02-01 17:26:12 -08:00
Leonardo de Moura
0918a599ae feat(*): builtin support for uint functions
@kha The VM versions just throw exceptions. They are just stubs to
make sure we can compile Lean.
I implemented the uint functions in the new runtime, but there are a
few missing cases marked with TODO.
I needed these builtins to be able to compile the C++ generated code for
corelib.
2019-02-01 17:04:24 -08:00
Leonardo de Moura
ec5a326157 fix(library/compiler/emit_cpp): include runtime/io.h 2019-02-01 15:12:30 -08:00
Leonardo de Moura
6e8f8a8cdc fix(library/compiler/emit_cpp): another bug in emit_quoted_string 2019-02-01 14:59:51 -08:00
Leonardo de Moura
d12667fb6b fix(library/compiler/emit_cpp): bug handling 0-ary _cnstr 2019-02-01 14:35:40 -08:00
Leonardo de Moura
d461833fcd fix(library/compiler/llnf): _sset and _uset were taking invalid LLNF arguments 2019-02-01 14:31:08 -08:00
Leonardo de Moura
b6f7472dd7 fix(library/compiler/emit_cpp): remove leftover 2019-02-01 14:21:17 -08:00