Skip to content

Commit

Permalink
Add support for ((un)signed) long long
Browse files Browse the repository at this point in the history
  • Loading branch information
RA-Kooi committed Sep 11, 2022
1 parent 6a61949 commit 8e47fea
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions DwarfOne2C/Tags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,12 @@ public enum BuiltInType

Label = -22, // FT_label; Unused (fortran)

Unknown = -23, // For when AT_fund_type() is empty...
// Metrowerks extensions
LongLong = -23, // FT_long_long; long long
SignedLongLong = -24, // FT_signed_long_long; signed long long
UnsignedLongLong = -25, // FT_unsigned_long_long; unsigned long long

Unknown = -26, // For when AT_fund_type() is empty...
}

public enum Modifier
Expand Down Expand Up @@ -229,6 +234,12 @@ public static string BuiltInToString(BuiltInType builtInType)
return "void";
case BuiltInType.Pointer:
return "void *";
case BuiltInType.LongLong:
return "long long";
case BuiltInType.SignedLongLong:
return "signed long long";
case BuiltInType.UnsignedLongLong:
return "unsigned long long";
case BuiltInType.Unknown:
return "UnknownType";
}
Expand Down Expand Up @@ -283,6 +294,12 @@ public static BuiltInType FTToBuiltInType(string FT)
return BuiltInType.Void;
case "FT_pointer":
return BuiltInType.Pointer;
case "FT_long_long":
return BuiltInType.LongLong;
case "FT_signed_long_long":
return BuiltInType.SignedLongLong;
case "FT_unsigned_long_long":
return BuiltInType.UnsignedLongLong;
}

throw new ArgumentException(FT + " is not a built-in type.");
Expand All @@ -308,21 +325,21 @@ public static int BuiltInTypeSize(BuiltInType builtInType)
case BuiltInType.SignedLong:
case BuiltInType.UnsignedLong:
case BuiltInType.Float:
case BuiltInType.Pointer:
return 4;
case BuiltInType.Double:
case BuiltInType.DoublePrecFloat:
case BuiltInType.LongLong:
case BuiltInType.SignedLongLong:
case BuiltInType.UnsignedLongLong:
return 8;
case BuiltInType.ExtPrecFloat:
return 12;
case BuiltInType.Double:
return 8;
case BuiltInType.DoublePrecDouble:
return 12;
case BuiltInType.ExtPrecDouble:
return 16;
case BuiltInType.Void:
return 0;
case BuiltInType.Pointer:
return 4;
}

throw new ArgumentException(
Expand Down

0 comments on commit 8e47fea

Please sign in to comment.