diff options
author | John Hodge <tpg@ucc.asn.au> | 2018-12-15 14:47:08 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2018-12-15 14:47:08 +0800 |
commit | f6209dce15ce863e15dc3063d78e43eeb0db25ee (patch) | |
tree | 9b041d4b32fc6907867412203db18d8c06fcf674 /src/trans/target.hpp | |
parent | 539ecb375c8b86bb0b3c2d64d73dfa6d5b56c2b9 (diff) | |
download | mrust-f6209dce15ce863e15dc3063d78e43eeb0db25ee.tar.gz |
Targets - Add alignment to the target specs, along with a saveback test.
Diffstat (limited to 'src/trans/target.hpp')
-rw-r--r-- | src/trans/target.hpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/trans/target.hpp b/src/trans/target.hpp index b1ed9456..b6f04a42 100644 --- a/src/trans/target.hpp +++ b/src/trans/target.hpp @@ -17,23 +17,35 @@ enum class CodegenMode Msvc, }; +// NOTE: The default architecture is an unnamed 32-bit little-endian arch with all types natively aligned struct TargetArch { - ::std::string m_name; - unsigned m_pointer_bits; - bool m_big_endian; + ::std::string m_name = ""; + unsigned m_pointer_bits = 32; + bool m_big_endian = false; struct { - bool u8; - bool u16; - bool u32; - bool u64; - bool ptr; + bool u8 = true; + bool u16 = true; + bool u32 = true; + bool u64 = false; + bool ptr = true; } m_atomics; + + struct { + uint8_t u16 = 2; + uint8_t u32 = 4; + uint8_t u64 = 8; + uint8_t u128 = 16; + uint8_t f32 = 4; + uint8_t f64 = 8; + uint8_t ptr = 4; + } m_alignments; }; struct BackendOptsC { CodegenMode m_codegen_mode; + bool m_emulated_i128; // Influences the chosen alignment for i128/u128 ::std::string m_c_compiler; // MSVC arch / GNU triplet ::std::vector< ::std::string> m_compiler_opts; ::std::vector< ::std::string> m_linker_opts; |