When a required built-in procedure is missing from the base:runtime
package, an assert should be triggered. However this does not happen
and instead the compiler crashes silently. The cause is the
null-dereference after scope_lookup_current returns nullptr.
This adds an assertion that the runtime procedure is found, before
proceeding to check it's type and performing further lookups.
Started with trying to enable asan in the CI for MacOS, noticed it wasn't enabled on the `tests/internal`
folder, it came up with a couple of issues with the abi/OdinLLVMBuildTransmute that this also solves.
- Looking at clang output for arm64, we should be promoting `{ i64, i32 }` to `{ i64, i64 }`
- after doing the previous point, I noticed this is not handled well in OdinLLVMBuildTransmute
which was emitting loads and stores into the space of a value that was alignment, asan does not want this,
looking at clang output again, a memcpy is the appropriate way of handling this.
- Having done this we don't need the hacky "return is packed" set anymore in the amd64 sysv ABI anymore either
Add support for handling generic types in LLVM backend
- Updated `lb_type_internal` to return a pointer type for unspecialized generics.
- Modified `write_type_to_canonical_string` to handle specialized generics without panicking.
- Enhanced `default_type` to return the default type of specialized generics when applicable.
Fix panic in LLVM backend when using generic procedure with default arguments
- Fixed panic in `llvm_backend_proc.cpp` when using unspecialized polymorphic procedures as defaults.
- Ensured correct type inference when generic procedures are used as default parameters.