Commit graph

5397 commits

Author SHA1 Message Date
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
Leonardo de Moura
42ee42b732 fix(library/compiler/emit_cpp): bug at quote_string 2019-02-01 14:15:38 -08:00
Leonardo de Moura
4fa06e38b2 chore(*): add skeleton for new builtin primitives, update src/boot 2019-02-01 14:03:03 -08:00
Leonardo de Moura
51343a0e3a chore(library/compiler/builtin): rename primitives 2019-02-01 13:39:35 -08:00
Leonardo de Moura
7c32e04f9c chore(library/compiler/emit_cpp): avoid line breaks when declaring blocks of variables 2019-02-01 13:36:43 -08:00
Leonardo de Moura
d154b45d4c chore(library/compiler/builtin): avoid unused variable warning on clang++ 2019-02-01 13:33:52 -08:00
Leonardo de Moura
1212207446 fix(library/compiler/reduce_arity): we should not create auxiliary definitions with 0 arguments at reduce_arity 2019-02-01 11:15:51 -08:00
Sebastian Ullrich
64ab576dbf fix(shell/lean,library/messages): print messages in correct order (and immediately) when --json was not given 2019-02-01 17:10:14 +01:00
Leonardo de Moura
150555e03f chore(library/compiler/emit_cpp): temporarily comment line
See new comment to understand motivation for the change.
2019-01-31 18:24:31 -08:00
Leonardo de Moura
3af0d91bbb fix(library/compiler/llnf): missing cases at explicit_boxing_fn 2019-01-31 18:16:36 -08:00
Leonardo de Moura
ddc5cf05c4 fix(library/compiler/llnf): user numeric literals to store enum type values in LLNF 2019-01-31 17:58:03 -08:00
Leonardo de Moura
7a322340cb fix(library/compiler/llnf): in LLNF, the _box.n argument must be a variable 2019-01-31 17:54:06 -08:00
Leonardo de Moura
39f45beec0 chore(library/compiler/llnf): fix typo 2019-01-31 17:52:59 -08:00
Leonardo de Moura
0f47787a06 fix(library/compiler/llnf): remove bad optimization
It may destroy boxed value information. Moreover, we want
terminals to be jmp, variable or cases.
2019-01-31 17:52:28 -08:00
Leonardo de Moura
94d7b4e094 fix(library/compiler/emit_cpp): support for _unreachable 2019-01-31 17:05:52 -08:00
Leonardo de Moura
a1b65acf3d fix(library/compiler/builtin): add lean:: prefix
TODO: we will need to revise this for the LLVM backend.
In principle, builtins that are used by LLVM and C++ backends should be
`extern "C"` in a global namespace.
2019-01-31 16:57:25 -08:00
Leonardo de Moura
353d16f5f6 fix(library/compiler/emit_cpp): mpz ==> lean::mpz 2019-01-31 16:57:07 -08:00
Leonardo de Moura
5f29b1003b fix(library/compiler/emit_cpp): missing enf_unreachable case 2019-01-31 16:37:02 -08:00
Leonardo de Moura
4166851574 feat(library/compiler/emit_cpp): emit_box and emit_unbox 2019-01-31 16:16:30 -08:00
Leonardo de Moura
78842d8d03 feat(library/compiler/emit_cpp): emit_proj, emit_sproj, emit_uproj, emit_sset, emit_uset 2019-01-31 15:38:53 -08:00
Leonardo de Moura
80754e84c5 feat(library/compiler/emit_cpp): emit_closure 2019-01-31 15:06:04 -08:00