diff options
Diffstat (limited to 'include/llvm/Target/TargetData.h')
-rw-r--r-- | include/llvm/Target/TargetData.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 3136a38ac0..fd52ef380a 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -23,6 +23,7 @@ #include "llvm/Pass.h" #include "llvm/Support/DataTypes.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Config/config.h" #include <string> namespace llvm { @@ -142,6 +143,16 @@ public: bool isLittleEndian() const { return LittleEndian; } bool isBigEndian() const { return !LittleEndian; } + /// Host endianness... + bool hostIsLittleEndian() const { +#ifdef LSB_FIRST + return true; +#else + return false; +#endif + } + bool hostIsBigEndian() const { return !hostIsLittleEndian(); } + /// getStringRepresentation - Return the string representation of the /// TargetData. This representation is in the same format accepted by the /// string constructor above. |