aboutsummaryrefslogtreecommitdiff
path: root/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
commit57d7d3f2d76d8d042faa95d82374b0c24cfce35f (patch)
treec7dbc74af3dc0d9983cc6501965297c0f96e5dc4 /lib/Target/TargetData.cpp
parentbbc6597f02d108f32b5bdc7711cc67386196017b (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r--lib/Target/TargetData.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 8c466543fa..4929805473 100644
--- a/lib/Target/TargetData.cpp
+++ b/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