LLDB mainline
lldb_private::dil::Interpreter Class Reference

#include <DILEval.h>

Inheritance diagram for lldb_private::dil::Interpreter:
[legend]

Public Member Functions

 Interpreter (lldb::TargetSP target, llvm::StringRef expr, std::shared_ptr< StackFrame > frame_sp, lldb::DynamicValueType use_dynamic, bool use_synthetic, bool fragile_ivar, bool check_ptr_vs_member)
llvm::Expected< lldb::ValueObjectSPEvaluate (const ASTNode &node)
 Evaluate an ASTNode.

Private Member Functions

llvm::Expected< lldb::ValueObjectSPEvaluateAndDereference (const ASTNode &node)
 Evaluate an ASTNode.
llvm::Expected< lldb::ValueObjectSPVisit (const IdentifierNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const MemberOfNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const UnaryOpNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const BinaryOpNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const ArraySubscriptNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const BitFieldExtractionNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const IntegerLiteralNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const FloatLiteralNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const BooleanLiteralNode &node) override
llvm::Expected< lldb::ValueObjectSPVisit (const CastNode &node) override
llvm::Expected< lldb::ValueObjectSPUnaryConversion (lldb::ValueObjectSP valobj, uint32_t location)
 Perform usual unary conversions on a value.
llvm::Expected< CompilerTypePromoteSignedInteger (CompilerType &lhs_type, CompilerType &rhs_type)
 If lhs_type is unsigned and rhs_type is signed, check whether it can represent all of the values of lhs_type.
llvm::Expected< CompilerTypeArithmeticConversion (lldb::ValueObjectSP &lhs, lldb::ValueObjectSP &rhs, uint32_t location)
 Perform an arithmetic conversion on two values from an arithmetic operation.
llvm::Expected< lldb::ValueObjectSPEvaluateScalarOp (BinaryOpKind kind, lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, CompilerType result_type, uint32_t location)
llvm::Expected< lldb::ValueObjectSPEvaluateBinaryAddition (lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
llvm::Expected< lldb::ValueObjectSPEvaluateBinarySubtraction (lldb::ValueObjectSP lhs, lldb::ValueObjectSP rhs, uint32_t location)
llvm::Expected< CompilerTypePickIntegerType (lldb::TypeSystemSP type_system, std::shared_ptr< ExecutionContextScope > ctx, const IntegerLiteralNode &literal)
llvm::Expected< CastKindVerifyArithmeticCast (CompilerType source_type, CompilerType target_type, int location)
 A helper function for VerifyCastType (below).
llvm::Expected< CastKindVerifyCastType (lldb::ValueObjectSP operand, CompilerType source_type, CompilerType target_type, int location)
 As a preparation for type casting, compare the requested 'target' type of the cast with the type of the operand to be cast.
Private Member Functions inherited from lldb_private::dil::Visitor
virtual ~Visitor ()=default

Private Attributes

lldb::TargetSP m_target
llvm::StringRef m_expr
lldb::ValueObjectSP m_scope
std::shared_ptr< StackFramem_exe_ctx_scope
lldb::DynamicValueType m_use_dynamic
bool m_use_synthetic
bool m_fragile_ivar
bool m_check_ptr_vs_member

Detailed Description

Definition at line 39 of file DILEval.h.

Constructor & Destructor Documentation

◆ Interpreter()

lldb_private::dil::Interpreter::Interpreter ( lldb::TargetSP target,
llvm::StringRef expr,
std::shared_ptr< StackFrame > frame_sp,
lldb::DynamicValueType use_dynamic,
bool use_synthetic,
bool fragile_ivar,
bool check_ptr_vs_member )

Member Function Documentation

◆ ArithmeticConversion()

llvm::Expected< CompilerType > lldb_private::dil::Interpreter::ArithmeticConversion ( lldb::ValueObjectSP & lhs,
lldb::ValueObjectSP & rhs,
uint32_t location )
private

Perform an arithmetic conversion on two values from an arithmetic operation.

Returns
The result type of an arithmetic operation.

Definition at line 219 of file DILEval.cpp.

References lldb_private::CompilerType::CompareTypes(), lldb_private::dil::ConversionRank(), lldb_private::CompilerType::IsInteger(), lldb_private::CompilerType::IsScalarType(), lldb_private::CompilerType::IsSigned(), m_expr, PromoteSignedInteger(), and UnaryConversion().

Referenced by EvaluateBinaryAddition(), and EvaluateBinarySubtraction().

◆ Evaluate()

llvm::Expected< lldb::ValueObjectSP > lldb_private::dil::Interpreter::Evaluate ( const ASTNode & node)

◆ EvaluateAndDereference()

llvm::Expected< lldb::ValueObjectSP > lldb_private::dil::Interpreter::EvaluateAndDereference ( const ASTNode & node)
private

Evaluate an ASTNode.

If the result is a reference, it is also dereferenced using ValueObject::Dereference.

Returns
A non-null lldb::ValueObjectSP or an Error.

Definition at line 411 of file DILEval.cpp.

References error(), and Evaluate().

Referenced by Visit(), Visit(), and Visit().

◆ EvaluateBinaryAddition()

llvm::Expected< lldb::ValueObjectSP > lldb_private::dil::Interpreter::EvaluateBinaryAddition ( lldb::ValueObjectSP lhs,
lldb::ValueObjectSP rhs,
uint32_t location )
private

◆ EvaluateBinarySubtraction()

llvm::Expected< lldb::ValueObjectSP > lldb_private::dil::Interpreter::EvaluateBinarySubtraction ( lldb::ValueObjectSP lhs,
lldb::ValueObjectSP rhs,
uint32_t location )
private

◆ EvaluateScalarOp()

llvm::Expected< lldb::ValueObjectSP > lldb_private::dil::Interpreter::EvaluateScalarOp ( BinaryOpKind kind,
lldb::ValueObjectSP lhs,
lldb::ValueObjectSP rhs,
CompilerType result_type,
uint32_t location )
private

◆ PickIntegerType()

◆ PromoteSignedInteger()

llvm::Expected< CompilerType > lldb_private::dil::Interpreter::PromoteSignedInteger ( CompilerType & lhs_type,
CompilerType & rhs_type )
private

If lhs_type is unsigned and rhs_type is signed, check whether it can represent all of the values of lhs_type.

If not, then promote rhs_type to the unsigned version of its type. This expects that Rank(lhs_type) < Rank(rhs_type).

Returns
Unchanged rhs_type or promoted unsigned version.

Definition at line 190 of file DILEval.cpp.

References lldb_private::dil::BasicTypeToUnsigned(), lldb_private::dil::GetBasicType(), lldb_private::CompilerType::GetBasicTypeEnumeration(), lldb_private::CompilerType::GetBitSize(), lldb_private::CompilerType::GetCanonicalType(), lldb_private::dil::GetTypeSystemFromCU(), lldb_private::CompilerType::IsInteger(), lldb_private::CompilerType::IsSigned(), and m_exe_ctx_scope.

Referenced by ArithmeticConversion().

◆ UnaryConversion()

llvm::Expected< lldb::ValueObjectSP > lldb_private::dil::Interpreter::UnaryConversion ( lldb::ValueObjectSP valobj,
uint32_t location )
private

◆ VerifyArithmeticCast()

llvm::Expected< CastKind > lldb_private::dil::Interpreter::VerifyArithmeticCast ( CompilerType source_type,
CompilerType target_type,
int location )
private

◆ VerifyCastType()

llvm::Expected< CastKind > lldb_private::dil::Interpreter::VerifyCastType ( lldb::ValueObjectSP operand,
CompilerType source_type,
CompilerType target_type,
int location )
private

As a preparation for type casting, compare the requested 'target' type of the cast with the type of the operand to be cast.

If the cast is allowed, return the appropriate CastKind for the cast; otherwise return an error.

Definition at line 1109 of file DILEval.cpp.

References lldb_private::dil::eEnumeration, lldb_private::dil::ePointer, lldb_private::CompilerType::IsArrayType(), lldb_private::CompilerType::IsEnumerationType(), lldb_private::CompilerType::IsInteger(), lldb_private::CompilerType::IsNullPtrType(), lldb_private::CompilerType::IsPointerType(), lldb_private::CompilerType::IsScalarType(), m_expr, lldb_private::CompilerType::TypeDescription(), and VerifyArithmeticCast().

Referenced by Visit().

◆ Visit() [1/10]

◆ Visit() [2/10]

◆ Visit() [3/10]

◆ Visit() [4/10]

llvm::Expected< lldb::ValueObjectSP > lldb_private::dil::Interpreter::Visit ( const BooleanLiteralNode & node)
overrideprivatevirtual

◆ Visit() [5/10]

◆ Visit() [6/10]

◆ Visit() [7/10]

◆ Visit() [8/10]

◆ Visit() [9/10]

◆ Visit() [10/10]

Member Data Documentation

◆ m_check_ptr_vs_member

bool lldb_private::dil::Interpreter::m_check_ptr_vs_member
private

Definition at line 132 of file DILEval.h.

Referenced by Interpreter(), and Visit().

◆ m_exe_ctx_scope

std::shared_ptr<StackFrame> lldb_private::dil::Interpreter::m_exe_ctx_scope
private

◆ m_expr

◆ m_fragile_ivar

bool lldb_private::dil::Interpreter::m_fragile_ivar
private

Definition at line 131 of file DILEval.h.

Referenced by Interpreter(), and Visit().

◆ m_scope

lldb::ValueObjectSP lldb_private::dil::Interpreter::m_scope
private

Definition at line 127 of file DILEval.h.

◆ m_target

lldb::TargetSP lldb_private::dil::Interpreter::m_target
private

◆ m_use_dynamic

lldb::DynamicValueType lldb_private::dil::Interpreter::m_use_dynamic
private

Definition at line 129 of file DILEval.h.

Referenced by Interpreter(), Visit(), Visit(), Visit(), and Visit().

◆ m_use_synthetic

bool lldb_private::dil::Interpreter::m_use_synthetic
private

Definition at line 130 of file DILEval.h.

Referenced by Interpreter(), Visit(), Visit(), and Visit().


The documentation for this class was generated from the following files: