summaryrefslogtreecommitdiff
path: root/source/Core/ValueObjectConstResult.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:55:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:55:28 +0000
commite81d9d49145e432d917eea3a70d2ae74dcad1d89 (patch)
tree9ed5e1a91f242e2cb5911577356e487a55c01b78 /source/Core/ValueObjectConstResult.cpp
parent85d8ef8f1f0e0e063a8571944302be2d2026f823 (diff)
Notes
Diffstat (limited to 'source/Core/ValueObjectConstResult.cpp')
-rw-r--r--source/Core/ValueObjectConstResult.cpp59
1 files changed, 34 insertions, 25 deletions
diff --git a/source/Core/ValueObjectConstResult.cpp b/source/Core/ValueObjectConstResult.cpp
index b4e6303064691..a0f1737a861c4 100644
--- a/source/Core/ValueObjectConstResult.cpp
+++ b/source/Core/ValueObjectConstResult.cpp
@@ -16,7 +16,7 @@
#include "lldb/Core/ValueObjectDynamicValue.h"
#include "lldb/Core/ValueObjectList.h"
-#include "lldb/Symbol/ClangASTType.h"
+#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/Type.h"
@@ -61,21 +61,21 @@ ValueObjectSP
ValueObjectConstResult::Create
(
ExecutionContextScope *exe_scope,
- const ClangASTType &clang_type,
+ const CompilerType &compiler_type,
const ConstString &name,
const DataExtractor &data,
lldb::addr_t address
)
{
return (new ValueObjectConstResult (exe_scope,
- clang_type,
+ compiler_type,
name,
data,
address))->GetSP();
}
ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope,
- const ClangASTType &clang_type,
+ const CompilerType &compiler_type,
const ConstString &name,
const DataExtractor &data,
lldb::addr_t address) :
@@ -94,7 +94,7 @@ ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope
m_value.GetScalar() = (uintptr_t)m_data.GetDataStart();
m_value.SetValueType(Value::eValueTypeHostAddress);
- m_value.SetClangType(clang_type);
+ m_value.SetCompilerType(compiler_type);
m_name = name;
SetIsConstant ();
SetValueIsValid(true);
@@ -103,7 +103,7 @@ ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope
ValueObjectSP
ValueObjectConstResult::Create (ExecutionContextScope *exe_scope,
- const ClangASTType &clang_type,
+ const CompilerType &compiler_type,
const ConstString &name,
const lldb::DataBufferSP &data_sp,
lldb::ByteOrder data_byte_order,
@@ -111,7 +111,7 @@ ValueObjectConstResult::Create (ExecutionContextScope *exe_scope,
lldb::addr_t address)
{
return (new ValueObjectConstResult (exe_scope,
- clang_type,
+ compiler_type,
name,
data_sp,
data_byte_order,
@@ -129,7 +129,7 @@ ValueObjectConstResult::Create (ExecutionContextScope *exe_scope,
}
ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope,
- const ClangASTType &clang_type,
+ const CompilerType &compiler_type,
const ConstString &name,
const lldb::DataBufferSP &data_sp,
lldb::ByteOrder data_byte_order,
@@ -145,8 +145,8 @@ ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope
m_data.SetData(data_sp);
m_value.GetScalar() = (uintptr_t)data_sp->GetBytes();
m_value.SetValueType(Value::eValueTypeHostAddress);
- //m_value.SetContext(Value::eContextTypeClangType, clang_type);
- m_value.SetClangType (clang_type);
+ //m_value.SetContext(Value::eContextTypeClangType, compiler_type);
+ m_value.SetCompilerType (compiler_type);
m_name = name;
SetIsConstant ();
SetValueIsValid(true);
@@ -155,14 +155,14 @@ ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope
ValueObjectSP
ValueObjectConstResult::Create (ExecutionContextScope *exe_scope,
- const ClangASTType &clang_type,
+ const CompilerType &compiler_type,
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
uint32_t addr_byte_size)
{
return (new ValueObjectConstResult (exe_scope,
- clang_type,
+ compiler_type,
name,
address,
address_type,
@@ -170,7 +170,7 @@ ValueObjectConstResult::Create (ExecutionContextScope *exe_scope,
}
ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope,
- const ClangASTType &clang_type,
+ const CompilerType &compiler_type,
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
@@ -191,8 +191,8 @@ ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope
case eAddressTypeLoad: m_value.SetValueType(Value::eValueTypeLoadAddress); break;
case eAddressTypeHost: m_value.SetValueType(Value::eValueTypeHostAddress); break;
}
-// m_value.SetContext(Value::eContextTypeClangType, clang_type);
- m_value.SetClangType (clang_type);
+// m_value.SetContext(Value::eContextTypeClangType, compiler_type);
+ m_value.SetCompilerType (compiler_type);
m_name = name;
SetIsConstant ();
SetValueIsValid(true);
@@ -241,10 +241,10 @@ ValueObjectConstResult::~ValueObjectConstResult()
{
}
-ClangASTType
-ValueObjectConstResult::GetClangTypeImpl()
+CompilerType
+ValueObjectConstResult::GetCompilerTypeImpl()
{
- return m_value.GetClangType();
+ return m_value.GetCompilerType();
}
lldb::ValueType
@@ -259,7 +259,7 @@ ValueObjectConstResult::GetByteSize()
ExecutionContext exe_ctx(GetExecutionContextRef());
if (m_byte_size == 0)
- SetByteSize(GetClangType().GetByteSize(exe_ctx.GetBestExecutionContextScope()));
+ SetByteSize(GetCompilerType().GetByteSize(exe_ctx.GetBestExecutionContextScope()));
return m_byte_size;
}
@@ -270,23 +270,24 @@ ValueObjectConstResult::SetByteSize (size_t size)
}
size_t
-ValueObjectConstResult::CalculateNumChildren()
+ValueObjectConstResult::CalculateNumChildren(uint32_t max)
{
- return GetClangType().GetNumChildren (true);
+ auto children_count = GetCompilerType().GetNumChildren (true);
+ return children_count <= max ? children_count : max;
}
ConstString
ValueObjectConstResult::GetTypeName()
{
if (m_type_name.IsEmpty())
- m_type_name = GetClangType().GetConstTypeName ();
+ m_type_name = GetCompilerType().GetConstTypeName ();
return m_type_name;
}
ConstString
ValueObjectConstResult::GetDisplayTypeName()
{
- return GetClangType().GetDisplayTypeName();
+ return GetCompilerType().GetDisplayTypeName();
}
bool
@@ -313,7 +314,7 @@ ValueObjectConstResult::Dereference (Error &error)
}
lldb::ValueObjectSP
-ValueObjectConstResult::GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create)
+ValueObjectConstResult::GetSyntheticChildAtOffset(uint32_t offset, const CompilerType& type, bool can_create)
{
return m_impl.GetSyntheticChildAtOffset(offset, type, can_create);
}
@@ -365,8 +366,16 @@ ValueObjectConstResult::GetDynamicValue (lldb::DynamicValueType use_dynamic)
return ValueObjectSP();
}
+lldb::ValueObjectSP
+ValueObjectConstResult::Cast (const CompilerType &compiler_type)
+{
+ return m_impl.Cast(compiler_type);
+}
+
lldb::LanguageType
ValueObjectConstResult::GetPreferredDisplayLanguage ()
{
- return lldb::eLanguageTypeUnknown;
+ if (m_preferred_display_language != lldb::eLanguageTypeUnknown)
+ return m_preferred_display_language;
+ return GetCompilerTypeImpl().GetMinimumLanguage();
}