Commit Graph

608 Commits

Author SHA1 Message Date
whitequark 24562d232e compiler: don't die if addr2line cannot extract line from backtrace.
Fixes #885.
2018-01-08 22:02:38 +00:00
whitequark d419ccdeca compiler: do not permit str(...). (#878) 2017-12-27 11:48:21 +08:00
whitequark 4bda29f863 compiler: fix typo in a0a2650f. 2017-12-27 10:44:26 +08:00
whitequark fbf7e70ef8 compiler: do not ever emit !tbaa on invoke instructions. 2017-12-27 10:44:03 +08:00
whitequark ca48c29a8b compiler: update for llvmlite 0.20.0. 2017-12-27 10:43:55 +08:00
whitequark c9be535ba5 compiler: do not use invoke for calls to nounwind ffi functions.
Otherwise, declarations such as:

  @syscall(flags={"nounwind", "nowrite"})
  def foo(...):

trip an LLVM assert because the invoke instruction and the !tbaa
metadata are no longer compatible since LLVM 4.0.
2017-12-27 10:43:48 +08:00
whitequark 30b7bcf362 Update to LLVM 4.0. 2017-12-27 10:43:04 +08:00
Sebastien Bourdeauducq 0c47f83634 clean up rtio_log 2017-11-03 01:13:07 +08:00
whitequark db8300c990 compiler: disallow op= on mutable values (fix #835).
In general, we can't reallocate a value in earlier stack frames,
or fixup references to it. This mainly impacts lists.
2017-10-02 11:03:03 +08:00
whitequark ce7e30edfe compiler: implement ~ operator (fix #836). 2017-10-02 11:03:02 +08:00
whitequark a06f04dfbe compiler: minor intrinsic refactoring. 2017-10-02 11:03:02 +08:00
whitequark 1521231b1b compiler: correct semantics of floating point % operator (fix #830). 2017-10-02 11:03:02 +08:00
whitequark 67997d8955 compiler: correct semantics of integer % operator (#830). 2017-10-02 11:03:02 +08:00
whitequark ea7549cfa4 compiler: coerce `while` condition to bool.
Fixes #768.
2017-07-01 18:59:07 +00:00
whitequark f7254dd3ce compiler.validators.constness: take AugAssign into account. 2017-06-09 07:31:08 +00:00
whitequark ad2ee714c2 compiler: do not permit iterating str values.
This currently breaks badly on UTF-8, and doesn't even return
a value of a correct type.
2017-06-09 07:29:31 +00:00
whitequark 4e7493843a compiler: Constness is a validator, not analysis. 2017-06-09 07:29:31 +00:00
whitequark 5d841d08e9 compiler: do not permit mutation of bytes values (#714). 2017-06-09 07:29:28 +00:00
whitequark 284382b1f5 compiler: add support for bytearray values in RPC (#714). 2017-06-09 07:15:25 +00:00
whitequark 9ed4e9c1cd compiler: add support for printing of bytearray values (#714). 2017-06-09 07:15:25 +00:00
whitequark e9564b15c8 compiler: add support for bytearray type (#714). 2017-06-09 07:15:24 +00:00
whitequark 5b4fde30a8 compiler: unbreak subscripts for bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark 66a683f583 compiler: add support for bytes values in RPC (#714). 2017-06-09 07:10:48 +00:00
whitequark 778e7dc2ab compiler: add support for concatenating bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark 7b2da5294f compiler: add support for printing of bytes values (#714). 2017-06-09 07:10:48 +00:00
whitequark dba4e1a28b compiler: add support for bytes type and b"x" literals (#714). 2017-06-09 07:10:48 +00:00
Sebastien Bourdeauducq cd757c0f16 generate device database from executable python file 2017-05-18 23:14:55 +08:00
whitequark bb64992395 compiler: remove dead code. 2017-04-21 18:38:43 +00:00
whitequark c5d7445973 compiler: reject reachable implicit return if not returning TNone.
Fixes #718.
2017-04-21 18:11:14 +00:00
whitequark ed2b10c5aa compiler: in codegen for delay(), round fp instead of truncating.
Consider delay(8*us). It results in the following computation...
  >>> 8*1e-06/1e-09
  7999.999999999999
with the result promptly getting truncated to 7999.

Fixes #706.
2017-04-21 17:36:44 +00:00
whitequark 3a1fc729cf compiler: refactor type annotations recognizing in kernels.
The new implementation is much more generic, more robust,
and shares code with the same for syscalls as well as RPCs.

Fixes #713.
2017-04-13 08:26:10 +00:00
whitequark 31048f4b6a compiler: fix monomorphization of coerced integer literals.
Fixes #703.
2017-04-12 04:11:47 +00:00
whitequark 1bd4d13391 artiq_compile: make print() write to core log, not an invalid op.
Fixes #710.
2017-04-11 03:16:34 +00:00
whitequark 86dea869b3 compiler.types: add missing TTuple.__hash__ implementation. 2017-03-03 03:27:49 +00:00
whitequark 7e886ddc89 transforms.inferencer: do not unnecessarily mutate typedtree.
This caused the hash to change after every iteration of inference,
if the result of any coercion was an integer of indefinite width.
2017-03-02 16:15:37 +00:00
whitequark 8c9f157563 compiler.embedding: fix an overly lax hasher. 2017-03-02 15:28:24 +00:00
whitequark a79c3c2cff compiler.transforms: implement a typedtree printer. 2017-03-02 15:28:04 +00:00
whitequark 4107938fd8 compiler.embedding: use attribute count in fixpoint condition.
Before this commit, we had a hack where inferencing would run
one more time, in case we can still infer more attributes even
after all the type information is there. This doesn't work
if *that* round of inferencing brings even more code, e.g.
this is easy to trigger with context managers.
2017-02-28 21:28:40 +00:00
whitequark 252cda6e7f compiler.llvm_ir_generator: fix string quoting. 2017-02-28 21:28:38 +00:00
whitequark de015b994d compiler: allow dumping the object file with ARTIQ_DUMP_OBJ. 2017-02-26 17:09:21 +00:00
whitequark 3a1f14c16c compiler: fix overly strict constness analysis.
Before this commit, the following code would fail to compile...
  obj.foo.bar = True
... if foo is marked kernel_invariant in obj, even if bar is not
marked as such in obj.foo.
2017-02-26 01:58:21 +00:00
whitequark d04e611232 firmware, compiler: rename rpc functions to be more consistent. 2017-02-25 14:12:58 +00:00
whitequark c39394b4d5 firmware: port the exception handling routines to Rust. 2017-02-04 08:21:07 +00:00
whitequark fd8b11532f compiler, firmware: use Pascal strings everywhere.
This removes a large amount of very ugly code, and also simplifies
the compiler and runtime.
2017-02-03 11:53:27 +00:00
whitequark ee1b2fa3ea compiler: swap the order of ptr/len fields in lists.
This is to make them match the Rust slices.
Once the cslice crate becomes #![no_std] we'll also use its (tidier)
conversion functions.
2017-01-31 22:11:13 +00:00
whitequark ab71c9a0ba compiler: the len builtin is not polymorphic, coerce the result.
Fixes #659.
2017-01-31 21:28:20 +00:00
whitequark 6acdcbb82a Fix 2f37b1d. 2017-01-30 10:25:11 +00:00
whitequark 2f37b1d1c0 compiler: support methods defined on singleton instances.
Fixes #638.
2017-01-30 10:10:21 +00:00
whitequark 57f54dbd12 llvm_ir_generator: recognize inline and forceinline flags. 2017-01-25 10:25:00 +00:00
whitequark f68e4ae519 compiler: rein in overzealous cast monomorphization. 2016-12-05 05:08:57 +00:00