sun::codegen::intrinsics
namespace · Source (opens in a new tab)
Provides the generator for built-in operations.
Classes
- sun::codegen::intrinsics::IntrinsicsGenerator (public)
- sun::codegen::intrinsics::ThreadUtils (public)
Functions
- abort
- accept
- bind
- buildSockaddrIn
- close
- connect
- emitLibcWriteInline
- extractSockaddrInParts
- forwarder
- free
- fstat
- fsync
- ftruncate
- futexSyscallNumber
- get
- getIntrinsic
- getOrCreateAcceptFdHelper
- getOrCreateAcceptHelper
- getOrCreateBindHelper
- getOrCreateBindIPv4Helper
- getOrCreateConnectHelper
- getOrCreateConnectIPv4Helper
- getOrCreateFileCloseHelper
- getOrCreateFileOpenHelper
- getOrCreateFileReadHelper
- getOrCreateFileWriteHelper
- getOrCreateFstatHelper
- getOrCreateFsyncHelper
- getOrCreateFtruncateHelper
- getOrCreateGetSockNameIPv4Helper
- getOrCreateGetSockOptHelper
- getOrCreateListenHelper
- getOrCreateLseekHelper
- getOrCreateMkdirHelper
- getOrCreatePrint64Helper
- getOrCreatePrintCharHelper
- getOrCreatePrintI32Helper
- getOrCreatePrintNewlineHelper
- getOrCreatePrintStringHelper
- getOrCreateReadHelper
- getOrCreateRecvFromIPv4Helper
- getOrCreateRecvHelper
- getOrCreateRenameHelper
- getOrCreateRmdirHelper
- getOrCreateSendHelper
- getOrCreateSendToIPv4Helper
- getOrCreateSetSockOptHelper
- getOrCreateShutdownHelper
- getOrCreateSockaddrCallHelper
- getOrCreateSocketHelper
- getOrCreateUnlinkHelper
- getOrCreateWriteHelper
- getsockname
- getsockopt
- i32
- i64
- isDarwinTarget
- isGenericIntrinsic
- isIntrinsic
- listen
- lseek
- malloc
- mkdir
- open
- pthreadAttrDestroy
- pthreadAttrInit
- pthreadAttrSetstacksize
- pthreadCreate
- pthreadJoin
- ptr
- read
- recv
- recvfrom
- rename
- requiresUnsafeBlock
- rmdir
- send
- sendto
- setsockopt
- shutdown
- socket
- syscall
- ulockWait
- ulockWake
- unlink
- write
abort
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::abort(llvm::Module *m)void abort(void)
accept
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::accept(llvm::Module *m)int accept(int fd, struct sockaddr *addr, socklen_t *len)
bind
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::bind(llvm::Module *m)int bind(int fd, const struct sockaddr *addr, socklen_t len)
buildSockaddrIn
public · function · static · Source (opens in a new tab)
static Value * sun::codegen::intrinsics::buildSockaddrIn(IRBuilder<> &builder, LLVMContext &llvmCtx, Value *ip, Value *port, bool isDarwin)Fill a 16-byte stack sockaddr_in: family/port/addr, rest zeroed.
Port and addr sit at offsets 2 and 4 everywhere; the first two bytes differ per OS. Linux has a 16-bit sa_family_t at offset 0; Darwin splits them into a one-byte sin_len (the struct size) followed by a one-byte sin_family — a little-endian 16-bit store of AF_INET there would set sin_len=2 and sin_family=0 (AF_UNSPEC), so the bytes are stored individually. Port arrives in host order; sin_port is big-endian, hence the bswap16.
close
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::close(llvm::Module *m)int close(int fd)
connect
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::connect(llvm::Module *m)int connect(int fd, const struct sockaddr *addr, socklen_t len)
emitLibcWriteInline
public · function · static · Source (opens in a new tab)
static Value * sun::codegen::intrinsics::emitLibcWriteInline(IRBuilder<> &builder, llvm::Module *module, Value *fd, Value *buf, Value *len)Emits a C library write call for the supplied descriptor and bytes.
extractSockaddrInParts
public · function · static · Source (opens in a new tab)
static void sun::codegen::intrinsics::extractSockaddrInParts(IRBuilder<> &builder, LLVMContext &llvmCtx, Value *sockaddr, Value *outIp, Value *outPort)Load sin_addr (offset 4, left in network order) and sin_port (offset 2, swapped to host order and widened to i32) out of a sockaddr_in, storing them through the two out-pointers.
forwarder
public · function · Source (opens in a new tab)
llvm::Function * sun::codegen::intrinsics::forwarder(llvm::Module *module, const char *wrapperName, llvm::FunctionCallee callee, llvm::ArrayRef< llvm::Type * > params, llvm::Type *retTy)A thin internal wrapper around one libc function: the wrapper's signature matches the Sun intrinsic, the body is a single forwarding call.
Keeping the __sun_* wrapper preserves the intrinsic symbol names that existing call sites and .moon symbol handling rely on.
free
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::free(llvm::Module *m)void free(void *ptr)
fstat
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::fstat(llvm::Module *m)int fstat(int fd, struct stat *buf) — the buffer layout is the target libc's struct stat; Sun-side callers own that interpretation
fsync
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::fsync(llvm::Module *m)int fsync(int fd)
ftruncate
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::ftruncate(llvm::Module *m)int ftruncate(int fd, off_t length)
futexSyscallNumber
public · function · static · Source (opens in a new tab)
static int64_t sun::codegen::intrinsics::futexSyscallNumber(const llvm::Module *module)The futex syscall number is the one per-target constant left in thread support — it is data, not assembly, so each Linux target is one table row.
Darwin never reaches this: its targets take the ulock path instead.
get
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::get(llvm::Module *module, llvm::StringRef name, llvm::Type *ret, llvm::ArrayRef< llvm::Type * > params, bool isVarArg=false)Finds or declares a C runtime function with the requested LLVM signature.
getIntrinsic
public · function · Source (opens in a new tab)
Intrinsic sun::codegen::intrinsics::getIntrinsic(const std::string &name)Convert intrinsic function name to enum Returns Intrinsic::None if not recognized.
Related: Intrinsic, Intrinsic::None
getOrCreateAcceptFdHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateAcceptFdHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_accept_fd(fd: i32) -> i32 — accept with NULL addr/addrlen
getOrCreateAcceptHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateAcceptHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_accept: accept(fd, addr, addrlen) -> client_fd
getOrCreateBindHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateBindHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_bind: bind(fd, addr, addrlen) -> result
getOrCreateBindIPv4Helper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateBindIPv4Helper(llvm::Module *module, LLVMContext &llvmCtx)__sun_bind_ipv4(fd: i32, ip: i32, port: i32) -> i32
getOrCreateConnectHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateConnectHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_connect: connect(fd, addr, addrlen) -> result
getOrCreateConnectIPv4Helper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateConnectIPv4Helper(llvm::Module *module, LLVMContext &llvmCtx)__sun_connect_ipv4(fd: i32, ip: i32, port: i32) -> i32
getOrCreateFileCloseHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateFileCloseHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_file_close: close(fd) -> result
getOrCreateFileOpenHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateFileOpenHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_file_open: open(path, flags, mode) -> fd
getOrCreateFileReadHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateFileReadHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_file_read: read(fd, count) -> string Reads up to 'count' bytes from fd, returns a malloc'd null-terminated
buffer the caller owns.
getOrCreateFileWriteHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateFileWriteHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_file_write: write(fd, str) -> bytes_written
Writes a null-terminated string to the given fd.
getOrCreateFstatHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateFstatHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_fstat: fstat(fd, stat_buf) -> result.
The buffer layout is the target libc's struct stat; the Sun-side caller owns that interpretation.
getOrCreateFsyncHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateFsyncHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_fsync: fsync(fd) -> result
getOrCreateFtruncateHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateFtruncateHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_ftruncate: ftruncate(fd, length) -> result
getOrCreateGetSockNameIPv4Helper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateGetSockNameIPv4Helper(llvm::Module *module, LLVMContext &llvmCtx)__sun_getsockname_ipv4(fd, out_ip, out_port) -> i32 — report the socket's own bound address through the out slots.
getOrCreateGetSockOptHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateGetSockOptHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_getsockopt: getsockopt(fd, level, optname, optval, optlen) -> result
getOrCreateListenHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateListenHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_listen: listen(fd, backlog) -> result
getOrCreateLseekHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateLseekHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_lseek: lseek(fd, offset, whence) -> new_offset
getOrCreateMkdirHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateMkdirHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_mkdir: mkdir(path, mode) -> result
getOrCreatePrint64Helper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreatePrint64Helper(llvm::Module *module, LLVMContext &llvmCtx, bool isSigned)Get or create the __sun_print_i64 or __sun_print_u64 helper function.
Same digit-extraction shape as the i32 helper, widened to 64 bits. Digits are always extracted unsigned; the signed variant first takes the absolute value and later writes the minus sign, the unsigned variant prints the whole 64-bit value as is. Buffer is 24 bytes: the longest output is "18446744073709551615" or "-9223372036854775808" (20 chars each).
getOrCreatePrintCharHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreatePrintCharHelper(llvm::Module *module, LLVMContext &llvmCtx)void __sun_print_char(i32 scalar) — write one char to stdout as UTF-8.
Branch-free: all four bytes are computed with selects and stored into a 4-byte buffer, then only the first len of them are written. A scalar value that is somehow out of range (only reachable through an unchecked _convert) is written as U+FFFD rather than as invalid UTF-8.
getOrCreatePrintI32Helper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreatePrintI32Helper(llvm::Module *module, LLVMContext &llvmCtx)Get or create the __sun_print_i32 helper function.
getOrCreatePrintNewlineHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreatePrintNewlineHelper(llvm::Module *module, LLVMContext &llvmCtx)Get or create the __sun_print_newline helper function.
getOrCreatePrintStringHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreatePrintStringHelper(llvm::Module *module, LLVMContext &llvmCtx)Get or create the __sun_print_string helper function Takes an i8* (null-terminated string) and prints it.
getOrCreateReadHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateReadHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_read: read(fd, buf, len) -> bytes_read
getOrCreateRecvFromIPv4Helper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateRecvFromIPv4Helper(llvm::Module *module, LLVMContext &llvmCtx)__sun_recvfrom_ipv4(fd, buf, len, flags, out_ip, out_port) -> i64 — receive with a scratch sockaddr and report the sender through the out slots.
getOrCreateRecvHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateRecvHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_recv: recv(fd, buf, len, flags) -> bytes_received
getOrCreateRenameHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateRenameHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_rename: rename(old_path, new_path) -> result
getOrCreateRmdirHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateRmdirHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_rmdir: rmdir(path) -> result
getOrCreateSendHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateSendHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_send: send(fd, buf, len, flags) -> bytes_sent
getOrCreateSendToIPv4Helper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateSendToIPv4Helper(llvm::Module *module, LLVMContext &llvmCtx)__sun_sendto_ipv4(fd, buf, len, flags, ip, port) -> i64 — build the destination sockaddr and forward to sendto.
getOrCreateSetSockOptHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateSetSockOptHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_setsockopt: setsockopt(fd, level, optname, optval, optlen) -> result
getOrCreateShutdownHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateShutdownHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_shutdown: shutdown(fd, how) -> result
getOrCreateSockaddrCallHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateSockaddrCallHelper(llvm::Module *module, LLVMContext &llvmCtx, const char *wrapperName, llvm::FunctionCallee callee)Shared body for __sun_bind_ipv4 / __sun_connect_ipv4: build the sockaddr and forward to the given libc function.
getOrCreateSocketHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateSocketHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_socket: socket(domain, type, protocol) -> fd
getOrCreateUnlinkHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateUnlinkHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_unlink: unlink(path) -> result
getOrCreateWriteHelper
public · function · static · Source (opens in a new tab)
static Function * sun::codegen::intrinsics::getOrCreateWriteHelper(llvm::Module *module, LLVMContext &llvmCtx)__sun_write: write(fd, buf, len) -> bytes_written
getsockname
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::getsockname(llvm::Module *m)int getsockname(int fd, struct sockaddr *addr, socklen_t *len)
getsockopt
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::getsockopt(llvm::Module *m)int getsockopt(int fd, int level, int optname, void *val, socklen_t *len)
i32
public · function · Source (opens in a new tab)
llvm::Type * sun::codegen::intrinsics::i32(llvm::Module *m)Returns the LLVM integer type used for C integer arguments.
i64
public · function · Source (opens in a new tab)
llvm::Type * sun::codegen::intrinsics::i64(llvm::Module *m)Returns the LLVM integer type used for wide runtime values.
isDarwinTarget
public · function · static · Source (opens in a new tab)
static bool sun::codegen::intrinsics::isDarwinTarget(const llvm::Module *module)Whether this module compiles for an OS that uses ulock instead of futex.
isGenericIntrinsic
public · function · Source (opens in a new tab)
bool sun::codegen::intrinsics::isGenericIntrinsic(Intrinsic i)Check if a name is a generic intrinsic (requires type argument).
Related: Intrinsic
isIntrinsic
public · function · Source (opens in a new tab)
bool sun::codegen::intrinsics::isIntrinsic(const std::string &name)Check if a name is any intrinsic.
listen
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::listen(llvm::Module *m)int listen(int fd, int backlog)
lseek
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::lseek(llvm::Module *m)off_t lseek(int fd, off_t offset, int whence)
malloc
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::malloc(llvm::Module *m)void *malloc(size_t size)
mkdir
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::mkdir(llvm::Module *m)int mkdir(const char *path, mode_t mode)
open
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::open(llvm::Module *m)int open(const char *path, int flags, ...) — mode rides as a vararg
pthreadAttrDestroy
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::pthreadAttrDestroy(llvm::Module *m)int pthread_attr_destroy(pthread_attr_t *attr)
pthreadAttrInit
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::pthreadAttrInit(llvm::Module *m)int pthread_attr_init(pthread_attr_t *attr)
pthreadAttrSetstacksize
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::pthreadAttrSetstacksize(llvm::Module *m)int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)
pthreadCreate
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::pthreadCreate(llvm::Module *m)int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start)(void *), void *arg)
pthreadJoin
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::pthreadJoin(llvm::Module *m)int pthread_join(pthread_t thread, void **retval) — pthread_t is unsigned long on both x86-64 and aarch64 glibc
ptr
public · function · Source (opens in a new tab)
llvm::Type * sun::codegen::intrinsics::ptr(llvm::Module *m)Returns the LLVM pointer type used by runtime calls.
read
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::read(llvm::Module *m)ssize_t read(int fd, void *buf, size_t count)
recv
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::recv(llvm::Module *m)ssize_t recv(int fd, void *buf, size_t len, int flags)
recvfrom
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::recvfrom(llvm::Module *m)ssize_t recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *addrlen)
rename
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::rename(llvm::Module *m)int rename(const char *oldpath, const char *newpath)
requiresUnsafeBlock
requiresUnsafeBlock(const std::string &name)
public · function · Source (opens in a new tab)
bool sun::codegen::intrinsics::requiresUnsafeBlock(const std::string &name)Reports whether the named intrinsic may only be called in unsafe code.
requiresUnsafeBlock(Intrinsic i)
public · function · Source (opens in a new tab)
bool sun::codegen::intrinsics::requiresUnsafeBlock(Intrinsic i)Does this intrinsic have to be written inside an unsafe { } block?
The line is whether it reads or writes memory nothing has checked: through a raw pointer, or across the boundary into libc and the kernel. Intrinsics that only compute — a size, a type check, an address, a numeric conversion — are safe, and so are the print intrinsics, which the standard library treats as ordinary output. Semantic analysis is the one place this is applied, for generic and non-generic intrinsics alike.
Related: Intrinsic
rmdir
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::rmdir(llvm::Module *m)int rmdir(const char *path)
send
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::send(llvm::Module *m)ssize_t send(int fd, const void *buf, size_t len, int flags)
sendto
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::sendto(llvm::Module *m)ssize_t sendto(int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t addrlen)
setsockopt
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::setsockopt(llvm::Module *m)int setsockopt(int fd, int level, int optname, const void *val, socklen_t len)
shutdown
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::shutdown(llvm::Module *m)int shutdown(int fd, int how)
socket
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::socket(llvm::Module *m)int socket(int domain, int type, int protocol)
syscall
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::syscall(llvm::Module *m)long syscall(long number, ...) — the escape hatch for futex, which has no libc wrapper.
The syscall number is per-target data (see thread_utils).
ulockWait
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::ulockWait(llvm::Module *m)int __ulock_wait(uint32_t operation, void *addr, uint64_t value, uint32_t timeout_us)
ulockWake
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::ulockWake(llvm::Module *m)int __ulock_wake(uint32_t operation, void *addr, uint64_t wake_value)
unlink
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::unlink(llvm::Module *m)int unlink(const char *path)
write
public · function · Source (opens in a new tab)
llvm::FunctionCallee sun::codegen::intrinsics::write(llvm::Module *m)ssize_t write(int fd, const void *buf, size_t count)
Variables
FUTEX_WAIT
public · variable · static · Source (opens in a new tab)
int64_t sun::codegen::intrinsics::FUTEX_WAIT = 0No documentation comment.
FUTEX_WAKE
public · variable · static · Source (opens in a new tab)
int64_t sun::codegen::intrinsics::FUTEX_WAKE = 1No documentation comment.
UL_COMPARE_AND_WAIT
public · variable · static · Source (opens in a new tab)
uint64_t sun::codegen::intrinsics::UL_COMPARE_AND_WAIT = 1No documentation comment.
Enums
Intrinsic
public · enum · Source (opens in a new tab)
enum class sun::codegen::intrinsics::IntrinsicIntrinsic function identifiers Generic intrinsics take a type argument: _sizeof<T>(), _load<T>(ptr, idx) Non-generic intrinsics are called like regular functions: _malloc(size).
Related: Intrinsic
None
None
No documentation comment.
Sizeof
Sizeof
No documentation comment.
Init
Init
No documentation comment.
Load
Load
No documentation comment.
Store
Store
No documentation comment.
PtrAsRaw
PtrAsRaw
No documentation comment.
Is
Is
No documentation comment.
AddressOf
AddressOf
No documentation comment.
ToRef
ToRef
No documentation comment.
Deinit
Deinit
No documentation comment.
EnumFromInt
EnumFromInt
No documentation comment.
Convert
Convert
No documentation comment.
Bitcast
Bitcast
No documentation comment.
Spawn
Spawn
No documentation comment.
ThreadJoin
ThreadJoin
No documentation comment.
ThreadJoinDrop
ThreadJoinDrop
No documentation comment.
LoadI64
LoadI64
No documentation comment.
StoreI64
StoreI64
No documentation comment.
Malloc
Malloc
No documentation comment.
Free
Free
No documentation comment.
Memcpy
Memcpy
No documentation comment.
Memmove
Memmove
No documentation comment.
Memset
Memset
No documentation comment.
PtrOffset
PtrOffset
No documentation comment.
PrintI32
PrintI32
No documentation comment.
PrintI64
PrintI64
No documentation comment.
PrintU64
PrintU64
No documentation comment.
PrintF64
PrintF64
No documentation comment.
PrintNewline
PrintNewline
No documentation comment.
PrintBytes
PrintBytes
No documentation comment.
PrintChar
PrintChar
No documentation comment.
PrintlnStr
PrintlnStr
No documentation comment.
AtomicCmpxchgI32
AtomicCmpxchgI32
No documentation comment.
AtomicStoreI32
AtomicStoreI32
No documentation comment.
AtomicLoadI32
AtomicLoadI32
No documentation comment.
AtomicFetchAddI32
AtomicFetchAddI32
No documentation comment.
AtomicFetchSubI32
AtomicFetchSubI32
No documentation comment.
AtomicCmpxchgI64
AtomicCmpxchgI64
No documentation comment.
AtomicStoreI64
AtomicStoreI64
No documentation comment.
AtomicLoadI64
AtomicLoadI64
No documentation comment.
AtomicFetchAddI64
AtomicFetchAddI64
No documentation comment.
AtomicFetchSubI64
AtomicFetchSubI64
No documentation comment.
AtomicCmpxchgU64
AtomicCmpxchgU64
No documentation comment.
AtomicStoreU64
AtomicStoreU64
No documentation comment.
AtomicLoadU64
AtomicLoadU64
No documentation comment.
AtomicFetchAddU64
AtomicFetchAddU64
No documentation comment.
AtomicFetchSubU64
AtomicFetchSubU64
No documentation comment.
AtomicFenceAcquire
AtomicFenceAcquire
No documentation comment.
AtomicFenceRelease
AtomicFenceRelease
No documentation comment.
FutexWait
FutexWait
No documentation comment.
FutexWake
FutexWake
No documentation comment.
MulHiU64
MulHiU64
No documentation comment.
CtlzU64
CtlzU64
No documentation comment.
CttzU64
CttzU64
No documentation comment.
BswapU16
BswapU16
No documentation comment.
BswapU32
BswapU32
No documentation comment.
BswapU64
BswapU64
No documentation comment.
TargetIs
TargetIs
No documentation comment.
FileOpen
FileOpen
No documentation comment.
FileClose
FileClose
No documentation comment.
FileWrite
FileWrite
No documentation comment.
FileRead
FileRead
No documentation comment.
Lseek
Lseek
No documentation comment.
Fstat
Fstat
No documentation comment.
Fsync
Fsync
No documentation comment.
Ftruncate
Ftruncate
No documentation comment.
Unlink
Unlink
No documentation comment.
Rename
Rename
No documentation comment.
Mkdir
Mkdir
No documentation comment.
Rmdir
Rmdir
No documentation comment.
Write
Write
No documentation comment.
Read
Read
No documentation comment.
Socket
Socket
No documentation comment.
Bind
Bind
No documentation comment.
Listen
Listen
No documentation comment.
Accept
Accept
No documentation comment.
Connect
Connect
No documentation comment.
Send
Send
No documentation comment.
Recv
Recv
No documentation comment.
Shutdown
Shutdown
No documentation comment.
SetSockOpt
SetSockOpt
No documentation comment.
GetSockOpt
GetSockOpt
No documentation comment.