summaryrefslogtreecommitdiff
path: root/src/trans/target.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2019-10-26 17:15:23 +0800
committerJohn Hodge <tpg@mutabah.net>2019-10-26 17:15:23 +0800
commit99904636d2e1e335238552cbb5b8b23dd06b7295 (patch)
tree5fd6470fb702b2a26253d380d47d5b6fd232607f /src/trans/target.hpp
parent7ca04e2d668fa44a1663158f844cb912e396cb32 (diff)
parentebd8edeb4f1861943cc82d310564b1f592e63272 (diff)
downloadmrust-99904636d2e1e335238552cbb5b8b23dd06b7295.tar.gz
Merge remote-tracking branch 'remotes/origin/master' into nightly-1.29
Diffstat (limited to 'src/trans/target.hpp')
-rw-r--r--src/trans/target.hpp42
1 files changed, 36 insertions, 6 deletions
diff --git a/src/trans/target.hpp b/src/trans/target.hpp
index 107d19e1..3433483b 100644
--- a/src/trans/target.hpp
+++ b/src/trans/target.hpp
@@ -17,23 +17,53 @@ 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;
- struct {
- bool u8;
- bool u16;
- bool u32;
- bool u64;
- bool ptr;
+ struct Atomics {
+ bool u8 = true;
+ bool u16 = true;
+ bool u32 = true;
+ bool u64 = false;
+ bool ptr = true;
+ Atomics(bool u8 = true, bool u16 = true, bool u32 = true, bool u64 = false, bool ptr = true)
+ :u8(u8)
+ ,u16(u16)
+ ,u32(u32)
+ ,u64(u64)
+ ,ptr(ptr)
+ {
+ }
} m_atomics;
+
+ struct Alignments {
+ uint8_t u16;
+ uint8_t u32;
+ uint8_t u64;
+ uint8_t u128;
+ uint8_t f32;
+ uint8_t f64;
+ uint8_t ptr;
+ Alignments(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)
+ :u16 (u16)
+ ,u32 (u32 )
+ ,u64 (u64 )
+ ,u128(u128)
+ ,f32 (f32 )
+ ,f64 (f64 )
+ ,ptr (ptr )
+ {
+ }
+ } 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;