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
diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp
index 9d80222..5f010f0 100644
--- a/lldb/source/Core/ArchSpec.cpp
+++ b/lldb/source/Core/ArchSpec.cpp
@@ -497,6 +497,40 @@
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
{