summaryrefslogtreecommitdiff
path: root/source/Core/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core/Value.cpp')
-rw-r--r--source/Core/Value.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/source/Core/Value.cpp b/source/Core/Value.cpp
index a416d0745a69f..a5c48e823ace7 100644
--- a/source/Core/Value.cpp
+++ b/source/Core/Value.cpp
@@ -18,7 +18,7 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/State.h"
#include "lldb/Core/Stream.h"
-#include "lldb/Symbol/ClangASTType.h"
+#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
@@ -35,7 +35,7 @@ using namespace lldb_private;
Value::Value() :
m_value (),
m_vector (),
- m_clang_type (),
+ m_compiler_type (),
m_context (NULL),
m_value_type (eValueTypeScalar),
m_context_type (eContextTypeInvalid),
@@ -46,7 +46,7 @@ Value::Value() :
Value::Value(const Scalar& scalar) :
m_value (scalar),
m_vector (),
- m_clang_type (),
+ m_compiler_type (),
m_context (NULL),
m_value_type (eValueTypeScalar),
m_context_type (eContextTypeInvalid),
@@ -58,7 +58,7 @@ Value::Value(const Scalar& scalar) :
Value::Value(const void *bytes, int len) :
m_value (),
m_vector (),
- m_clang_type (),
+ m_compiler_type (),
m_context (NULL),
m_value_type (eValueTypeHostAddress),
m_context_type (eContextTypeInvalid),
@@ -70,7 +70,7 @@ Value::Value(const void *bytes, int len) :
Value::Value(const Value &v) :
m_value (v.m_value),
m_vector (v.m_vector),
- m_clang_type (v.m_clang_type),
+ m_compiler_type (v.m_compiler_type),
m_context (v.m_context),
m_value_type (v.m_value_type),
m_context_type (v.m_context_type),
@@ -93,7 +93,7 @@ Value::operator=(const Value &rhs)
{
m_value = rhs.m_value;
m_vector = rhs.m_vector;
- m_clang_type = rhs.m_clang_type;
+ m_compiler_type = rhs.m_compiler_type;
m_context = rhs.m_context;
m_value_type = rhs.m_value_type;
m_context_type = rhs.m_context_type;
@@ -189,7 +189,7 @@ Value::AppendDataToHostBuffer (const Value &rhs)
{
rhs.m_value.GetAsMemoryData (m_data_buffer.GetBytes() + curr_size,
scalar_size,
- lldb::endian::InlHostByteOrder(),
+ endian::InlHostByteOrder(),
error);
return scalar_size;
}
@@ -260,7 +260,7 @@ Value::ValueOf(ExecutionContext *exe_ctx)
}
uint64_t
-Value::GetValueByteSize (Error *error_ptr)
+Value::GetValueByteSize (Error *error_ptr, ExecutionContext *exe_ctx)
{
uint64_t byte_size = 0;
@@ -275,9 +275,9 @@ Value::GetValueByteSize (Error *error_ptr)
case eContextTypeLLDBType: // Type *
case eContextTypeVariable: // Variable *
{
- const ClangASTType &ast_type = GetClangType();
+ const CompilerType &ast_type = GetCompilerType();
if (ast_type.IsValid())
- byte_size = ast_type.GetByteSize(nullptr);
+ byte_size = ast_type.GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr);
}
break;
}
@@ -297,10 +297,10 @@ Value::GetValueByteSize (Error *error_ptr)
return byte_size;
}
-const ClangASTType &
-Value::GetClangType ()
+const CompilerType &
+Value::GetCompilerType ()
{
- if (!m_clang_type.IsValid())
+ if (!m_compiler_type.IsValid())
{
switch (m_context_type)
{
@@ -308,13 +308,13 @@ Value::GetClangType ()
break;
case eContextTypeRegisterInfo:
- break; // TODO: Eventually convert into a clang type?
+ break; // TODO: Eventually convert into a compiler type?
case eContextTypeLLDBType:
{
Type *lldb_type = GetType();
if (lldb_type)
- m_clang_type = lldb_type->GetClangForwardType();
+ m_compiler_type = lldb_type->GetForwardCompilerType ();
}
break;
@@ -325,20 +325,20 @@ Value::GetClangType ()
{
Type *variable_type = variable->GetType();
if (variable_type)
- m_clang_type = variable_type->GetClangForwardType();
+ m_compiler_type = variable_type->GetForwardCompilerType ();
}
}
break;
}
}
- return m_clang_type;
+ return m_compiler_type;
}
void
-Value::SetClangType (const ClangASTType &clang_type)
+Value::SetCompilerType (const CompilerType &compiler_type)
{
- m_clang_type = clang_type;
+ m_compiler_type = compiler_type;
}
lldb::Format
@@ -355,7 +355,7 @@ Value::GetValueDefaultFormat ()
case eContextTypeLLDBType:
case eContextTypeVariable:
{
- const ClangASTType &ast_type = GetClangType();
+ const CompilerType &ast_type = GetCompilerType();
if (ast_type.IsValid())
return ast_type.GetFormat();
}
@@ -407,7 +407,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
lldb::addr_t address = LLDB_INVALID_ADDRESS;
AddressType address_type = eAddressTypeFile;
Address file_so_addr;
- const ClangASTType &ast_type = GetClangType();
+ const CompilerType &ast_type = GetCompilerType();
switch (m_value_type)
{
case eValueTypeVector:
@@ -420,7 +420,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
case eValueTypeScalar:
{
- data.SetByteOrder (lldb::endian::InlHostByteOrder());
+ data.SetByteOrder (endian::InlHostByteOrder());
if (ast_type.IsValid())
data.SetAddressByteSize (ast_type.GetPointerByteSize());
else
@@ -434,7 +434,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
lldb::Encoding type_encoding = ast_type.GetEncoding(type_encoding_count);
if (type_encoding == eEncodingUint || type_encoding == eEncodingSint)
- limit_byte_size = ast_type.GetByteSize(nullptr);
+ limit_byte_size = ast_type.GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr);
}
if (m_value.GetData (data, limit_byte_size))
@@ -623,7 +623,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
}
}
// fallback to host settings
- data.SetByteOrder(lldb::endian::InlHostByteOrder());
+ data.SetByteOrder(endian::InlHostByteOrder());
data.SetAddressByteSize(sizeof(void *));
break;
}
@@ -639,7 +639,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
}
// If we got here, we need to read the value from memory
- size_t byte_size = GetValueByteSize (&error);
+ size_t byte_size = GetValueByteSize (&error, exe_ctx);
// Bail if we encountered any errors getting the byte size
if (error.Fail())
@@ -721,8 +721,8 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
Scalar &
Value::ResolveValue(ExecutionContext *exe_ctx)
{
- const ClangASTType &clang_type = GetClangType();
- if (clang_type.IsValid())
+ const CompilerType &compiler_type = GetCompilerType();
+ if (compiler_type.IsValid())
{
switch (m_value_type)
{
@@ -740,7 +740,7 @@ Value::ResolveValue(ExecutionContext *exe_ctx)
if (error.Success())
{
Scalar scalar;
- if (clang_type.GetValueAsScalar (data, 0, data.GetByteSize(), scalar))
+ if (compiler_type.GetValueAsScalar (data, 0, data.GetByteSize(), scalar))
{
m_value = scalar;
m_value_type = eValueTypeScalar;
@@ -782,7 +782,7 @@ Value::Clear()
{
m_value.Clear();
m_vector.Clear();
- m_clang_type.Clear();
+ m_compiler_type.Clear();
m_value_type = eValueTypeScalar;
m_context = NULL;
m_context_type = eContextTypeInvalid;