This allows us to query about the endianness without having to
look at DataLayout. The API will be used (and tested) in lld,
in order to find out the endianness of BitcodeFiles.
Briefly discussed with Rafael.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274090
91177308-0d34-0410-b5e6-
96231b3b80d8
/// string then the triple's arch name is used.
StringRef getARMCPUForArch(StringRef Arch = StringRef()) const;
+ /// Tests whether the target triple is little endian.
+ ///
+ /// \returns true if the triple is little endian, false otherwise.
+ bool isLittleEndian() const;
+
/// @}
/// @name Static helpers for IDs.
/// @{
return T;
}
+bool Triple::isLittleEndian() const {
+ return *this == getLittleEndianArchVariant();
+}
+
StringRef Triple::getARMCPUForArch(StringRef MArch) const {
if (MArch.empty())
MArch = getArchName();