[llvm-commits] [llvm] r62776 - in /llvm/trunk: include/llvm/System/Host.h lib/ExecutionEngine/ExecutionEngine.cpp lib/System/Unix/Host.inc lib/System/Win32/Host.inc
Chris Lattner
sabre at nondot.org
Thu Jan 22 11:53:01 PST 2009
Author: lattner
Date: Thu Jan 22 13:53:00 2009
New Revision: 62776
URL: http://llvm.org/viewvc/llvm-project?rev=62776&view=rev
Log:
rename methods in System/Host to be more consistent.
Modified:
llvm/trunk/include/llvm/System/Host.h
llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
llvm/trunk/lib/System/Unix/Host.inc
llvm/trunk/lib/System/Win32/Host.inc
Modified: llvm/trunk/include/llvm/System/Host.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Host.h?rev=62776&r1=62775&r2=62776&view=diff
==============================================================================
--- llvm/trunk/include/llvm/System/Host.h (original)
+++ llvm/trunk/include/llvm/System/Host.h Thu Jan 22 13:53:00 2009
@@ -19,7 +19,7 @@
namespace llvm {
namespace sys {
- inline bool littleEndianHost() {
+ inline bool isLittleEndianHost() {
union {
int i;
char c;
@@ -28,17 +28,17 @@
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();
}
}
Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=62776&r1=62775&r2=62776&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Thu Jan 22 13:53:00 2009
@@ -692,7 +692,7 @@
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);
@@ -751,7 +751,7 @@
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);
}
@@ -762,7 +762,7 @@
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);
@@ -789,7 +789,7 @@
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;
Modified: llvm/trunk/lib/System/Unix/Host.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Host.inc?rev=62776&r1=62775&r2=62776&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Host.inc (original)
+++ llvm/trunk/lib/System/Unix/Host.inc Thu Jan 22 13:53:00 2009
@@ -23,7 +23,7 @@
using namespace llvm;
-std::string llvm::sys::osName() {
+std::string llvm::sys::getOSName() {
struct utsname info;
if (uname(&info))
@@ -32,7 +32,7 @@
return info.sysname;
}
-std::string llvm::sys::osVersion() {
+std::string llvm::sys::getOSVersion() {
struct utsname info;
if (uname(&info))
Modified: llvm/trunk/lib/System/Win32/Host.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Host.inc?rev=62776&r1=62775&r2=62776&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Host.inc (original)
+++ llvm/trunk/lib/System/Win32/Host.inc Thu Jan 22 13:53:00 2009
@@ -17,11 +17,11 @@
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));
More information about the llvm-commits
mailing list