summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-11 00:28:59 +0000
committerChris Lattner <sabre@nondot.org>2007-12-11 00:28:59 +0000
commit2945c46e9387728dfe3175c4ba187d23489df130 (patch)
tree0bda6fe4813eeaca1527dc617a5f2ba7021ef5a6 /llvm/lib/Target/TargetData.cpp
parent2b0eed278b400ecac23db76214b08b6c9dc4ef61 (diff)
downloadbcm5719-llvm-2945c46e9387728dfe3175c4ba187d23489df130.tar.gz
bcm5719-llvm-2945c46e9387728dfe3175c4ba187d23489df130.zip
Move TargetData::hostIsLittleEndian out of line, which means we
don't have to #include config.h in it. #including config.h breaks other projects that have their own autoconf stuff and try to #include the llvm headers. One obscure example is llvm-gcc. llvm-svn: 44825
Diffstat (limited to 'llvm/lib/Target/TargetData.cpp')
-rw-r--r--llvm/lib/Target/TargetData.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 8c466543fac..49298054735 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -25,6 +25,7 @@
#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>
@@ -132,6 +133,14 @@ 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