The checked-arithmetic helpers every generated module carries no longer test __TINYC__.
704 lines
29 KiB
C
704 lines
29 KiB
C
/* Generated by zi2c from compiler_backend_process.zi. */
|
|
#ifndef ZIRAN_COMPILER_BACKEND_PROCESS_H
|
|
#define ZIRAN_COMPILER_BACKEND_PROCESS_H
|
|
|
|
#include <stdbool.h>
|
|
#include "zir_string_types.h"
|
|
#include "zir_bounds.h"
|
|
#include "zir_slice.h"
|
|
#include "file.h"
|
|
#include "vec.h"
|
|
#include "file_tree_linux.h"
|
|
#include "environment.h"
|
|
#include "text_tools.h"
|
|
#include "sort.h"
|
|
#include "timer_linux.h"
|
|
#include "c_string.h"
|
|
#include "compiler_backend_cache.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#define WorkerMemory 512
|
|
#define WorkerMaximum 16
|
|
#define ArgumentMaximum 1024
|
|
#define TextMaximum 4096
|
|
#define LockReadWrite 2
|
|
#define LockCreate 64
|
|
#define LockCloseOnExec 131072
|
|
#define LockNoFollow 262144
|
|
#define AffinityBytes 128
|
|
#define ToolLogMaximum 4095
|
|
#ifndef ZIRAN_CONCRETE_FORWARD___type_838711075b90279a
|
|
#define ZIRAN_CONCRETE_FORWARD___type_838711075b90279a
|
|
typedef struct __type_838711075b90279a __type_838711075b90279a;
|
|
#endif
|
|
typedef struct Job Job;
|
|
typedef struct SlotOutput SlotOutput;
|
|
typedef struct PendingOutput PendingOutput;
|
|
typedef struct zir_8a167d86ad221008_Results__string__bool zir_8a167d86ad221008_Results__string__bool;
|
|
typedef struct Results__pu8__bool Results__pu8__bool;
|
|
typedef struct DiagnosticSpan DiagnosticSpan;
|
|
typedef struct PollRecord PollRecord;
|
|
typedef struct OwnedText OwnedText;
|
|
typedef struct CapturePointer CapturePointer;
|
|
#ifndef ZIRAN_CONCRETE_FORWARD___type_c53c2d7c4913dc02
|
|
#define ZIRAN_CONCRETE_FORWARD___type_c53c2d7c4913dc02
|
|
typedef struct __type_c53c2d7c4913dc02 __type_c53c2d7c4913dc02;
|
|
#endif
|
|
#ifndef ZIRAN_CONCRETE_FORWARD___type_21092c8252d3dcaa
|
|
#define ZIRAN_CONCRETE_FORWARD___type_21092c8252d3dcaa
|
|
typedef struct __type_21092c8252d3dcaa __type_21092c8252d3dcaa;
|
|
#endif
|
|
#ifndef ZIRAN_CONCRETE_FORWARD___type_6f55d821d15c8cbf
|
|
#define ZIRAN_CONCRETE_FORWARD___type_6f55d821d15c8cbf
|
|
typedef struct __type_6f55d821d15c8cbf __type_6f55d821d15c8cbf;
|
|
#endif
|
|
#ifndef ZIRAN_CONCRETE___type_838711075b90279a
|
|
#define ZIRAN_CONCRETE___type_838711075b90279a
|
|
|
|
struct __type_838711075b90279a {
|
|
uint8_t* data;
|
|
int64_t count;
|
|
int64_t capacity;
|
|
};
|
|
#endif
|
|
|
|
struct Job {
|
|
int32_t process;
|
|
int32_t descriptor;
|
|
__type_838711075b90279a output;
|
|
bool finished;
|
|
bool ok;
|
|
};
|
|
|
|
struct SlotOutput {
|
|
int64_t file;
|
|
bool running;
|
|
};
|
|
|
|
struct PendingOutput {
|
|
int64_t file;
|
|
__type_838711075b90279a output;
|
|
};
|
|
|
|
struct zir_8a167d86ad221008_Results__string__bool {
|
|
String value_0;
|
|
bool value_1;
|
|
};
|
|
|
|
struct Results__pu8__bool {
|
|
uint8_t* value_0;
|
|
bool value_1;
|
|
};
|
|
|
|
struct DiagnosticSpan {
|
|
uint8_t* context;
|
|
int32_t file;
|
|
int32_t line;
|
|
int32_t column;
|
|
int32_t end_line;
|
|
int32_t end_column;
|
|
};
|
|
|
|
struct PollRecord {
|
|
int32_t descriptor;
|
|
int16_t events;
|
|
int16_t revents;
|
|
};
|
|
|
|
struct OwnedText {
|
|
uint8_t* data;
|
|
size_t length;
|
|
};
|
|
|
|
struct CapturePointer {
|
|
uint8_t* value;
|
|
};
|
|
#ifndef ZIRAN_CONCRETE___type_c53c2d7c4913dc02
|
|
#define ZIRAN_CONCRETE___type_c53c2d7c4913dc02
|
|
|
|
struct __type_c53c2d7c4913dc02 {
|
|
String* data;
|
|
int64_t count;
|
|
int64_t capacity;
|
|
};
|
|
#endif
|
|
#ifndef ZIRAN_CONCRETE___type_21092c8252d3dcaa
|
|
#define ZIRAN_CONCRETE___type_21092c8252d3dcaa
|
|
|
|
struct __type_21092c8252d3dcaa {
|
|
uint8_t** data;
|
|
int64_t count;
|
|
int64_t capacity;
|
|
};
|
|
#endif
|
|
#ifndef ZIRAN_CONCRETE___type_6f55d821d15c8cbf
|
|
#define ZIRAN_CONCRETE___type_6f55d821d15c8cbf
|
|
|
|
struct __type_6f55d821d15c8cbf {
|
|
PendingOutput* data;
|
|
int64_t count;
|
|
int64_t capacity;
|
|
};
|
|
#endif
|
|
extern __type_c53c2d7c4913dc02 zir_g_b176900cac1241ec;
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_SysconfByName_6b580cc2
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_SysconfByName_6b580cc2
|
|
#ifdef __APPLE__
|
|
int64_t zir_foreign_zir_f_1cd1ecb166af98b1_SysconfByName(int32_t name) __asm__("_sysconf");
|
|
#else
|
|
int64_t zir_foreign_zir_f_1cd1ecb166af98b1_SysconfByName(int32_t name) __asm__("sysconf");
|
|
#endif
|
|
static int64_t
|
|
zir_f_1cd1ecb166af98b1_SysconfByName(int32_t name)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_SysconfByName(name);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_SchedGetAffinity_409edfe1
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_SchedGetAffinity_409edfe1
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_SchedGetAffinity(int32_t process, size_t size, uint8_t* mask) __asm__("_sched_getaffinity");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_SchedGetAffinity(int32_t process, size_t size, uint8_t* mask) __asm__("sched_getaffinity");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_SchedGetAffinity(int32_t process, size_t size, uint8_t* mask)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_SchedGetAffinity(process, size, mask);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_OpenReadFile_a94da530
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_OpenReadFile_a94da530
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_OpenReadFile(uint8_t* path) __asm__("_open");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_OpenReadFile(uint8_t* path) __asm__("open");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_OpenReadFile(uint8_t* path)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_OpenReadFile(path);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_CloseDescriptor_d6ec0c1e
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_CloseDescriptor_d6ec0c1e
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_CloseDescriptor(int32_t descriptor) __asm__("_close");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_CloseDescriptor(int32_t descriptor) __asm__("close");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_CloseDescriptor(int32_t descriptor)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_CloseDescriptor(descriptor);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ReadDescriptor_7d19ba22
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ReadDescriptor_7d19ba22
|
|
#ifdef __APPLE__
|
|
int64_t zir_foreign_zir_f_1cd1ecb166af98b1_ReadDescriptor(int32_t descriptor, uint8_t* output, size_t count) __asm__("_read");
|
|
#else
|
|
int64_t zir_foreign_zir_f_1cd1ecb166af98b1_ReadDescriptor(int32_t descriptor, uint8_t* output, size_t count) __asm__("read");
|
|
#endif
|
|
static int64_t
|
|
zir_f_1cd1ecb166af98b1_ReadDescriptor(int32_t descriptor, uint8_t* output, size_t count)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_ReadDescriptor(descriptor, output, count);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_MakeDirectory_a57b07a1
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_MakeDirectory_a57b07a1
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_MakeDirectory(uint8_t* path, int32_t mode) __asm__("_mkdir");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_MakeDirectory(uint8_t* path, int32_t mode) __asm__("mkdir");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_MakeDirectory(uint8_t* path, int32_t mode)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_MakeDirectory(path, mode);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_OpenLock_a91c4ec7
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_OpenLock_a91c4ec7
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_OpenLock(uint8_t* path, int32_t flags, uint32_t mode) __asm__("_open");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_OpenLock(uint8_t* path, int32_t flags, uint32_t mode) __asm__("open");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_OpenLock(uint8_t* path, int32_t flags, uint32_t mode)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_OpenLock(path, flags, mode);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_FlockLock_d74aed45
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_FlockLock_d74aed45
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_FlockLock(int32_t descriptor, int32_t operation) __asm__("_flock");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_FlockLock(int32_t descriptor, int32_t operation) __asm__("flock");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_FlockLock(int32_t descriptor, int32_t operation)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_FlockLock(descriptor, operation);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_PipeRaw_bab5570c
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_PipeRaw_bab5570c
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_PipeRaw(int32_t* fds) __asm__("_pipe");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_PipeRaw(int32_t* fds) __asm__("pipe");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_PipeRaw(int32_t* fds)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_PipeRaw(fds);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_FcntlCloexec_deab14bf
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_FcntlCloexec_deab14bf
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_FcntlCloexec(int32_t descriptor, int32_t command, int32_t value) __asm__("_fcntl");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_FcntlCloexec(int32_t descriptor, int32_t command, int32_t value) __asm__("fcntl");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_FcntlCloexec(int32_t descriptor, int32_t command, int32_t value)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_FcntlCloexec(descriptor, command, value);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ForkRaw_b09b1e28
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ForkRaw_b09b1e28
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_ForkRaw(void) __asm__("_fork");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_ForkRaw(void) __asm__("fork");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_ForkRaw(void)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_ForkRaw();
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_DupRaw_8536fc2b
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_DupRaw_8536fc2b
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_DupRaw(int32_t source, int32_t destination) __asm__("_dup2");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_DupRaw(int32_t source, int32_t destination) __asm__("dup2");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_DupRaw(int32_t source, int32_t destination)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_DupRaw(source, destination);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ExitChild_da83199a
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ExitChild_da83199a
|
|
#ifdef __APPLE__
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_ExitChild(int32_t code) __asm__("__exit");
|
|
#else
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_ExitChild(int32_t code) __asm__("_exit");
|
|
#endif
|
|
static void
|
|
zir_f_1cd1ecb166af98b1_ExitChild(int32_t code)
|
|
{
|
|
zir_foreign_zir_f_1cd1ecb166af98b1_ExitChild(code);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_WaitRaw_0257cbb4
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_WaitRaw_0257cbb4
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_WaitRaw(int32_t process, int32_t* status, int32_t options) __asm__("_waitpid");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_WaitRaw(int32_t process, int32_t* status, int32_t options) __asm__("waitpid");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_WaitRaw(int32_t process, int32_t* status, int32_t options)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_WaitRaw(process, status, options);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ErrnoLocation_40ae2072
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ErrnoLocation_40ae2072
|
|
#ifdef __APPLE__
|
|
int32_t* zir_foreign_zir_f_1cd1ecb166af98b1_ErrnoLocation(void) __asm__("___errno_location");
|
|
#else
|
|
int32_t* zir_foreign_zir_f_1cd1ecb166af98b1_ErrnoLocation(void) __asm__("__errno_location");
|
|
#endif
|
|
static int32_t*
|
|
zir_f_1cd1ecb166af98b1_ErrnoLocation(void)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_ErrnoLocation();
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_AllocateRaw_0c09ffff
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_AllocateRaw_0c09ffff
|
|
#ifdef __APPLE__
|
|
void* zir_foreign_zir_f_1cd1ecb166af98b1_AllocateRaw(size_t count, size_t size) __asm__("_calloc");
|
|
#else
|
|
void* zir_foreign_zir_f_1cd1ecb166af98b1_AllocateRaw(size_t count, size_t size) __asm__("calloc");
|
|
#endif
|
|
static void*
|
|
zir_f_1cd1ecb166af98b1_AllocateRaw(size_t count, size_t size)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_AllocateRaw(count, size);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_FreeRaw_c75930da
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_FreeRaw_c75930da
|
|
#ifdef __APPLE__
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_FreeRaw(void* memory) __asm__("_free");
|
|
#else
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_FreeRaw(void* memory) __asm__("free");
|
|
#endif
|
|
static void
|
|
zir_f_1cd1ecb166af98b1_FreeRaw(void* memory)
|
|
{
|
|
zir_foreign_zir_f_1cd1ecb166af98b1_FreeRaw(memory);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_FlushStreams_e871adfd
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_FlushStreams_e871adfd
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_FlushStreams(void* file) __asm__("_fflush");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_FlushStreams(void* file) __asm__("fflush");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_FlushStreams(void* file)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_FlushStreams(file);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_DiagnosticJsonEnabled_e175c060
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_DiagnosticJsonEnabled_e175c060
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_DiagnosticJsonEnabled(void) __asm__("_DiagnosticJsonEnabled");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_DiagnosticJsonEnabled(void) __asm__("DiagnosticJsonEnabled");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_DiagnosticJsonEnabled(void)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_DiagnosticJsonEnabled();
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_GeneratedOutputPath_ee884a36
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_GeneratedOutputPath_ee884a36
|
|
#ifdef __APPLE__
|
|
uint8_t* zir_foreign_zir_f_1cd1ecb166af98b1_GeneratedOutputPath(int64_t index) __asm__("_GeneratedOutputPath");
|
|
#else
|
|
uint8_t* zir_foreign_zir_f_1cd1ecb166af98b1_GeneratedOutputPath(int64_t index) __asm__("GeneratedOutputPath");
|
|
#endif
|
|
static uint8_t*
|
|
zir_f_1cd1ecb166af98b1_GeneratedOutputPath(int64_t index)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_GeneratedOutputPath(index);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ToolchainIncludeDirectory_96d5cefc
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ToolchainIncludeDirectory_96d5cefc
|
|
#ifdef __APPLE__
|
|
uint8_t* zir_foreign_zir_f_1cd1ecb166af98b1_ToolchainIncludeDirectory(void) __asm__("_ToolchainIncludeDirectory");
|
|
#else
|
|
uint8_t* zir_foreign_zir_f_1cd1ecb166af98b1_ToolchainIncludeDirectory(void) __asm__("ToolchainIncludeDirectory");
|
|
#endif
|
|
static uint8_t*
|
|
zir_f_1cd1ecb166af98b1_ToolchainIncludeDirectory(void)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_ToolchainIncludeDirectory();
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ProfileStart_b892bac9
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ProfileStart_b892bac9
|
|
#ifdef __APPLE__
|
|
uint64_t zir_foreign_zir_f_1cd1ecb166af98b1_ProfileStart(void) __asm__("_ProfileStart");
|
|
#else
|
|
uint64_t zir_foreign_zir_f_1cd1ecb166af98b1_ProfileStart(void) __asm__("ProfileStart");
|
|
#endif
|
|
static uint64_t
|
|
zir_f_1cd1ecb166af98b1_ProfileStart(void)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_ProfileStart();
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ProfileEndForeign_ae202c81
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ProfileEndForeign_ae202c81
|
|
#ifdef __APPLE__
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_ProfileEndForeign(uint8_t* phase, uint64_t started) __asm__("_ProfileEnd");
|
|
#else
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_ProfileEndForeign(uint8_t* phase, uint64_t started) __asm__("ProfileEnd");
|
|
#endif
|
|
static void
|
|
zir_f_1cd1ecb166af98b1_ProfileEndForeign(uint8_t* phase, uint64_t started)
|
|
{
|
|
zir_foreign_zir_f_1cd1ecb166af98b1_ProfileEndForeign(phase, started);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ProfileCountForeign_c5a6224b
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ProfileCountForeign_c5a6224b
|
|
#ifdef __APPLE__
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_ProfileCountForeign(uint8_t* counter) __asm__("_ProfileCount");
|
|
#else
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_ProfileCountForeign(uint8_t* counter) __asm__("ProfileCount");
|
|
#endif
|
|
static void
|
|
zir_f_1cd1ecb166af98b1_ProfileCountForeign(uint8_t* counter)
|
|
{
|
|
zir_foreign_zir_f_1cd1ecb166af98b1_ProfileCountForeign(counter);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_PollRaw_7bcba4aa
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_PollRaw_7bcba4aa
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_PollRaw(PollRecord* fds, uint64_t count, int32_t timeout) __asm__("_poll");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_PollRaw(PollRecord* fds, uint64_t count, int32_t timeout) __asm__("poll");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_PollRaw(PollRecord* fds, uint64_t count, int32_t timeout)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_PollRaw(fds, count, timeout);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_WriteDescriptor_7e695fb1
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_WriteDescriptor_7e695fb1
|
|
#ifdef __APPLE__
|
|
int64_t zir_foreign_zir_f_1cd1ecb166af98b1_WriteDescriptor(int32_t descriptor, uint8_t* output, size_t count) __asm__("_write");
|
|
#else
|
|
int64_t zir_foreign_zir_f_1cd1ecb166af98b1_WriteDescriptor(int32_t descriptor, uint8_t* output, size_t count) __asm__("write");
|
|
#endif
|
|
static int64_t
|
|
zir_f_1cd1ecb166af98b1_WriteDescriptor(int32_t descriptor, uint8_t* output, size_t count)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_WriteDescriptor(descriptor, output, count);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ExecRaw_8f11e3e3
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_ExecRaw_8f11e3e3
|
|
#ifdef __APPLE__
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_ExecRaw(uint8_t* path, CapturePointer* arguments) __asm__("_execvp");
|
|
#else
|
|
int32_t zir_foreign_zir_f_1cd1ecb166af98b1_ExecRaw(uint8_t* path, CapturePointer* arguments) __asm__("execvp");
|
|
#endif
|
|
static int32_t
|
|
zir_f_1cd1ecb166af98b1_ExecRaw(uint8_t* path, CapturePointer* arguments)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_ExecRaw(path, arguments);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_Strerror_202dd881
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_Strerror_202dd881
|
|
#ifdef __APPLE__
|
|
uint8_t* zir_foreign_zir_f_1cd1ecb166af98b1_Strerror(int32_t number) __asm__("_strerror");
|
|
#else
|
|
uint8_t* zir_foreign_zir_f_1cd1ecb166af98b1_Strerror(int32_t number) __asm__("strerror");
|
|
#endif
|
|
static uint8_t*
|
|
zir_f_1cd1ecb166af98b1_Strerror(int32_t number)
|
|
{
|
|
return zir_foreign_zir_f_1cd1ecb166af98b1_Strerror(number);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_WarningForeign_c8d79e7f
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_WarningForeign_c8d79e7f
|
|
#ifdef __APPLE__
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_WarningForeign(DiagnosticSpan span, uint8_t* code, uint8_t* format, uint8_t* value) __asm__("_Warning");
|
|
#else
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_WarningForeign(DiagnosticSpan span, uint8_t* code, uint8_t* format, uint8_t* value) __asm__("Warning");
|
|
#endif
|
|
static void
|
|
zir_f_1cd1ecb166af98b1_WarningForeign(DiagnosticSpan span, uint8_t* code, uint8_t* format, uint8_t* value)
|
|
{
|
|
zir_foreign_zir_f_1cd1ecb166af98b1_WarningForeign(span, code, format, value);
|
|
}
|
|
#endif
|
|
#ifndef ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_DiagnosticTargetForeign_848c5de5
|
|
#define ZIR_FOREIGN_zir_f_1cd1ecb166af98b1_DiagnosticTargetForeign_848c5de5
|
|
#ifdef __APPLE__
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_DiagnosticTargetForeign(DiagnosticSpan span, uint8_t* code, uint8_t* target, uint8_t* capability, uint8_t* format, uint8_t* first, uint8_t* second) __asm__("_DiagnosticTarget");
|
|
#else
|
|
void zir_foreign_zir_f_1cd1ecb166af98b1_DiagnosticTargetForeign(DiagnosticSpan span, uint8_t* code, uint8_t* target, uint8_t* capability, uint8_t* format, uint8_t* first, uint8_t* second) __asm__("DiagnosticTarget");
|
|
#endif
|
|
static void
|
|
zir_f_1cd1ecb166af98b1_DiagnosticTargetForeign(DiagnosticSpan span, uint8_t* code, uint8_t* target, uint8_t* capability, uint8_t* format, uint8_t* first, uint8_t* second)
|
|
{
|
|
zir_foreign_zir_f_1cd1ecb166af98b1_DiagnosticTargetForeign(span, code, target, capability, format, first, second);
|
|
}
|
|
#endif
|
|
int32_t compiler_backend_process_WorkerLimit(void);
|
|
int32_t compiler_backend_process_BuildLock(String directory);
|
|
void compiler_backend_process_ReleasePointerVector(__type_21092c8252d3dcaa* values);
|
|
Job compiler_backend_process_StartJob(Slice commands, bool capture, bool report_error);
|
|
bool compiler_backend_process_WaitJob(Job* job);
|
|
void compiler_backend_process_FreeJob(Job* job);
|
|
bool compiler_backend_process_TextStartsWith(String value, String prefix);
|
|
bool compiler_backend_process_TextEndsWith(String value, String suffix);
|
|
bool compiler_backend_process_TextContains(String value, String piece);
|
|
String compiler_backend_process_PathName(String value);
|
|
zir_8a167d86ad221008_Results__string__bool compiler_backend_process_PathJoin(String left, String right);
|
|
zir_8a167d86ad221008_Results__string__bool compiler_backend_process_PathSuffix(String value, String suffix);
|
|
void compiler_backend_process_ReleaseOwnedText(String value);
|
|
uint8_t* compiler_backend_process_AllocateText(String value);
|
|
String compiler_backend_process_CText(uint8_t* value);
|
|
void compiler_backend_process_FreePointers(__type_21092c8252d3dcaa values);
|
|
bool compiler_backend_process_PrepareArguments(Slice arguments, __type_21092c8252d3dcaa* pointers);
|
|
bool compiler_backend_process_WordsInto(String value, __type_21092c8252d3dcaa* output);
|
|
bool compiler_backend_process_EnvironmentWords(String name, __type_21092c8252d3dcaa* output);
|
|
bool compiler_backend_process_AddCArgument(__type_21092c8252d3dcaa* output, String flag, String value);
|
|
bool compiler_backend_process_AddSource(__type_21092c8252d3dcaa* files, String path);
|
|
bool compiler_backend_process_CompileExecutable(String out, String name, bool threads, bool release);
|
|
bool compiler_backend_process_FinishCompile(String out, String name, bool forced_language, __type_21092c8252d3dcaa* base, __type_21092c8252d3dcaa* tail, __type_21092c8252d3dcaa* files, __type_21092c8252d3dcaa* objects, __type_838711075b90279a* log);
|
|
Results__pu8__bool compiler_backend_process_ObjectPath(String out, String relative);
|
|
void compiler_backend_process_SortPaths(__type_21092c8252d3dcaa* values);
|
|
bool compiler_backend_process_PathBefore(String left, String right);
|
|
void compiler_backend_process_ReapJob(Job* job);
|
|
void compiler_backend_process_StoreJob(Job* target, Job value);
|
|
void compiler_backend_process_PollSlots(Slice jobs, Slice slots, bool* failed);
|
|
bool compiler_backend_process_CompileAndLink(String out, String name, bool forced_language, __type_21092c8252d3dcaa* base, __type_21092c8252d3dcaa* tail, __type_21092c8252d3dcaa* files, __type_21092c8252d3dcaa* objects, __type_838711075b90279a* log);
|
|
__type_c53c2d7c4913dc02 compiler_backend_process_PointerTexts(__type_21092c8252d3dcaa* source);
|
|
__type_c53c2d7c4913dc02 compiler_backend_process_CloneTexts(__type_21092c8252d3dcaa* source);
|
|
void compiler_backend_process_FreeArguments(__type_c53c2d7c4913dc02* values);
|
|
bool compiler_backend_process_AddDependencyArguments(__type_c53c2d7c4913dc02* arguments, String dependency);
|
|
bool compiler_backend_process_AddObjectArguments(__type_c53c2d7c4913dc02* arguments, String source, String object);
|
|
bool compiler_backend_process_AddTextArgument(__type_c53c2d7c4913dc02* output, String flag, String value);
|
|
bool compiler_backend_process_AppendLog(__type_838711075b90279a* log, Slice output);
|
|
bool compiler_backend_process_LinkOwnedObjects(String out, String name, bool forced_language, __type_21092c8252d3dcaa* base, __type_21092c8252d3dcaa* tail, __type_21092c8252d3dcaa* files, __type_21092c8252d3dcaa* objects, __type_838711075b90279a* log, BuildCache* cache);
|
|
void compiler_backend_process_ReleaseBuildValues(__type_21092c8252d3dcaa* base, __type_21092c8252d3dcaa* tail, __type_21092c8252d3dcaa* files, __type_21092c8252d3dcaa* objects, __type_838711075b90279a* log);
|
|
bool compiler_backend_process_MoveLinkOutput(String directory, String out, String name);
|
|
void compiler_backend_process_ReportToolchain(String out, __type_838711075b90279a* log, bool ok);
|
|
void compiler_backend_process_Report(bool ok, String code, String message);
|
|
int64_t compiler_backend_process_AffinityCpus(void);
|
|
int64_t compiler_backend_process_AvailableMemory(void);
|
|
int64_t compiler_backend_process_NumberText(String value);
|
|
String compiler_backend_process_CTextN(uint8_t* value, int64_t length);
|
|
bool compiler_backend_process_CreateDirectories(String path);
|
|
int32_t compiler_backend_process_ErrnoValue(void);
|
|
void compiler_backend_process_SetCloexec(int32_t descriptor);
|
|
void compiler_backend_process_FinishStatus(Job* job, int32_t status);
|
|
bool compiler_backend_process_ReadJobOutput(Job* job);
|
|
void compiler_backend_process_ExecChild(uint8_t* path, CapturePointer* arguments, bool report_error);
|
|
void compiler_backend_process_ProfileCount(String counter);
|
|
void compiler_backend_process_ProfileEnd(String phase, uint64_t started);
|
|
uint8_t* compiler_backend_process_ProfileName(String name);
|
|
|
|
/* Small procedures other modules inline; compiler_backend_process.c defines them. */
|
|
#if !defined(__cplusplus) && !defined(ZIRAN_COMPILER_BACKEND_PROCESS_H_SOURCE) && !defined(ZIRAN_NO_HEADER_INLINE)
|
|
#include "zir_vec.h"
|
|
#include <stdbool.h>
|
|
#include "zir_string_types.h"
|
|
#include "zir_bounds.h"
|
|
#ifndef ZIRAN_HELPER_ZiShrS32
|
|
#define ZIRAN_HELPER_ZiShrS32
|
|
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__OPTIMIZE__)
|
|
#define ZiShrS32(a, s, w) __extension__ ({ int32_t __zi_a = (a); uint64_t __zi_s = (s); if(__zi_s >= (uint64_t)(w)) abort(); __zi_a < 0 ? ~(~__zi_a >> __zi_s) : __zi_a >> __zi_s; })
|
|
#else
|
|
static inline int32_t ZiShrS32(int32_t a, uint64_t s, int w) {
|
|
if(s >= (uint64_t)w) abort();
|
|
return a < 0 ? ~(~a >> s) : a >> s;
|
|
}
|
|
#endif
|
|
#endif
|
|
static inline void compiler_backend_process_SortPaths_ziran_inline(__type_21092c8252d3dcaa* values);
|
|
#define compiler_backend_process_SortPaths(...) compiler_backend_process_SortPaths_ziran_inline(__VA_ARGS__)
|
|
static inline bool compiler_backend_process_PathBefore_ziran_inline(String left, String right);
|
|
#define compiler_backend_process_PathBefore(...) compiler_backend_process_PathBefore_ziran_inline(__VA_ARGS__)
|
|
static inline int64_t compiler_backend_process_NumberText_ziran_inline(String value);
|
|
#define compiler_backend_process_NumberText(...) compiler_backend_process_NumberText_ziran_inline(__VA_ARGS__)
|
|
static inline void compiler_backend_process_FinishStatus_ziran_inline(Job* job, int32_t status);
|
|
#define compiler_backend_process_FinishStatus(...) compiler_backend_process_FinishStatus_ziran_inline(__VA_ARGS__)
|
|
|
|
static inline void
|
|
compiler_backend_process_SortPaths_ziran_inline(__type_21092c8252d3dcaa* values)
|
|
{
|
|
{
|
|
int64_t range_first_0 = 1LL;
|
|
int64_t range_last_0 = (int64_t)((uint64_t)(values->count) - UINT64_C(1));
|
|
int64_t at = range_first_0;
|
|
if (at <= range_last_0) for (;;) {
|
|
uint8_t* value = ZIRAN_VEC_INDEX((*(values)).data, (*(values)).count, at);
|
|
int64_t before = (int64_t)((uint64_t)at - UINT64_C(1));
|
|
while (true) {
|
|
bool value_0 = before >= 0LL;
|
|
if (value_0) {
|
|
String value_1 = compiler_backend_process_CText(value);
|
|
bool value_2 = compiler_backend_process_PathBefore(value_1, compiler_backend_process_CText(ZIRAN_VEC_INDEX((*(values)).data, (*(values)).count, before)));
|
|
value_0 = value_2;
|
|
}
|
|
if (!value_0) { break; }
|
|
uint8_t** value_3 = &(ZIRAN_VEC_INDEX(((*(values))).data, ((*(values))).count, ((int64_t)((uint64_t)before + UINT64_C(1)))));
|
|
(*value_3) = ZIRAN_VEC_INDEX((*(values)).data, (*(values)).count, before);
|
|
before = (int64_t)((uint64_t)before - UINT64_C(1));
|
|
}
|
|
uint8_t** value_4 = &(ZIRAN_VEC_INDEX(((*(values))).data, ((*(values))).count, ((int64_t)((uint64_t)before + UINT64_C(1)))));
|
|
(*value_4) = value;
|
|
if (at == range_last_0) {
|
|
break;
|
|
}
|
|
at = (int64_t)((uint64_t)at + UINT64_C(1));
|
|
}
|
|
}
|
|
}
|
|
|
|
static inline bool
|
|
compiler_backend_process_PathBefore_ziran_inline(String left, String right)
|
|
{
|
|
int64_t value_0 = 0;
|
|
if ((int64_t)(left).length < (int64_t)(right).length) {
|
|
value_0 = (int64_t)(left).length;
|
|
} else {
|
|
value_0 = (int64_t)(right).length;
|
|
}
|
|
int64_t count = value_0;
|
|
{
|
|
int64_t range_first_1 = 0LL;
|
|
int64_t range_last_1 = (int64_t)((uint64_t)count - UINT64_C(1));
|
|
int64_t at = range_first_1;
|
|
if (at <= range_last_1) for (;;) {
|
|
if ((uint8_t)ZIRAN_INDEX(left.data, left.length, at) != (uint8_t)ZIRAN_INDEX(right.data, right.length, at)) {
|
|
return (uint8_t)ZIRAN_INDEX(left.data, left.length, at) < (uint8_t)ZIRAN_INDEX(right.data, right.length, at);
|
|
}
|
|
if (at == range_last_1) {
|
|
break;
|
|
}
|
|
at = (int64_t)((uint64_t)at + UINT64_C(1));
|
|
}
|
|
}
|
|
return (int64_t)(left).length < (int64_t)(right).length;
|
|
}
|
|
|
|
static inline int64_t
|
|
compiler_backend_process_NumberText_ziran_inline(String value)
|
|
{
|
|
int64_t result = 0LL;
|
|
for (int64_t it_index = 0LL; it_index < (int64_t)(value).length; it_index++) {
|
|
uint8_t byte = (uint8_t)value.data[it_index];
|
|
result = (int64_t)(((uint64_t)result * UINT64_C(10)) + (uint64_t)(((uint8_t)((uint32_t)byte - 48u))));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
static inline void
|
|
compiler_backend_process_FinishStatus_ziran_inline(Job* job, int32_t status)
|
|
{
|
|
bool* value_0 = &(job->finished);
|
|
(*value_0) = true;
|
|
bool* value_1 = &(job->ok);
|
|
bool value_2 = ((int32_t)((uint32_t)status & 127u)) == 0 && ((int32_t)((uint32_t)((ZiShrS32(status, (uint64_t)(8), 32))) & 255u)) == 0;
|
|
(*value_1) = value_2;
|
|
}
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ZIRAN_COMPILER_BACKEND_PROCESS_H */
|