BFC-Compiler
A C23 Brainfuck compiler
Loading...
Searching...
No Matches
bfc_target.h File Reference

Target architecture and operating-system interface. More...

#include "bfc_error.h"

Go to the source code of this file.

Data Structures

struct  bfc_target_t
 Architecture and operating-system pair used to select a backend. More...

Enumerations

enum  bfc_arch_t { BFC_ARCH_X86_64 , BFC_ARCH_I386 , BFC_ARCH_AARCH64 , BFC_ARCH_ARM32 }
 Architectures understood by target parsing and backend selection.
enum  bfc_os_t { BFC_OS_WINDOWS , BFC_OS_MACOS , BFC_OS_LINUX }
 Operating systems that determine ABI and object-format behaviour.

Functions

bfc_error_t bfc_target_parse (bfc_target_t *target, const char *triple)
 Parses a supported target triple.
bfc_target_t bfc_target_host (void)
 Returns the target corresponding to the compiler host.

Detailed Description

Target architecture and operating-system interface.

Defines code-generation targets, target-triple parsing, and host-target detection.

Function Documentation

◆ bfc_target_host()

bfc_target_t bfc_target_host ( void )

Returns the target corresponding to the compiler host.

Derives the native target from compiler predefined macros.

Returns
The host architecture and operating-system pair.

Returns the target corresponding to the compiler host.

◆ bfc_target_parse()

bfc_error_t bfc_target_parse ( bfc_target_t * target,
const char * triple )

Parses a supported target triple.

Looks up a supported textual target triple.

Parameters
[out]targetReceives the parsed target on success.
[in]tripleNull-terminated target triple.
Returns
BFC_ERR_OK on success; otherwise an argument error.

Parses a supported target triple.