namespace llvm {
namespace sys {
- inline bool littleEndianHost() {
+ inline bool isLittleEndianHost() {
union {
int i;
char c;
return c;
}
- inline bool bigEndianHost() {
- return !littleEndianHost();
+ inline bool isBigEndianHost() {
+ return !isLittleEndianHost();
}
- /// osName() - Return the name of the host operating system or "" if
+ /// getOSName() - Return the name of the host operating system or "" if
/// unknown.
- std::string osName();
+ std::string getOSName();
- /// osVersion() - Return the operating system version as a string or
+ /// getOSVersion() - Return the operating system version as a string or
/// "" if unknown.
- std::string osVersion();
+ std::string getOSVersion();
}
}
assert((IntVal.getBitWidth()+7)/8 >= StoreBytes && "Integer too small!");
uint8_t *Src = (uint8_t *)IntVal.getRawData();
- if (sys::littleEndianHost())
+ if (sys::isLittleEndianHost())
// Little-endian host - the source is ordered from LSB to MSB. Order the
// destination from LSB to MSB: Do a straight copy.
memcpy(Dst, Src, StoreBytes);
cerr << "Cannot store value of type " << *Ty << "!\n";
}
- if (sys::littleEndianHost() != getTargetData()->isLittleEndian())
+ if (sys::isLittleEndianHost() != getTargetData()->isLittleEndian())
// Host and target are different endian - reverse the stored bytes.
std::reverse((uint8_t*)Ptr, StoreBytes + (uint8_t*)Ptr);
}
assert((IntVal.getBitWidth()+7)/8 >= LoadBytes && "Integer too small!");
uint8_t *Dst = (uint8_t *)IntVal.getRawData();
- if (sys::littleEndianHost())
+ if (sys::isLittleEndianHost())
// Little-endian host - the destination must be ordered from LSB to MSB.
// The source is ordered from LSB to MSB: Do a straight copy.
memcpy(Dst, Src, LoadBytes);
const Type *Ty) {
const unsigned LoadBytes = getTargetData()->getTypeStoreSize(Ty);
- if (sys::littleEndianHost() != getTargetData()->isLittleEndian()) {
+ if (sys::isLittleEndianHost() != getTargetData()->isLittleEndian()) {
// Host and target are different endian - reverse copy the stored
// bytes into a buffer, and load from that.
uint8_t *Src = (uint8_t*)Ptr;
using namespace llvm;
-std::string sys::osName() {
+std::string sys::getOSName() {
return "Windows";
}
-std::string sys::osVersion() {
+std::string sys::getOSVersion() {
OSVERSIONINFO osvi;
memset(&osvi, 0, sizeof(osvi));