Rework the way in which ValueObjectChild decides how to update itself; this is a slight refactoring that I need as part of a larger master plan. As such, should be NFC
llvm-svn: 252529
This commit is contained in:
parent
2652b75700
commit
99448c6367
|
@ -179,6 +179,9 @@ public:
|
|||
|
||||
bool
|
||||
IsReferenceType(CompilerType *pointee_type = nullptr, bool* is_rvalue = nullptr) const;
|
||||
|
||||
bool
|
||||
ShouldTreatScalarValueAsAddress () const;
|
||||
|
||||
bool
|
||||
IsScalarType () const;
|
||||
|
|
|
@ -496,6 +496,12 @@ public:
|
|||
virtual bool
|
||||
IsReferenceType (lldb::opaque_compiler_type_t type, CompilerType *pointee_type, bool* is_rvalue) = 0;
|
||||
|
||||
virtual bool
|
||||
ShouldTreatScalarValueAsAddress (lldb::opaque_compiler_type_t type)
|
||||
{
|
||||
return IsPointerOrReferenceType(type, nullptr);
|
||||
}
|
||||
|
||||
virtual UserExpression *
|
||||
GetUserExpression (const char *expr,
|
||||
const char *expr_prefix,
|
||||
|
|
|
@ -960,7 +960,8 @@ namespace lldb {
|
|||
eTypeIsInteger = (1u << 18),
|
||||
eTypeIsFloat = (1u << 19),
|
||||
eTypeIsComplex = (1u << 20),
|
||||
eTypeIsSigned = (1u << 21)
|
||||
eTypeIsSigned = (1u << 21),
|
||||
eTypeInstanceIsPointer = (1u << 22)
|
||||
};
|
||||
|
||||
FLAGS_ENUM(CommandFlags)
|
||||
|
|
|
@ -146,7 +146,7 @@ ValueObjectChild::UpdateValue ()
|
|||
Value::ValueType value_type = parent->GetValue().GetValueType();
|
||||
m_value.SetValueType (value_type);
|
||||
|
||||
if (parent->GetCompilerType().IsPointerOrReferenceType ())
|
||||
if (parent->GetCompilerType().ShouldTreatScalarValueAsAddress())
|
||||
{
|
||||
lldb::addr_t addr = parent->GetPointerValue ();
|
||||
m_value.GetScalar() = addr;
|
||||
|
|
|
@ -226,6 +226,14 @@ CompilerType::IsReferenceType (CompilerType *pointee_type, bool* is_rvalue) cons
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
CompilerType::ShouldTreatScalarValueAsAddress () const
|
||||
{
|
||||
if (IsValid())
|
||||
return m_type_system->ShouldTreatScalarValueAsAddress(m_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
CompilerType::IsFloatingPointType (uint32_t &count, bool &is_complex) const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue