Endian specific integers: e.g. i32 i32le i32be

This commit is contained in:
gingerBill
2018-12-02 15:53:52 +00:00
parent 784c48c9e3
commit 00161023cd
7 changed files with 278 additions and 49 deletions

View File

@@ -80,6 +80,8 @@ struct BuildContext {
String ODIN_ROOT; // Odin ROOT
bool ODIN_DEBUG; // Odin in debug mode
TargetEndianKind endian_kind;
// In bytes
i64 word_size; // Size of a pointer, must be >= 4
i64 max_align; // max alignment, must be >= 1 (and typically >= word_size)
@@ -539,6 +541,7 @@ void init_build_context(void) {
bc->ODIN_OS = target_os_names[metrics.os];
bc->ODIN_ARCH = target_arch_names[metrics.arch];
bc->ODIN_ENDIAN = target_endian_names[target_endians[metrics.arch]];
bc->endian_kind = target_endians[metrics.arch];
bc->word_size = metrics.word_size;
bc->max_align = metrics.max_align;
bc->link_flags = str_lit(" ");