Better lowering of distinct types. Noreturn function call expr recognized as a "jump" for escape analysis. Preferring "def" in libs. To upper / to lower for ascii. Initial dynlib support.

This commit is contained in:
Christoffer Lerno
2023-05-21 21:25:33 +02:00
committed by Christoffer Lerno
parent a877d4458c
commit ddd0497922
55 changed files with 579 additions and 416 deletions

View File

@@ -2,9 +2,9 @@ module std::os::macos::cf;
$if env::os_is_darwin():
typedef CFAllocatorRef = distinct void*;
typedef CFAllocatorContextRef = distinct void*;
typedef CFOptionFlags = usz;
def CFAllocatorRef = distinct void*;
def CFAllocatorContextRef = distinct void*;
def CFOptionFlags = usz;
macro CFAllocatorRef default_allocator() => _macos_CFAllocatorGetDefault();
macro void CFAllocatorRef.dealloc(CFAllocatorRef allocator, void* ptr) => _macos_CFAllocatorDeallocate(allocator, ptr);

View File

@@ -2,9 +2,9 @@ module std::os::macos::cf;
$if env::os_is_darwin():
typedef CFArrayRef = distinct void*;
typedef CFArrayCallBacksRef = distinct void*;
typedef CFMutableArrayRef = distinct void*;
def CFArrayRef = distinct void*;
def CFArrayCallBacksRef = distinct void*;
def CFMutableArrayRef = distinct void*;
extern fn CFArrayRef _macos_CFArrayCreate(CFAllocatorRef allocator, void** values, CFIndex num_values, CFArrayCallBacksRef callBacks) @extern("CFArrayCreate");
extern fn CFArrayRef _macos_CFArrayCopy(CFAllocatorRef allocator, CFArrayRef array) @extern("CFArrayCopy");
extern fn CFIndex _macos_CFArrayGetCount(CFArrayRef array) @extern("CFArrayGetCount");

View File

@@ -2,8 +2,8 @@ module std::os::macos::cf;
$if env::os_is_darwin():
typedef CFTypeRef = distinct void*;
typedef CFIndex = isz;
def CFTypeRef = distinct void*;
def CFIndex = isz;
struct CFRange
{
CFIndex location;

View File

@@ -2,10 +2,10 @@ module std::os::macos::objc;
$if env::os_is_darwin():
typedef Class = distinct void*;
typedef Method = distinct void*;
typedef Ivar = distinct void*;
typedef Selector = distinct void*;
def Class = distinct void*;
def Method = distinct void*;
def Ivar = distinct void*;
def Selector = distinct void*;
fault ObjcFailure
{