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
This commit is contained in:
Chris Lattner 2007-12-11 00:28:59 +00:00
parent bbc6597f02
commit 57d7d3f2d7
2 changed files with 11 additions and 9 deletions

View File

@ -23,7 +23,6 @@
#include "llvm/Pass.h" #include "llvm/Pass.h"
#include "llvm/Support/DataTypes.h" #include "llvm/Support/DataTypes.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
#include "llvm/Config/config.h"
#include <string> #include <string>
namespace llvm { namespace llvm {
@ -143,14 +142,8 @@ public:
bool isLittleEndian() const { return LittleEndian; } bool isLittleEndian() const { return LittleEndian; }
bool isBigEndian() const { return !LittleEndian; } bool isBigEndian() const { return !LittleEndian; }
/// Host endianness... /// Host endianness.
bool hostIsLittleEndian() const { bool hostIsLittleEndian() const;
#ifdef LSB_FIRST
return true;
#else
return false;
#endif
}
bool hostIsBigEndian() const { return !hostIsLittleEndian(); } bool hostIsBigEndian() const { return !hostIsLittleEndian(); }
/// getStringRepresentation - Return the string representation of the /// getStringRepresentation - Return the string representation of the

View File

@ -25,6 +25,7 @@
#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/ManagedStatic.h"
#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
#include <algorithm> #include <algorithm>
#include <cstdlib> #include <cstdlib>
#include <sstream> #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 A TargetDescription string consists of a sequence of hyphen-delimited
specifiers for target endianness, pointer size and alignments, and various specifiers for target endianness, pointer size and alignments, and various