Clang now models different Windows environments in the triple and we need to explicitly request the "MSVC" environment to get proper behavior when parsing MSVC headers.
We need to convert C++ integer types to C# types using the TargetInfo, as the
type bitwidths depend on the target architecture.
This fixes the main 64bit issue, which is that on 64bit Linux the current code
converts C++'s long to System.Int32, instead of System.Int64.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
We need Driver.TargeInfo in CSharpTypePrinter so that we can find out the
widths of the integer types.
This patch changes CSharpTypePrinter to get the Driver reference in its
constructor. As all the other constructor parameters can be found from the
Driver reference, we can remove all the other parameters.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
As enum PrimitiveType is supposed to represent C++ types, having Int32
and UInt32 there is not correct.
This patch renames those values to Int and UInt.
This doesn't change the behavior, but makes it clearer that the types
for 'int' and 'unsigned int' are not necessarily 32 bits.
As enum PrimitiveType is supposed to represent C++ types, having Int64
and UInt64 there is not correct.
This patch renames those values to LongLong and ULongLong.
This doesn't change the behavior, but makes it clearer that the types
for 'long long' and 'unsigned long long' are not necessarily 64 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
As enum PrimitiveType is supposed to represent C++ types, having Int16
and UInt16 there is not correct.
This patch renames those values to Short and UShort.
This doesn't change the behavior, but makes it clearer that the types
for 'short' and 'unsigned short' are not necessarily 16 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
As enum PrimitiveType is supposed to represent C++ types, having Int8
and UInt8 there is not correct.
This patch removes those values. As Int8 and UInt8 were set to be
equivalent to Char and UChar, we can just change all references to Int8
and UInt8 to Char and UChar.
This doesn't change the behavior, but makes it clearer that the types
for 'char' and 'unsigned char' are not necessarily 8 bits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
CppTypePrinter outputs C++ code, so the proper type to be written for
Long and ULong are "long" and "unsigned long", not "int" and "unsigned
int".
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
CLITypePrinter outputs C++ code, so the proper type to be written for
Long and ULong are "long" and "unsigned long", not "int" and "unsigned
int".
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>