Skip to content

Commit e5956f2

Browse files
committedJun 17, 2018
add target C int type information for msp430 target
closes #1125
·
0.15.20.3.0
1 parent 7515187 commit e5956f2

File tree

1 file changed

+35
-15
lines changed

1 file changed

+35
-15
lines changed
 

‎src/target.cpp‎

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -686,21 +686,41 @@ static int get_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
686686
uint32_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:

0 commit comments

Comments
 (0)
Please sign in to comment.