LLDB mainline
lldb_private::dil Namespace Reference

Classes

class  ArraySubscriptNode
class  ASTNode
 The rest of the classes in this file, except for the Visitor class at the very end, define all the types of AST nodes used by the DIL parser and expression evaluator. More...
class  BitFieldExtractionNode
class  BooleanLiteralNode
class  DILDiagnosticError
class  DILLexer
 Class for doing the simple lexing required by DIL. More...
class  DILParser
 Pure recursive descent parser for C++ like expressions. More...
class  ErrorNode
class  FloatLiteralNode
class  IdentifierNode
class  IntegerLiteralNode
class  Interpreter
class  MemberOfNode
class  Token
 Class defining the tokens generated by the DIL lexer and used by the DIL parser. More...
class  UnaryOpNode
class  Visitor
 This class contains one Visit method for each specialized type of DIL AST node. More...

Typedefs

using ASTNodeUP = std::unique_ptr<ASTNode>

Enumerations

enum class  NodeKind {
  eArraySubscriptNode , eBitExtractionNode , eBooleanLiteralNode , eErrorNode ,
  eFloatLiteralNode , eIdentifierNode , eIntegerLiteralNode , eMemberOfNode ,
  eUnaryOpNode
}
 The various types DIL AST nodes (used by the DIL parser). More...
enum class  UnaryOpKind { AddrOf , Deref }
 The Unary operators recognized by DIL. More...
enum class  IntegerTypeSuffix { None , Long , LongLong }
enum class  ErrorCode : unsigned char { kOk = 0 , kInvalidExpressionSyntax , kUndeclaredIdentifier , kUnknown }

Functions

lldb::ValueObjectSP LookupIdentifier (llvm::StringRef name_ref, std::shared_ptr< StackFrame > frame_sp, lldb::DynamicValueType use_dynamic)
 Given the name of an identifier (variable name, member name, type name, etc.), find the ValueObject for that name (if it exists), excluding global variables, and create and return an IdentifierInfo object containing all the relevant information about that object (for DIL parsing and evaluating).
lldb::ValueObjectSP LookupGlobalIdentifier (llvm::StringRef name_ref, std::shared_ptr< StackFrame > frame_sp, lldb::TargetSP target_sp, lldb::DynamicValueType use_dynamic)
 Given the name of an identifier, check to see if it matches the name of a global variable.
static lldb::VariableSP DILFindVariable (ConstString name, VariableList &variable_list)
static llvm::Expected< lldb::TypeSystemSPGetTypeSystemFromCU (std::shared_ptr< StackFrame > ctx)
static CompilerType GetBasicType (lldb::TypeSystemSP type_system, lldb::BasicType basic_type)
static bool IsLetter (char c)
static bool IsDigit (char c)
static std::optional< llvm::StringRef > IsWord (llvm::StringRef expr, llvm::StringRef &remainder)
static bool IsNumberBodyChar (char ch)
static std::optional< llvm::StringRef > IsNumber (llvm::StringRef &remainder, bool &isFloat)

Typedef Documentation

◆ ASTNodeUP

using lldb_private::dil::ASTNodeUP = std::unique_ptr<ASTNode>

Definition at line 68 of file DILAST.h.

Enumeration Type Documentation

◆ ErrorCode

enum class lldb_private::dil::ErrorCode : unsigned char
strong
Enumerator
kOk 
kInvalidExpressionSyntax 
kUndeclaredIdentifier 
kUnknown 

Definition at line 27 of file DILParser.h.

◆ IntegerTypeSuffix

Enumerator
None 
Long 
LongLong 

Definition at line 184 of file DILAST.h.

◆ NodeKind

enum class lldb_private::dil::NodeKind
strong

The various types DIL AST nodes (used by the DIL parser).

Enumerator
eArraySubscriptNode 
eBitExtractionNode 
eBooleanLiteralNode 
eErrorNode 
eFloatLiteralNode 
eIdentifierNode 
eIntegerLiteralNode 
eMemberOfNode 
eUnaryOpNode 

Definition at line 20 of file DILAST.h.

◆ UnaryOpKind

enum class lldb_private::dil::UnaryOpKind
strong

The Unary operators recognized by DIL.

Enumerator
AddrOf 
Deref 

Definition at line 33 of file DILAST.h.

Function Documentation

◆ DILFindVariable()

lldb::VariableSP lldb_private::dil::DILFindVariable ( ConstString name,
VariableList & variable_list )
static

Definition at line 24 of file DILEval.cpp.

References lldb_private::ConstString::GetStringRef().

Referenced by LookupGlobalIdentifier().

◆ GetBasicType()

CompilerType lldb_private::dil::GetBasicType ( lldb::TypeSystemSP type_system,
lldb::BasicType basic_type )
static

◆ GetTypeSystemFromCU()

llvm::Expected< lldb::TypeSystemSP > lldb_private::dil::GetTypeSystemFromCU ( std::shared_ptr< StackFrame > ctx)
static

◆ IsDigit()

bool lldb_private::dil::IsDigit ( char c)
static

Definition at line 65 of file DILLexer.cpp.

Referenced by IsNumber(), IsNumberBodyChar(), and IsWord().

◆ IsLetter()

bool lldb_private::dil::IsLetter ( char c)
static

Definition at line 61 of file DILLexer.cpp.

Referenced by IsNumberBodyChar(), and IsWord().

◆ IsNumber()

std::optional< llvm::StringRef > lldb_private::dil::IsNumber ( llvm::StringRef & remainder,
bool & isFloat )
static

Definition at line 85 of file DILLexer.cpp.

References IsDigit(), and IsNumberBodyChar().

Referenced by lldb_private::dil::DILLexer::Lex().

◆ IsNumberBodyChar()

bool lldb_private::dil::IsNumberBodyChar ( char ch)
static

Definition at line 81 of file DILLexer.cpp.

References IsDigit(), and IsLetter().

Referenced by IsNumber().

◆ IsWord()

std::optional< llvm::StringRef > lldb_private::dil::IsWord ( llvm::StringRef expr,
llvm::StringRef & remainder )
static

Definition at line 69 of file DILLexer.cpp.

References IsDigit(), and IsLetter().

Referenced by lldb_private::dil::DILLexer::Lex().

◆ LookupGlobalIdentifier()

lldb::ValueObjectSP lldb_private::dil::LookupGlobalIdentifier ( llvm::StringRef name_ref,
std::shared_ptr< StackFrame > frame_sp,
lldb::TargetSP target_sp,
lldb::DynamicValueType use_dynamic )

Given the name of an identifier, check to see if it matches the name of a global variable.

If so, find the ValueObject for that global variable, and create and return an IdentifierInfo object containing all the relevant informatin about it.

Definition at line 49 of file DILEval.cpp.

References lldb_private::SymbolContext::comp_unit, lldb_private::ValueObjectVariable::Create(), DILFindVariable(), lldb_private::VariableList::Empty(), and lldb_private::CompileUnit::GetVariableList().

Referenced by lldb_private::dil::Interpreter::Visit().

◆ LookupIdentifier()

lldb::ValueObjectSP lldb_private::dil::LookupIdentifier ( llvm::StringRef name_ref,
std::shared_ptr< StackFrame > frame_sp,
lldb::DynamicValueType use_dynamic )

Given the name of an identifier (variable name, member name, type name, etc.), find the ValueObject for that name (if it exists), excluding global variables, and create and return an IdentifierInfo object containing all the relevant information about that object (for DIL parsing and evaluating).

Definition at line 90 of file DILEval.cpp.

References lldb_private::ValueObjectRegister::Create(), and lldb_private::SymbolContext::GetInstanceVariableName().

Referenced by lldb_private::dil::Interpreter::Visit().