Move TargetData::hostIsLittleEndian out of line, which means we
authorChris Lattner <sabre@nondot.org>
Tue, 11 Dec 2007 00:28:59 +0000 (00:28 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 11 Dec 2007 00:28:59 +0000 (00:28 +0000)
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

include/llvm/Target/TargetData.h
lib/Target/TargetData.cpp

index fd52ef380abfd1696298df347c0a24189c80e17e..fcc57a1b2a2be4f6211564127f8203898080fa16 100644 (file)
@@ -23,7 +23,6 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/Config/config.h"
 #include <string>
 
 namespace llvm {
 #include <string>
 
 namespace llvm {
@@ -143,14 +142,8 @@ public:
   bool          isLittleEndian()       const { return     LittleEndian; }
   bool          isBigEndian()          const { return    !LittleEndian; }
 
   bool          isLittleEndian()       const { return     LittleEndian; }
   bool          isBigEndian()          const { return    !LittleEndian; }
 
-  /// Host endianness...
-  bool hostIsLittleEndian() const {
-#ifdef LSB_FIRST
-    return true;
-#else
-    return false;
-#endif
-  }
+  /// Host endianness.
+  bool hostIsLittleEndian() const;
   bool hostIsBigEndian() const { return !hostIsLittleEndian(); }
 
   /// getStringRepresentation - Return the string representation of the
   bool hostIsBigEndian() const { return !hostIsLittleEndian(); }
 
   /// getStringRepresentation - Return the string representation of the
index 8c466543facc3f5784e427262029386ece423970..492980547353035e597b539839a695b1620e1e1e 100644 (file)
@@ -25,6 +25,7 @@
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringExtras.h"
 #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>
 #include <algorithm>
 #include <cstdlib>
 #include <sstream>
@@ -132,6 +133,14 @@ const TargetAlignElem TargetData::InvalidAlignmentElem =
 //                       TargetData Class Implementation
 //===----------------------------------------------------------------------===//
 
 //                       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
 /*!
  A TargetDescription string consists of a sequence of hyphen-delimited
  specifiers for target endianness, pointer size and alignments, and various