summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-12-12 23:03:45 +0000
committerDuncan Sands <baldrick@free.fr>2007-12-12 23:03:45 +0000
commitfde556745bfc6ec9dae2d1dbca3b6f734d3f842c (patch)
treec33562bce71e402b42d7082854958ff09385a4d5 /llvm/lib
parent1daa3cfbae60569c33a0c695f10fb4ccf243a173 (diff)
downloadbcm5719-llvm-fde556745bfc6ec9dae2d1dbca3b6f734d3f842c.tar.gz
bcm5719-llvm-fde556745bfc6ec9dae2d1dbca3b6f734d3f842c.zip
Remove host endianness info from TargetData and
put it in a new header System/Host.h instead. Instead of getting the endianness from configure, calculate it directly. llvm-svn: 44959
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp5
-rw-r--r--llvm/lib/Target/TargetData.cpp9
2 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 2c7a7dd1443..521e4233657 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -23,6 +23,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/MutexGuard.h"
#include "llvm/System/DynamicLibrary.h"
+#include "llvm/System/Host.h"
#include "llvm/Target/TargetData.h"
#include <math.h>
using namespace llvm;
@@ -637,7 +638,7 @@ void ExecutionEngine::StoreValueToMemory(const GenericValue &Val, GenericValue *
uint8_t *Src = (uint8_t *)Val.IntVal.getRawData();
uint8_t *Dst = (uint8_t *)Ptr;
- if (getTargetData()->hostIsLittleEndian())
+ if (sys::littleEndianHost())
// 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);
@@ -698,7 +699,7 @@ void ExecutionEngine::LoadValueFromMemory(GenericValue &Result,
uint8_t *Src = (uint8_t *)Ptr;
uint8_t *Dst = (uint8_t *)Result.IntVal.getRawData();
- if (getTargetData()->hostIsLittleEndian())
+ if (sys::littleEndianHost())
// 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);
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 49298054735..8c466543fac 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -25,7 +25,6 @@
#include "llvm/Support/ManagedStatic.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringExtras.h"
-#include "llvm/Config/config.h"
#include <algorithm>
#include <cstdlib>
#include <sstream>
@@ -133,14 +132,6 @@ const TargetAlignElem TargetData::InvalidAlignmentElem =
// TargetData Class Implementation
//===----------------------------------------------------------------------===//
-bool TargetData::hostIsLittleEndian() const {
-#ifdef LSB_FIRST
- return true;
-#else
- return false;
-#endif
-}
-
/*!
A TargetDescription string consists of a sequence of hyphen-delimited
specifiers for target endianness, pointer size and alignments, and various
OpenPOWER on IntegriCloud