Commit Graph

1872 Commits

Author SHA1 Message Date
Tetralux
140bb3ebfc Fix -build-mode:shared type table on Unix
Fixes #527.

Previously on Linux, '__$startup_runtime', the procedure that
initializes the type table for runtime typeids, was NOT called when
a shared library was loaded by the dynamic loader.

This caused the library to not have its type table populated, which
caused an assert to fail if you tried to use runtime typeids - like
core:fmt, for example.

This commit fixes this by calling ld instead of clang, when building a
shared library, so that we can pass "-init '__$startup_runtime'" to it,
when building a shared library.

Try as I might, I could not get clang to correctly pass through
the linker flags that I wanted.
2020-11-06 20:44:11 +00:00
Platin21
8c46582667 Fixes text layout now via GitHub 2020-10-31 22:37:11 +01:00
Platin21
f29f7351e9 Revert "Changed tab width was on 2 now 4"
This reverts commit fc7c0ca3b0.
2020-10-31 22:30:03 +01:00
Platin21
fc7c0ca3b0 Changed tab width was on 2 now 4 2020-10-31 22:29:02 +01:00
Platin21
8158239d76 Sets llvm api back to use the generic sdk link 2020-10-31 22:15:16 +01:00
Platin21
f3108493fb Combines all link-able types to a single if and adds .o for linking 2020-10-31 22:12:50 +01:00
Platin21
7694a89d38 Fix for local/lib linking from brew for macOS 2020-10-31 22:05:40 +01:00
gingerBill
08fae7360a Fix ir printing for nested procedure literals indirectly through identifiers 2020-10-29 09:58:08 +00:00
gingerBill
4629754f7c Inline asm expression (-llvm-api)
See https://llvm.org/docs/LangRef.html#inline-assembler-expressions
Example:
```
x := asm(i32) -> i32 {
    "bswap $0",
    "=r,r",
}(123);
```
Allowed directives `#side_effect`, `#align_stack`, `#att`, `#intel` e.g. `asm() #side_effect #intel {...}`
2020-10-24 16:32:37 +01:00
gingerBill
0061e63db0 Merge branch 'master' of https://github.com/odin-lang/Odin 2020-10-24 15:08:46 +01:00
gingerBill
5fa488f163 Add intrinsics.cpu_relax for llvm-api 2020-10-24 15:08:35 +01:00
gingerBill
71ef27fef9 Merge pull request #753 from Tetralux/fix-dirnoexist-error
Fix error message when importing package that does not exist
2020-10-24 09:41:26 +01:00
gingerBill
feeb342c00 Improve multiple return value copy-elision 2020-10-20 17:08:55 +01:00
gingerBill
c4dbc88a12 Improve array programming code generation 2020-10-20 15:38:41 +01:00
gingerBill
f4b4cd0433 Specific set the code gen level for -llvm-api 2020-10-20 12:43:15 +01:00
gingerBill
4e5b8f2c61 Add -build-mode:assembly for -llvm-api 2020-10-20 12:35:12 +01:00
gingerBill
0be6ddc7e2 Add -microarch:<string> (e.g. -microarch:native) 2020-10-20 12:25:11 +01:00
gingerBill
b1bdd95f19 Begin work on making packages import assembly sort files (.S) 2020-10-16 15:32:09 +01:00
gingerBill
289908e0b8 Add +build ignore tag 2020-10-15 16:25:57 +01:00
gingerBill
5a28a7e0f5 Add intrinsics.type_field_index_of 2020-10-15 16:12:47 +01:00
gingerBill
f8e697dbbb Fix indirect selector bug with using on offset_of 2020-10-15 14:58:57 +01:00
gingerBill
ec5934705c Enforce do bodies to be on the same line as the control statement's condition or token 2020-10-14 15:59:19 +01:00
Tetralux
dfac45942c Fix error message when importing package that does not exist
Previously on Linux, if a file in your program tried to import a
package that did not actually exist, read_directory() assumed that
the errno after calling opendir() was ENOTDIR.

This was incorrect.

Instead, we now switch on errno and check for ENOENT, which it is
if the directory does not exist.
2020-10-09 05:56:12 +01:00
gingerBill
dd4c02a1b9 Fix multiple declared foreign procedures 2020-10-01 12:02:07 +01:00
Platin21
d72a01a714 Merge branch 'master' of https://github.com/odin-lang/Odin 2020-09-27 22:13:12 +03:00
Platin21
2ed6785b4a Adds -syslibroot to linker command needed for System.framework 2020-09-27 22:11:23 +03:00
gingerBill
4936713a5e Merge pull request #740 from bttelle/issue-697
Fix issue #697
2020-09-26 21:09:40 +01:00
gingerBill
654b24e514 Add -disallow-do 2020-09-23 17:17:32 +01:00
gingerBill
4844dd4d96 Add check to block statements to see if they only contain one statement, a value declaration, and err. 2020-09-23 11:16:33 +01:00
gingerBill
609af3a651 Fix and clean up default procedure parameter code for non-constant types 2020-09-22 12:06:05 +01:00
gingerBill
20e4548999 Make llvm-c header use local includes 2020-09-18 13:18:28 +01:00
Joseph Battelle
7490ac2cfd Fix issue #697
Add `is_type_typeid` check to `does_field_type_allow_using`
2020-09-16 21:18:25 -07:00
Joseph Battelle
3a3d415295 Fix issue #486
Use `check_is_assignable_to_using_subtype` in
`is_polymorphic_type_assignable`.

The polymorphic procedure in #486 can now also be written without the
cast:
```odin
print_entity :: proc(e : ^$E, p : proc(^$T) = print_base) { p(e); }
```
2020-09-16 12:32:57 -07:00
gingerBill
59d9821bd9 Add intrinsics.type_has_field 2020-09-16 20:08:45 +01:00
gingerBill
f530c80216 Fix -debug bug with internal startup procedures 2020-09-16 15:16:29 +01:00
nakst
c92860e142 update essence platform 2020-09-15 23:22:19 +01:00
gingerBill
ebad8e8990 Change how ir.cpp calls the startup type info procedure 2020-09-15 19:40:37 +01:00
gingerBill
9d976b04bc Fix +build tag logic 2020-09-15 12:45:44 +01:00
gingerBill
92cd50d3f0 Add TargetOS_freestanding for future use 2020-09-15 12:29:32 +01:00
gingerBill
1ef1407f02 Update ODIN_VERSION 2020-09-15 12:28:15 +01:00
gingerBill
edbad0709e Add -default-to-nil-allocator flag (sets ODIN_DEFAULT_TO_NIL_ALLOCATOR) 2020-09-15 12:27:53 +01:00
gingerBill
0cd681e6b7 Expose runtime._startup_runtime to allow for freestanding targets in the future 2020-09-15 10:51:51 +01:00
gingerBill
3211e60018 Merge pull request #734 from krixano/FreeBSD
FreeBSD Support
2020-09-15 10:12:42 +01:00
Joseph Battelle
e9c598a426 Fix issue #723
Typo in `check_stmt_internal` for case Ast_UsingStmt; first element
was used for all elements of the enumerated list.
2020-09-14 16:41:53 -07:00
Christian Seibold
577be4a8ae Get Odin compiling and produced exe's running on FreeBSD 2020-09-14 15:22:35 -05:00
Christian Seibold
ac126a8cd7 Add FreeBSD targets, get gb.h working with FreeBSD, fix odin_root_directory function for FreeBSD and a few other operating systems not yet added 2020-09-14 11:28:41 -05:00
Joseph Battelle
2f32b8fb3d Fix issue #515
Modify `check_type_specialization_to` to require exact values
to be equal when called with constant basic types. This also
now allows procedure group members to differ only by constant
value specializations.  See the further example in the issue.
2020-09-13 22:58:05 -07:00
gingerBill
1fd1203d8b Improve error message for multi-valued global declarations not be allowed 2020-09-12 16:04:02 +01:00
gingerBill
ccb7c3513b Fix check_arity_match bug 2020-09-12 15:50:42 +01:00
gingerBill
bf215377de Add edge case check for "" string 2020-09-11 16:20:46 +01:00