diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-28 01:08:32 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-28 01:08:32 +0100 |
| commit | b7dd40f5f8ea20178e20151da2aed8f1787ac3f3 (patch) | |
| tree | 109ae5176bf78be7bcfdd417a1a24f2662e612a2 /target.c | |
| parent | dbcc589f4577ebb0d6d05e36e2ac1246b56555ed (diff) | |
| parent | 3b7e1cffefb39feb9bb6b06e849eceac438f4d5e (diff) | |
| download | sparse-dev-b7dd40f5f8ea20178e20151da2aed8f1787ac3f3.tar.gz | |
Merge branch 'arch-cleanup' into master
Diffstat (limited to 'target.c')
| -rw-r--r-- | target.c | 51 |
1 files changed, 23 insertions, 28 deletions
@@ -83,19 +83,21 @@ void init_target(void) wchar_ctype = &long_ctype; /* fall through */ case MACH_X86_64: -#if defined(__APPLE__) - int64_ctype = &llong_ctype; - uint64_ctype = &ullong_ctype; -#endif -#if defined(__FreeBSD__) || defined(__APPLE__) - wint_ctype = &int_ctype; -#endif -#if defined(__CYGWIN__) - wchar_ctype = &ushort_ctype; -#endif + switch (arch_os) { + case OS_CYGWIN: + wchar_ctype = &ushort_ctype; + break; + case OS_DARWIN: + int64_ctype = &llong_ctype; + uint64_ctype = &ullong_ctype; + wint_ctype = &int_ctype; + break; + case OS_FREEBSD: + wint_ctype = &int_ctype; + break; + } break; case MACH_M68K: - case MACH_SPARC32: case MACH_PPC32: wchar_ctype = &long_ctype; break; @@ -103,6 +105,12 @@ void init_target(void) case MACH_ARM64: wchar_ctype = &uint_ctype; break; + case MACH_SPARC32: + if (arch_os == OS_SUNOS) { + wint_ctype = &long_ctype; + wchar_ctype = &long_ctype; + } + break; default: break; } @@ -110,29 +118,16 @@ void init_target(void) wchar_ctype = &ushort_ctype; switch (arch_mach) { - case MACH_MIPS64: - if (arch_m64 == ARCH_LP64) + case MACH_SPARC32: + if (arch_os == OS_SUNOS) break; /* fall through */ - case MACH_M68K: - case MACH_SPARC32: - case MACH_PPC32: - case MACH_MIPS32: - case MACH_RISCV32: - arch_m64 = ARCH_LP32; - int32_ctype = &long_ctype; - uint32_ctype = &ulong_ctype; - break; - default: - break; - } - - switch (arch_mach) { case MACH_ARM: + case MACH_MIPS64: + // FIXME: ABI n32 & (n)64 have 128-bit ldouble case MACH_MIPS32: case MACH_S390: case MACH_S390X: - case MACH_SPARC32: bits_in_longdouble = 64; max_fp_alignment = 8; break; |
