diff options
Diffstat (limited to 'contrib/llvm-project/lldb/include/lldb/Core/Value.h')
-rw-r--r-- | contrib/llvm-project/lldb/include/lldb/Core/Value.h | 86 |
1 files changed, 1 insertions, 85 deletions
diff --git a/contrib/llvm-project/lldb/include/lldb/Core/Value.h b/contrib/llvm-project/lldb/include/lldb/Core/Value.h index 641a64a3bbbe..0ff773e59911 100644 --- a/contrib/llvm-project/lldb/include/lldb/Core/Value.h +++ b/contrib/llvm-project/lldb/include/lldb/Core/Value.h @@ -43,8 +43,6 @@ public: // m_value contains... // ============================ eValueTypeScalar, // raw scalar value - eValueTypeVector, // byte array of m_vector.length with endianness of - // m_vector.byte_order eValueTypeFileAddress, // file address value eValueTypeLoadAddress, // load address value eValueTypeHostAddress // host address value (for memory in the process that @@ -62,66 +60,8 @@ public: eContextTypeVariable // lldb_private::Variable * }; - const static size_t kMaxByteSize = 32u; - - struct Vector { - // The byte array must be big enough to hold vector registers for any - // supported target. - uint8_t bytes[kMaxByteSize]; - size_t length; - lldb::ByteOrder byte_order; - - Vector() : length(0), byte_order(lldb::eByteOrderInvalid) {} - - Vector(const Vector &vector) { *this = vector; } - const Vector &operator=(const Vector &vector) { - SetBytes(vector.bytes, vector.length, vector.byte_order); - return *this; - } - - void Clear() { length = 0; } - - bool SetBytes(const void *bytes, size_t length, - lldb::ByteOrder byte_order) { - this->length = length; - this->byte_order = byte_order; - if (length) - ::memcpy(this->bytes, bytes, - length < kMaxByteSize ? length : kMaxByteSize); - return IsValid(); - } - - bool IsValid() const { - return (length > 0 && length < kMaxByteSize && - byte_order != lldb::eByteOrderInvalid); - } - // Casts a vector, if valid, to an unsigned int of matching or largest - // supported size. Truncates to the beginning of the vector if required. - // Returns a default constructed Scalar if the Vector data is internally - // inconsistent. - llvm::APInt rhs = llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128, - ((type128 *)bytes)->x); - Scalar GetAsScalar() const { - Scalar scalar; - if (IsValid()) { - if (length == 1) - scalar = *(const uint8_t *)bytes; - else if (length == 2) - scalar = *(const uint16_t *)bytes; - else if (length == 4) - scalar = *(const uint32_t *)bytes; - else if (length == 8) - scalar = *(const uint64_t *)bytes; - else if (length >= 16) - scalar = rhs; - } - return scalar; - } - }; - Value(); Value(const Scalar &scalar); - Value(const Vector &vector); Value(const void *bytes, int len); Value(const Value &rhs); @@ -153,8 +93,7 @@ public: m_context = p; if (m_context_type == eContextTypeRegisterInfo) { RegisterInfo *reg_info = GetRegisterInfo(); - if (reg_info->encoding == lldb::eEncodingVector && - m_vector.byte_order != lldb::eByteOrderInvalid) + if (reg_info->encoding == lldb::eEncodingVector) SetValueType(eValueTypeScalar); } } @@ -167,30 +106,8 @@ public: const Scalar &GetScalar() const { return m_value; } - const Vector &GetVector() const { return m_vector; } - Scalar &GetScalar() { return m_value; } - Vector &GetVector() { return m_vector; } - - bool SetVectorBytes(const Vector &vector) { - m_vector = vector; - return m_vector.IsValid(); - } - - bool SetVectorBytes(uint8_t *bytes, size_t length, - lldb::ByteOrder byte_order) { - return m_vector.SetBytes(bytes, length, byte_order); - } - - bool SetScalarFromVector() { - if (m_vector.IsValid()) { - m_value = m_vector.GetAsScalar(); - return true; - } - return false; - } - size_t ResizeData(size_t len); size_t AppendDataToHostBuffer(const Value &rhs); @@ -225,7 +142,6 @@ public: protected: Scalar m_value; - Vector m_vector; CompilerType m_compiler_type; void *m_context; ValueType m_value_type; |