diff options
author | Matthew Gardiner <mg11@csr.com> | 2014-09-01 09:06:03 +0000 |
---|---|---|
committer | Matthew Gardiner <mg11@csr.com> | 2014-09-01 09:06:03 +0000 |
commit | e77b2948b49c6f868764cfdd7ca832ab1bde13bb (patch) | |
tree | 670f9abd82edabaea8da3e20a203254f27d6ab1f | |
parent | 0c083024f0fdaa958ec8b1a8cd5b27dc53bf68af (diff) | |
download | bcm5719-llvm-e77b2948b49c6f868764cfdd7ca832ab1bde13bb.tar.gz bcm5719-llvm-e77b2948b49c6f868764cfdd7ca832ab1bde13bb.zip |
Add an interface on ArchSpec to provide lldb client code
with a mechanism to query if the current target architecture
has non 8-bit bytes.
llvm-svn: 216867
-rw-r--r-- | lldb/include/lldb/Core/ArchSpec.h | 18 | ||||
-rw-r--r-- | lldb/source/Core/ArchSpec.cpp | 34 |
2 files changed, 52 insertions, 0 deletions
diff --git a/lldb/include/lldb/Core/ArchSpec.h b/lldb/include/lldb/Core/ArchSpec.h index b82bb79e201..255beee573b 100644 --- a/lldb/include/lldb/Core/ArchSpec.h +++ b/lldb/include/lldb/Core/ArchSpec.h @@ -369,6 +369,24 @@ public: GetMachOCPUSubType () const; //------------------------------------------------------------------ + /// Architecture data byte width accessor + /// + /// @return the size in 8-bit (host) bytes of a minimum addressable + /// unit from the Architecture's data bus + //------------------------------------------------------------------ + uint32_t + GetDataByteSize() const; + + //------------------------------------------------------------------ + /// Architecture code byte width accessor + /// + /// @return the size in 8-bit (host) bytes of a minimum addressable + /// unit from the Architecture's code bus + //------------------------------------------------------------------ + uint32_t + GetCodeByteSize() const; + + //------------------------------------------------------------------ /// Architecture tripple accessor. /// /// @return A triple describing this ArchSpec. diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp index 9d80222be6a..5f010f06640 100644 --- a/lldb/source/Core/ArchSpec.cpp +++ b/lldb/source/Core/ArchSpec.cpp @@ -497,6 +497,40 @@ ArchSpec::GetMachOCPUSubType () const return LLDB_INVALID_CPUTYPE; } +uint32_t +ArchSpec::GetDataByteSize () const +{ + switch (m_core) + { + case eCore_kalimba3: + return 3; + case eCore_kalimba4: + return 1; + case eCore_kalimba5: + return 3; + default: + return 1; + } + return 1; +} + +uint32_t +ArchSpec::GetCodeByteSize () const +{ + switch (m_core) + { + case eCore_kalimba3: + return 4; + case eCore_kalimba4: + return 1; + case eCore_kalimba5: + return 1; + default: + return 1; + } + return 1; +} + llvm::Triple::ArchType ArchSpec::GetMachine () const { |