module internal.types.ptr
¶
Source: stdlib/internal/types/ptr.codon
Ptr[T]
@extend Class is extended to add given methods ¶
Magic methods¶
__new__()
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
ret ptr null
__new__(sz: int)
@overload Function is overloaded @internal Function is compiler-generated ¶
__new__(other: Ptr[T])
@pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @overload Function is overloaded @llvm Function is implemented with inline LLVM IR ¶
ret ptr %other
__new__(other: Ptr)
@pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @overload Function is overloaded @llvm Function is implemented with inline LLVM IR ¶
ret ptr %other
__int__(self)
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = ptrtoint ptr %self to i64
ret i64 %0
__copy__(self)
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
ret ptr %self
__bool__(self)
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = icmp ne ptr %self, null
%1 = zext i1 %0 to i8
ret i8 %1
__getitem__(self, index: int)
@pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR ¶
%0 = getelementptr {=T}, ptr %self, i64 %index
%1 = load {=T}, ptr %0
ret {=T} %1
__setitem__(self, index: int, what: T)
@self_captures Method's 'self' argument captures other arguments @llvm Function is implemented with inline LLVM IR ¶
%0 = getelementptr {=T}, ptr %self, i64 %index
store {=T} %what, ptr %0
ret {} {}
__add__(self, other: int)
@pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR ¶
%0 = getelementptr {=T}, ptr %self, i64 %other
ret ptr %0
__sub__(self, other: Ptr[T])
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = ptrtoint ptr %self to i64
%1 = ptrtoint ptr %other to i64
%2 = sub i64 %0, %1
%3 = sdiv exact i64 %2, ptrtoint (ptr getelementptr ({=T}, {=T}* null, i32 1) to i64)
ret i64 %3
__sub__(self, other: int)
@pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR ¶
%0 = sub i64 0, %other
%1 = getelementptr {=T}, {=T}* %self, i64 %0
ret {=T}* %1
__eq__(self, other: Ptr[T])
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = icmp eq ptr %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__ne__(self, other: Ptr[T])
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = icmp ne ptr %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__lt__(self, other: Ptr[T])
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = icmp slt ptr %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__gt__(self, other: Ptr[T])
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = icmp sgt ptr %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__le__(self, other: Ptr[T])
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = icmp sle ptr %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__ge__(self, other: Ptr[T])
@pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR ¶
%0 = icmp sge ptr %self, %other
%1 = zext i1 %0 to i8
ret i8 %1
__prefetch_r0__(self)
@nocapture Function does not capture arguments (return value might capture) @llvm Function is implemented with inline LLVM IR ¶
declare void @llvm.prefetch(ptr nocapture readonly, i32, i32, i32)
call void @llvm.prefetch(ptr %self, i32 0, i32 0, i32 1)
ret {} {}
__prefetch_r1__(self)
@nocapture Function does not capture arguments (return value might capture) @llvm Function is implemented with inline LLVM IR ¶
declare void @llvm.prefetch(ptr nocapture readonly, i32, i32, i32)
call void @llvm.prefetch(ptr %self, i32 0, i32 1, i32 1)
ret {} {}
__prefetch_r2__(self)
@nocapture Function does not capture arguments (return value might capture) @llvm Function is implemented with inline LLVM IR ¶
declare void @llvm.prefetch(ptr nocapture readonly, i32, i32, i32)
call void @llvm.prefetch(ptr %self, i32 0, i32 2, i32 1)
ret {} {}
__prefetch_r3__(self)
@nocapture Function does not capture arguments (return value might capture) @llvm Function is implemented with inline LLVM IR ¶
declare void @llvm.prefetch(ptr nocapture readonly, i32, i32, i32)
call void @llvm.prefetch(ptr %self, i32 0, i32 3, i32 1)
ret {} {}
__prefetch_w0__(self)
@nocapture Function does not capture arguments (return value might capture) @llvm Function is implemented with inline LLVM IR ¶
declare void @llvm.prefetch(ptr nocapture readonly, i32, i32, i32)
call void @llvm.prefetch(ptr %self, i32 1, i32 0, i32 1)
ret {} {}
__prefetch_w1__(self)
@nocapture Function does not capture arguments (return value might capture) @llvm Function is implemented with inline LLVM IR ¶
declare void @llvm.prefetch(ptr nocapture readonly, i32, i32, i32)
call void @llvm.prefetch(ptr %self, i32 1, i32 1, i32 1)
ret {} {}
__prefetch_w2__(self)
@nocapture Function does not capture arguments (return value might capture) @llvm Function is implemented with inline LLVM IR ¶
declare void @llvm.prefetch(ptr nocapture readonly, i32, i32, i32)
call void @llvm.prefetch(ptr %self, i32 1, i32 2, i32 1)
ret {} {}
__prefetch_w3__(self)
@nocapture Function does not capture arguments (return value might capture) @llvm Function is implemented with inline LLVM IR ¶
declare void @llvm.prefetch(ptr nocapture readonly, i32, i32, i32)
call void @llvm.prefetch(ptr %self, i32 1, i32 3, i32 1)
ret {} {}
__repr__(self)
¶
Methods¶
as_byte(self)
@pure Function has no side effects and returns same value for same inputs @derives Function return value captures arguments @llvm Function is implemented with inline LLVM IR ¶
ret ptr %self