LLDB mainline
Classes | Namespaces | Functions
VectorType.cpp File Reference
#include "lldb/DataFormatters/VectorType.h"
#include "lldb/DataFormatters/FormattersHelpers.h"
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Target/Target.h"
#include "lldb/ValueObject/ValueObject.h"
#include "lldb/ValueObject/ValueObjectConstResult.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/Log.h"
#include <optional>

Go to the source code of this file.

Classes

class  lldb_private::formatters::VectorTypeSyntheticFrontEnd
 

Namespaces

namespace  lldb_private
 A class that represents a running process on the host machine.
 
namespace  lldb_private::formatters
 

Functions

static CompilerType GetCompilerTypeForFormat (lldb::Format format, CompilerType element_type, TypeSystemSP type_system)
 
static lldb::Format GetItemFormatForFormat (lldb::Format format, CompilerType element_type)
 
static std::optional< size_t > CalculateNumChildren (CompilerType container_elem_type, uint64_t num_elements, CompilerType element_type)
 Calculates the number of elements stored in a container (with element type 'container_elem_type') as if it had elements of type 'element_type'.
 

Function Documentation

◆ CalculateNumChildren()

static std::optional< size_t > CalculateNumChildren ( CompilerType  container_elem_type,
uint64_t  num_elements,
CompilerType  element_type 
)
static

Calculates the number of elements stored in a container (with element type 'container_elem_type') as if it had elements of type 'element_type'.

For example, a container of type uint8_t __attribute__((vector_size(16))) has 16 elements. But calling CalculateNumChildren with an 'element_type' of float (4-bytes) will return 4 because we are interpreting the byte-array as a float32[].

Parameters
[in]container_elem_typeThe type of the elements stored in the container we are calculating the children of.
[in]num_elementsNumber of 'container_elem_type's our container stores.
[in]element_typeThe type of elements we interpret container_type to contain for the purposes of calculating the number of children.
Returns
The number of elements stored in a container of type 'element_type'. Returns a std::nullopt if the size of the container is not a multiple of 'element_type' or if an error occurs.

Definition at line 198 of file VectorType.cpp.

References lldb_private::CompilerType::GetByteSize().

◆ GetCompilerTypeForFormat()

static CompilerType GetCompilerTypeForFormat ( lldb::Format  format,
CompilerType  element_type,
TypeSystemSP  type_system 
)
static

◆ GetItemFormatForFormat()

static lldb::Format GetItemFormatForFormat ( lldb::Format  format,
CompilerType  element_type 
)
static