Commit Graph

35 Commits

Author SHA1 Message Date
Jeroen van Rijn
3cab2592c3 Compiler: Add early error for output path being a directory.
- Introduce new `Path` type and an array of build paths on the build context.
- Resolve input and output paths/files early (before parsing).
- Error early if inputs are missing or outputs are directories.
- Plumb new file path generation into linker stage instead of its adhoc method.

TODO:
- Remove more adhoc file path generation in parser and linker stage.
- Make intermediate object file generation use new path system.
- Round out and robustify Path helper functions.
2022-04-24 13:37:26 +02:00
gingerBill
f702c782f1 Make constant string backing structures use PrivateLinkage compared to InternalLinkage 2022-03-24 12:18:17 +00:00
gingerBill
3f935bea25 union #shared_nil
This adds a feature to `union` which requires all the variants to have a `nil` value and on assign to the union, checks whether that value is `nil` or not. If the value is `nil`, the union will be `nil` (thus sharing the `nil` value)
2022-03-24 11:55:03 +00:00
gitlost
fdbbf24271 Fix issue #1592 "LLVM code gen error when using a constant in an if"
Changes lb_build_if_stmt() to return null lbValue if condition is
  cmpAnd, cmpOr or non-const neg and check in lb_build_if_stmt()
  to avoid short circuiting if that's the case
Adds test to "tests/issues" and adds step in CI to check this dir
2022-03-18 13:57:22 +00:00
gingerBill
0cc40db565 Begin work on support objc intrinsics 2022-02-08 17:04:55 +00:00
CiD-
498f68c06b avoid segfault on map resize 2022-01-26 14:37:15 -05:00
gingerBill
b190404b21 Fix double map dereference indexing 2022-01-26 16:37:16 +00:00
gingerBill
daebaa8b50 Fix #1319 2021-11-19 15:43:13 +00:00
gingerBill
3d3785a7f1 Remove many LLVM optimization passes which were causes UB due to them assuming C-like behaviour incompatible with Odin 2021-11-06 17:23:33 +00:00
gingerBill
6be104e521 Make llvm backend code use PtrMap; remove dead code 2021-11-05 16:43:53 +00:00
gingerBill
6ded538546 @(linkage=<string>) for procedures and variables; @(require) for procedures; package runtime linkage improvements; Subsequence improvements to lb_run_remove_unused_function_pass 2021-11-04 12:40:50 +00:00
gingerBill
7d715fe113 Add ODIN_LLVM_MINIMUM_VERSION_12 2021-10-25 16:05:22 +01:00
gingerBill
306bdf8869 Update alignment rules for matrix types as a compromise to keep zero padding 2021-10-25 00:46:50 +01:00
gingerBill
662cbaf425 Support indexing matrices 2021-10-19 12:13:19 +01:00
gingerBill
243e2e2b8a Basic support for matrix*vector, vector*matrix operations 2021-10-19 11:24:26 +01:00
gingerBill
4c655865e5 Begin work on matrix type 2021-10-18 16:52:19 +01:00
gingerBill
036fa5cb24 Correct ABI for windows with LLVM 2021-10-02 18:12:34 +01:00
gingerBill
81fe50d623 Add sizes to assert message 2021-10-02 17:48:09 +01:00
gingerBill
b9b9bd8612 Add message to assert; add sanity check for possible future behaviour 2021-10-02 17:44:24 +01:00
gingerBill
00671a59a0 Minor code cleanup for backend; add struct_fields_index_by_increasing_offset for future use 2021-10-02 17:22:56 +01:00
gingerBill
ebca0398a7 Remove need for alignment lb_struct_has_padding_prefix 2021-10-02 16:06:42 +01:00
gingerBill
444fedd8d4 Heavily improve the LLVM struct type generation to improve ABI 2021-10-02 15:45:46 +01:00
gingerBill
71f2289c20 Fix #1174 2021-09-18 15:10:29 +01:00
gingerBill
8de728e3dc LLVM Code Generator: Add explicitly padding between fields in LLVM struct types 2021-09-13 16:40:24 +01:00
gingerBill
042dbda47f Replace many uses of heap_allocator() with permanent_allocator() 2021-09-13 01:30:30 +01:00
gingerBill
fb8fa5217d Begin minimize Type size by replacing Array with Slice etc 2021-09-13 00:58:39 +01:00
gingerBill
e3359a2639 Prepare for LLVM 12.0.1 compatibility 2021-09-11 16:53:18 +01:00
gingerBill
726788a483 Treat Type_Tuple closer to a Type_Struct in lb_type 2021-08-26 22:01:02 +01:00
gingerBill
ad3a3547d6 Unify thread pool logic across the rest of the compiler, using a global thread pool 2021-08-26 21:22:30 +01:00
gingerBill
6a77fc4cdd Add multi-pointer types [^]T 2021-08-21 23:10:21 +01:00
gingerBill
df372dbd5b Migrate and remove more from gb.h 2021-08-19 15:38:21 +01:00
gingerBill
7845769d4b Remove unused code 2021-08-19 15:03:10 +01:00
gingerBill
ad402726f1 Fix #1026 2021-08-13 12:21:14 +01:00
gingerBill
01f431b01f Unify semantics of the built-in swizzle procedure with the selector expression semantics e.g. .xyz 2021-08-09 19:37:58 +01:00
gingerBill
40822be595 Reorganize llvm_backend.cpp into separate files for easier maintenance 2021-08-07 12:01:48 +01:00