David Mak
8fd7216243
[core] toplevel/composer: Add lateinit_builtins
...
This is required for the new core_log and rtio_log functions, which take
a generic type as its parameter. However, in ARTIQ builtins are
initialized using one unifier and then actually used by another unifier.
lateinit_builtins workaround this issue by deferring the initialization
of functions requiring type variables until the actual unifier is ready.
2024-08-13 15:19:03 +08:00
David Mak
5faeede0e5
Determine size_t using LLVM target machine
2024-07-26 13:35:38 +08:00
David Mak
4948395ca2
core/toplevel/type_annotation: Add handling for mismatching class def
...
Primitive types only contain fields in its Type and not its TopLevelDef.
This causes primitive object types to lack some fields.
2024-07-19 14:42:14 +08:00
lyken
ca8459dc7b
standalone: prettify TopLevelComposer error reporting
2024-06-27 10:15:14 +08:00
lyken
f026b48e2a
core: refactor to use `TypeVarId` and `TypeVar`
2024-06-13 16:59:10 +08:00
David Mak
23974feae7
meta: Restrict number of allowed lints
2024-06-12 16:10:57 +08:00
David Mak
40a3bded36
meta: Set clippy lints in {main,lib}.rs
...
So that this does not have to be manually passed to the `cargo clippy`
command-line every single time. Also allows incrementally addressing
these lints by removing and fixing them one-by-one.
2024-06-12 16:10:57 +08:00
lyken
8168692cc3
apply cargo fmt
2024-06-12 14:45:03 +08:00
David Mak
fd44ee6887
core: Apply clippy suggestions
2024-03-22 15:07:23 +08:00
David Mak
77de24ef74
core: Use BTreeMap for type variable mapping
...
There have been multiple instances where I had the need to iterate over
type variables, only to discover that the traversal order is arbitrary.
This commit fixes that by adding SortedMapping, which utilizes BTreeMap
internally to guarantee a traversal order. All instances of VarMap are
now refactored to use this to ensure that type variables are iterated in
the order of its variable ID, which should be monotonically incremented
by the unifier.
2024-03-04 23:56:04 +08:00
David Mak
bd792904f9
core: Add size_t to primitive store
...
Used for ndims in ndarray.
2023-12-21 15:20:31 +08:00
David Mak
8886964776
core: Remove redundant argument in type annotation parsing
2023-12-16 18:40:48 +08:00
David Mak
a19f1065e3
meta: Refactor to use more let-else bindings
2023-12-12 16:31:14 +08:00
David Mak
32746c37be
core: Refactor to return errors by HashSet
2023-12-12 15:41:59 +08:00
David Mak
ddfb532b80
standalone: Apply clippy pedantic changes
2023-12-11 15:16:23 +08:00
David Mak
02933753ca
core: Apply clippy pedantic changes
2023-12-11 15:16:23 +08:00
David Mak
d304afd333
meta: Apply clippy suggested changes
2023-12-11 15:16:23 +08:00
David Mak
031e660f18
core: Initial implementation for const generics
2023-12-08 18:02:11 +08:00
David Mak
68b97347b1
core: Infer builtins name list using builtin declaration list
2023-12-08 17:29:34 +08:00
Sebastien Bourdeauducq
adadf56e2b
nac3standalone: generate PIC
2023-12-04 19:09:50 +08:00
Sebastien Bourdeauducq
120f8da5c7
fix compilation warnings
2023-11-26 09:09:24 +08:00
David Mak
7fc2a30c14
Force single-threaded compilation if LLVM is not thread-safe
2023-10-16 15:55:10 +08:00
David Mak
950f431483
standalone: Update help text for `--emit-llvm`
2023-10-16 15:52:51 +08:00
David Mak
48eb64403f
standalone: Treat -T0 as using all available threads
2023-10-13 14:57:16 +08:00
David Mak
2c44b58bb8
standalone: Require use of `-T` for specifying thread count
2023-10-13 14:36:34 +08:00
David Mak
279376a373
standalone: Emit IRRT IR
2023-09-30 09:31:18 +08:00
David Mak
2a38d5160e
meta: Respect opt flags when performing whole-module optimization
2023-09-28 19:58:54 +08:00
David Mak
ab2360d7a0
core: Remove emit_llvm from CodeGenLLVMOptions
...
We instead output an LLVM bitcode file when the option is specified on
the command-line.
2023-09-22 17:16:29 +08:00
David Mak
f59d45805f
standalone: Add command line flags for target properties
...
For testing codegen for different platforms on the host system.
2023-09-18 11:35:20 +08:00
David Mak
048fcb0a69
core: Switch to LLVM New Pass Manager
2023-09-18 11:35:15 +08:00
David Mak
676d07657a
core: Add target field to CodeGenLLVMOptions
...
For specifying the target machine options when optimizing and linking.
This field is currently unused but will be required in a future
commit.
2023-09-18 09:46:24 +08:00
David Mak
474f9050ce
standalone: Expose flags in command-line
2023-09-12 16:20:49 +08:00
David Mak
3993a5cf3f
core: Add LLVM options to WorkerRegistry
2023-09-12 10:57:05 +08:00
David Mak
e4940247f3
standalone: Implement command-line parser using clap
...
In preparation for adding more command-line options.
2023-09-12 10:08:34 +08:00
z78078
ebd25af38b
nac3standalone: allow classes without explicit init ( #221 )
...
Reviewed-on: #304
Co-authored-by: z78078 <cc@m-labs.hk>
Co-committed-by: z78078 <cc@m-labs.hk>
2022-07-07 10:36:25 +08:00
Sebastien Bourdeauducq
a308d24caa
nac3standalone: cleanup
2022-04-18 16:02:48 +08:00
Sebastien Bourdeauducq
1eac111d4c
cleanup
2022-04-18 15:55:37 +08:00
ychenfo
44199781dc
nac3standalone: add tests for operators
2022-04-18 15:31:56 +08:00
pca006132
41d62f7325
nac3core/toplevel: fixed typevar substitution bug
2022-03-23 00:25:10 +08:00
Sebastien Bourdeauducq
3f890f183c
nac3standalone/demo: handle imports consistently
2022-03-19 09:14:27 +08:00
pca006132
234823c51a
nac3standalone: added typevar test
2022-03-18 16:52:52 +08:00
pca006132
f97f93d92c
applied rustfmt and clippy auto fix
2022-02-21 18:27:46 +08:00
pca006132
d9cb506f6a
nac3core: refactored for better error messages
2022-02-21 18:24:19 +08:00
pca006132
14d25b3b9d
Fixed broken tests
2022-02-13 17:21:42 +08:00
Sebastien Bourdeauducq
64b94955fe
nac3standalone: reorganize demos, compare against cpython
2022-01-23 10:35:06 +08:00
ychenfo
4760851638
nac3standalone: link modules and load irrt like in nac3artiq
2022-01-09 02:17:58 +08:00
Sebastien Bourdeauducq
b638d1b4b0
nac3standalone: set up LLVM inliner like in nac3artiq
2022-01-08 21:03:58 +08:00
Sebastien Bourdeauducq
9cc9a0284a
nac3standalone: style
2021-12-28 10:59:17 +08:00
ychenfo
88f0da7bdd
add file name to AST node location
2021-12-28 01:28:55 +08:00
pca006132
fa04768a77
redo "nac3core: fix #84 "
...
This reverts commit 86005da8e1
.
2021-12-27 22:56:26 +08:00