Commit 490524b7 authored by Tobias Hunger's avatar Tobias Hunger

Abi: Add endianness method

For now this uses the architecture to decide which endianness to use.
That does not work too well, so a endianness field is needed for
the master branch.

Change-Id: I394a959c4182271ee9847de7c8da1788a027c3a2
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 3de15920
......@@ -739,6 +739,14 @@ QList<Abi> Abi::abisOfBinary(const Utils::FileName &path)
return result;
}
ProjectExplorer::Abi::Endianness Abi::endianness() const
{
if (m_architecture == X86Architecture)
return LittleEndian;
// All other architectures are bi-endian:/
return UnknownEndian; // Todo: Add a field for endianness to the Abi struct!
}
} // namespace ProjectExplorer
// Unit tests:
......
......@@ -102,6 +102,12 @@ public:
UnknownFormat
};
enum Endianness {
LittleEndian,
BigEndian,
UnknownEndian
};
Abi() :
m_architecture(UnknownArchitecture), m_os(UnknownOS),
m_osFlavor(UnknownFlavor), m_binaryFormat(UnknownFormat), m_wordWidth(0)
......@@ -119,6 +125,7 @@ public:
bool isNull() const;
Architecture architecture() const { return m_architecture; }
Endianness endianness() const;
OS os() const { return m_os; }
OSFlavor osFlavor() const { return m_osFlavor; }
BinaryFormat binaryFormat() const { return m_binaryFormat; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment