add interfaces to get sizes of target integer types.

llvm-svn: 39470
This commit is contained in:
Chris Lattner 2007-05-20 23:50:03 +00:00
parent 073926e39a
commit dae7f8ddf4
1 changed files with 26 additions and 4 deletions

View File

@ -104,18 +104,40 @@ public:
return true; return true;
} }
/// getBoolWidth - Return the size of '_Bool' and C++ 'bool' for this target,
/// in bits.
unsigned getBoolWidth(SourceLocation Loc) {
return 8; // FIXME: implement correctly: wrong for ppc32.
}
/// getCharWidth - Return the size of 'char', 'signed char' and /// getCharWidth - Return the size of 'char', 'signed char' and
/// 'unsigned char' for this target, in bits. /// 'unsigned char' for this target, in bits.
unsigned getCharWidth(SourceLocation Loc) { unsigned getCharWidth(SourceLocation Loc) {
// FIXME: implement correctly. return 8; // FIXME: implement correctly.
return 8; }
/// getShortWidth - Return the size of 'signed short' and 'unsigned short' for
/// this target, in bits.
unsigned getShortWidth(SourceLocation Loc) {
return 16; // FIXME: implement correctly.
} }
/// getIntWidth - Return the size of 'signed int' and 'unsigned int' for this /// getIntWidth - Return the size of 'signed int' and 'unsigned int' for this
/// target, in bits. /// target, in bits.
unsigned getIntWidth(SourceLocation Loc) { unsigned getIntWidth(SourceLocation Loc) {
// FIXME: implement correctly. return 32; // FIXME: implement correctly.
return 32; }
/// getLongWidth - Return the size of 'signed long' and 'unsigned long' for
/// this target, in bits.
unsigned getLongWidth(SourceLocation Loc) {
return 32; // FIXME: implement correctly: wrong for ppc64/x86-64
}
/// getLongLongWidth - Return the size of 'signed long long' and
/// 'unsigned long long' for this target, in bits.
unsigned getLongLongWidth(SourceLocation Loc) {
return 64; // FIXME: implement correctly.
} }
/// getWCharWidth - Return the size of wchar_t in bits. /// getWCharWidth - Return the size of wchar_t in bits.