From 55ff9b857e5d143ba9b8271f8732bf43f5912dda Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 2 Feb 2024 11:51:26 +0000 Subject: [PATCH] Add `contextless` where missing --- base/runtime/core_builtin.odin | 6 +++--- base/runtime/docs.odin | 5 +++-- base/runtime/internal.odin | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/base/runtime/core_builtin.odin b/base/runtime/core_builtin.odin index f576adcc2..5c408e57a 100644 --- a/base/runtime/core_builtin.odin +++ b/base/runtime/core_builtin.odin @@ -122,7 +122,7 @@ pop :: proc(array: ^$T/[dynamic]$E, loc := #caller_location) -> (res: E) #no_bou // `pop_safe` trys to remove and return the end value of dynamic array `array` and reduces the length of `array` by 1. // If the operation is not possible, it will return false. @builtin -pop_safe :: proc(array: ^$T/[dynamic]$E) -> (res: E, ok: bool) #no_bounds_check { +pop_safe :: proc "contextless" (array: ^$T/[dynamic]$E) -> (res: E, ok: bool) #no_bounds_check { if len(array) == 0 { return } @@ -148,7 +148,7 @@ pop_front :: proc(array: ^$T/[dynamic]$E, loc := #caller_location) -> (res: E) # // `pop_front_safe` trys to return and remove the first value of dynamic array `array` and reduces the length of `array` by 1. // If the operation is not possible, it will return false. @builtin -pop_front_safe :: proc(array: ^$T/[dynamic]$E) -> (res: E, ok: bool) #no_bounds_check { +pop_front_safe :: proc "contextless" (array: ^$T/[dynamic]$E) -> (res: E, ok: bool) #no_bounds_check { if len(array) == 0 { return } @@ -826,7 +826,7 @@ map_insert :: proc(m: ^$T/map[$K]$V, key: K, value: V, loc := #caller_location) @builtin -card :: proc(s: $S/bit_set[$E; $U]) -> int { +card :: proc "contextless" (s: $S/bit_set[$E; $U]) -> int { when size_of(S) == 1 { return int(intrinsics.count_ones(transmute(u8)s)) } else when size_of(S) == 2 { diff --git a/base/runtime/docs.odin b/base/runtime/docs.odin index a520584c5..865eeb9ef 100644 --- a/base/runtime/docs.odin +++ b/base/runtime/docs.odin @@ -44,7 +44,7 @@ memcpy memove -## Procedures required by the LLVM backend +## Procedures required by the LLVM backend if u128/i128 is used umodti3 udivti3 modti3 @@ -59,11 +59,12 @@ truncdfhf2 gnu_h2f_ieee gnu_f2h_ieee extendhfsf2 + +## Procedures required by the LLVM backend if f16 is used __ashlti3 // wasm specific __multi3 // wasm specific - ## Required an entry point is defined (i.e. 'main') args__ diff --git a/base/runtime/internal.odin b/base/runtime/internal.odin index 21342ef17..4b85202fa 100644 --- a/base/runtime/internal.odin +++ b/base/runtime/internal.odin @@ -22,7 +22,7 @@ byte_slice :: #force_inline proc "contextless" (data: rawptr, len: int) -> []byt return ([^]byte)(data)[:max(len, 0)] } -is_power_of_two_int :: #force_inline proc(x: int) -> bool { +is_power_of_two_int :: #force_inline proc "contextless" (x: int) -> bool { if x <= 0 { return false } @@ -40,7 +40,7 @@ align_forward_int :: #force_inline proc(ptr, align: int) -> int { return p } -is_power_of_two_uintptr :: #force_inline proc(x: uintptr) -> bool { +is_power_of_two_uintptr :: #force_inline proc "contextless" (x: uintptr) -> bool { if x <= 0 { return false }