authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-06-17 12:47:27-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-06-17 12:47:27-04:00
loge5956f23ca702b79a3a4b0f0440a2fe88e0231e5
tree942468aae372c8ba1d4ec89b047112859f63f92e
parent751518787ae9772eb063a4911a10bf30b2c2a19c

add target C int type information for msp430 target

closes #1125

1 files changed, 35 insertions(+), 15 deletions(-)

src/target.cpp+35-15
......@@ -686,21 +686,41 @@ static int get_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
686686uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
687687 switch (target->os) {
688688 case OsFreestanding:
689 switch (id) {
690 case CIntTypeShort:
691 case CIntTypeUShort:
692 return 16;
693 case CIntTypeInt:
694 case CIntTypeUInt:
695 return 32;
696 case CIntTypeLong:
697 case CIntTypeULong:
698 return get_arch_pointer_bit_width(target->arch.arch);
699 case CIntTypeLongLong:
700 case CIntTypeULongLong:
701 return 64;
702 case CIntTypeCount:
703 zig_unreachable();
689 switch (target->arch.arch) {
690 case ZigLLVM_msp430:
691 switch (id) {
692 case CIntTypeShort:
693 case CIntTypeUShort:
694 return 16;
695 case CIntTypeInt:
696 case CIntTypeUInt:
697 return 16;
698 case CIntTypeLong:
699 case CIntTypeULong:
700 return get_arch_pointer_bit_width(target->arch.arch);
701 case CIntTypeLongLong:
702 case CIntTypeULongLong:
703 return 64;
704 case CIntTypeCount:
705 zig_unreachable();
706 }
707 default:
708 switch (id) {
709 case CIntTypeShort:
710 case CIntTypeUShort:
711 return 16;
712 case CIntTypeInt:
713 case CIntTypeUInt:
714 return 32;
715 case CIntTypeLong:
716 case CIntTypeULong:
717 return get_arch_pointer_bit_width(target->arch.arch);
718 case CIntTypeLongLong:
719 case CIntTypeULongLong:
720 return 64;
721 case CIntTypeCount:
722 zig_unreachable();
723 }
704724 }
705725 case OsLinux:
706726 case OsMacOSX: