Commit Graph

816 Commits

Author SHA1 Message Date
Harold Brenes
bab4ce11fc Rename iOS subtarget to iPhone for consistency.
Add `ODIN_PLATFORM_SUBTARGET_IOS` builtin constant which evaluated to
`true` when the platform is `Darwin` and the subtarget it either `iPhone` or `iPhoneSimulator`
2025-07-14 21:55:28 -04:00
Harold Brenes
0e245fb40f Updated iOS/iPhoneSimulator build support 2025-07-13 20:17:30 -04:00
gingerBill
87247b8bb7 Merge pull request #5286 from Feoramund/no-san-mem
Add `@(no_sanitize_memory)` with additions to `base:sanitizer`
2025-06-09 12:46:22 +01:00
Feoramund
54f018ffc7 Guard against untyped nil in type cycle and type info sections
Fixes #5299
2025-06-08 17:48:01 -04:00
Feoramund
1cd1f9fec4 Add nullptr check in add_type_info_type_internal
Fixes #5215
2025-06-06 09:23:06 -04:00
Feoramund
9c5640886d Add @(no_sanitize_memory) proc attribute with MSan additions to base:sanitizer 2025-06-05 16:06:40 -04:00
Jeroen van Rijn
229c734820 Add comments to builtin.odin, documenting ODIN_* constants. (#5218)
And document constants not previously listed.
2025-05-26 18:58:59 +02:00
Feoramund
b018528833 Do not call disabled deferred procedures 2025-05-19 20:50:43 -04:00
Jeroen van Rijn
7c80df4830 @(init), @(fini) and @(export) procedures are classified as used.
For the purposes of `-vet-unused-procedures`, exported procedures and `@(init)` and `@(fini)` are now disregarded.
2025-05-17 16:22:47 +02:00
gingerBill
92df892f25 Merge pull request #5064 from harold-b/hb/objc-classes
Add support for Objective-C class implementation
2025-05-08 12:58:33 +01:00
Harold Brenes
6d18560ca3 Move unconditionally exporting Objective-C methods to the right location 2025-05-03 03:09:31 -04:00
Harold Brenes
cf3830a6a8 Fix checker errors. 2025-05-03 03:09:31 -04:00
Harold Brenes
a00b91577d Prevent multiple uses of the same Objective-C class name 2025-05-03 03:09:30 -04:00
Harold Brenes
5f0b47c373 Implement all checker specification for Objective-C class implementations and objc_ivar_get intrinsic 2025-05-03 00:59:33 -04:00
Lucas Perlind
5c73b4ef58 Add attribute @(no_sanitize_address)
The purposes of this attribute is to let procedures opt-out of being
instrumented with asan. Typically an allocator that includes 'in-band'
meta-data will be accessing poisoned values (such as tlsf).

Making asan work with these allocators becomes very challenging so
just being to ignore asan within specific allocator procedures
makes it easier to reason and removes the need to temporarily
poison and unpoison allocator data.
2025-05-01 20:42:21 +10:00
Harold Brenes
89533f49e4 Fix more styling and minor issues 2025-04-27 23:05:17 -04:00
Harold Brenes
f3923ed666 Fix indentations
Fix Objective-C wrapper procs not forwarding return value
2025-04-27 22:55:53 -04:00
Jeroen van Rijn
d463aba7d1 Warn if someone imports the same case-folded path twice 2025-04-27 14:32:26 +02:00
Harold Brenes
47abea1229 Add support for Objective-C method implementation with Odin calling convention.
Use @objc_context_provider to provide a context for a type.
2025-04-23 02:05:51 -04:00
Harold Brenes
a3de9c8de4 Add initial support for Objective-C class implementation 2025-04-20 21:53:46 -04:00
gingerBill
a66ea9bf4a Remove warning on struct field parameters being too big for the stack 2025-04-09 13:23:15 +01:00
gingerBill
e6718fcfcc Very very rudimentary support for -target:linux_arm64 -subtarget:android 2025-03-26 13:09:39 +00:00
gingerBill
55317b0987 Fix #4914 2025-03-06 11:15:27 +00:00
gingerBill
ebda946d61 Move temporary array out of CheckerInfo 2025-02-22 18:12:43 +00:00
gingerBill
5489a88983 Change typeid definition to be based around the canonical type hash
`typeid` used to be a fancy index with extra metadata stored on it. Now it is direct hash of the type.

This is safe to do in practice since any possible collisions are checked at compile time AND the chances of having a 1% collision are around 1 in 600K (see the Birthday Paradox).

Therefore accessing a `^Type_Info` is now a hash table lookup with linear probing. The table is twice the size than necessary so prevent too much probing due to an overly dense hash table.
2025-02-20 14:10:45 +00:00
gingerBill
1d348318f2 Use PtrMap temporarily 2025-02-20 13:23:23 +00:00
gingerBill
0bac34eec8 Number fields within procedures with a depth-first numbering system 2025-02-19 10:59:05 +00:00
gingerBill
19b59461b0 Use TypeSet for DeclInfo deps 2025-02-18 13:31:34 +00:00
gingerBill
721bcf2249 Minor code clean up 2025-02-18 13:24:08 +00:00
gingerBill
d69eb57cfa Fix typos 2025-02-18 13:18:51 +00:00
gingerBill
4a29d9bb84 Simplify type info table construction 2025-02-17 16:29:42 +00:00
gingerBill
b8f057951c Begin work on TypeSet 2025-02-17 13:46:17 +00:00
gingerBill
9b26bb2e6a Begin work on hash types 2025-02-17 13:10:38 +00:00
gingerBill
99d91ccd31 Work on making name mangling deterministic 2025-02-17 11:32:49 +00:00
gingerBill
2af60b8767 Fix #4763 2025-01-31 09:30:15 +00:00
gingerBill
0cd20e61ab Add @(export) foreign import 2025-01-31 08:34:15 +00:00
gingerBill
868ab27720 Add @(ignore_duplicates) for foreign import declarations 2025-01-28 10:31:46 +00:00
flysand7
87b590c99b Do not warn about stack overflow in range loops 'by reference' 2025-01-16 22:11:30 +03:00
gingerBill
bca08d3b85 Make -no-dynamic-literals the default now 2025-01-05 13:33:06 +00:00
gingerBill
c8ad2a4245 Support multiple paths for wasm in foreign import 2025-01-01 15:12:54 +00:00
gingerBill
e38a08013e Remove #relative types from the compiler 2024-11-14 16:17:24 +00:00
gingerBill
aeb568f79a Ignore package runtime with using -vet-unused-packages 2024-10-02 15:04:50 +01:00
Beau McCartney
e3eea1b9fa print proc types in same order as procs 2024-09-29 23:55:55 -06:00
Beau McCartney
fe8325f0ad fix deferred procedure errors 2024-09-29 23:34:09 -06:00
gingerBill
09588836e7 Add -vet-unused-procedures 2024-09-17 11:33:42 +01:00
gingerBill
19c1ed154c Add -vet-packages:<comma-separated-string-array> 2024-09-17 11:01:26 +01:00
Laytan Laats
7f3d8e115f remove comma 2024-08-31 02:45:17 +02:00
Laytan Laats
7624ecf4ba fix some issues with the "bad import name" errors
There was so much wrong here:
- The `if` statement was never entered because even on invalid import
  names `path_to_entity_name` returns "_"
- Two errors were shown where one doesn't make sense, need to choose one
  based on context
- Structure of the messages were different from other error messages
- Suggestion was using the wrong import path
2024-08-31 02:30:32 +02:00
gingerBill
a4e865f90b Fix #4166 2024-08-30 11:01:06 +01:00
avanspector
47f423c123 Set a flag for delayed checking 2024-08-30 01:32:06 +02:00