LLDB mainline
lldb_private::FormatterBytecode Namespace Reference

Classes

struct  DataStack

Typedefs

using ControlStackElement = llvm::StringRef
using ControlStack = std::vector<ControlStackElement>
using DataStackElement

Enumerations

enum  DataType : uint8_t {
  Any , String , Int , UInt ,
  Object , Type , Selector , Integer
}
enum  OpCodes : uint8_t
enum  Selectors : uint8_t
enum  Signatures : uint8_t

Functions

llvm::Error Interpret (ControlStack &control, DataStack &data, Signatures sig)
static llvm::Error FormatImpl (DataStack &data)
 Implement the @format function.
static llvm::Error TypeCheck (llvm::ArrayRef< DataStackElement > data, DataType type)
static llvm::Error TypeCheck (llvm::ArrayRef< DataStackElement > data, DataType type1, DataType type2)
static llvm::Error TypeCheck (llvm::ArrayRef< DataStackElement > data, DataType type1, DataType type2, DataType type3)
template<typename T>
static DataStackElement WrapAPSIntResult (T result, unsigned bit_width, bool is_unsigned)
 Wrap the result of a binary operator applied to two APSInts back into a DataStackElement.

Typedef Documentation

◆ ControlStack

◆ ControlStackElement

Definition at line 49 of file FormatterBytecode.h.

◆ DataStackElement

Initial value:
std::variant<std::string, uint64_t, int64_t, lldb::ValueObjectSP,
CompilerType, Selectors, llvm::APSInt>
Generic representation of a type in a programming language.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP

Definition at line 53 of file FormatterBytecode.h.

Enumeration Type Documentation

◆ DataType

Enumerator
Any 
String 
Int 

Deprecated: use Integer.

UInt 

Deprecated: use Integer.

Object 
Type 
Selector 
Integer 

Definition at line 20 of file FormatterBytecode.h.

◆ OpCodes

Definition at line 31 of file FormatterBytecode.h.

◆ Selectors

Definition at line 37 of file FormatterBytecode.h.

◆ Signatures

Definition at line 43 of file FormatterBytecode.h.

Function Documentation

◆ FormatImpl()

llvm::Error lldb_private::FormatterBytecode::FormatImpl ( DataStack & data)
static

◆ Interpret()

◆ TypeCheck() [1/3]

llvm::Error lldb_private::FormatterBytecode::TypeCheck ( llvm::ArrayRef< DataStackElement > data,
DataType type )
static

Definition at line 140 of file FormatterBytecode.cpp.

References Any, Int, Integer, Object, Selector, String, Type, and UInt.

Referenced by TypeCheck(), and TypeCheck().

◆ TypeCheck() [2/3]

llvm::Error lldb_private::FormatterBytecode::TypeCheck ( llvm::ArrayRef< DataStackElement > data,
DataType type1,
DataType type2 )
static

Definition at line 181 of file FormatterBytecode.cpp.

References error(), and TypeCheck().

◆ TypeCheck() [3/3]

llvm::Error lldb_private::FormatterBytecode::TypeCheck ( llvm::ArrayRef< DataStackElement > data,
DataType type1,
DataType type2,
DataType type3 )
static

Definition at line 188 of file FormatterBytecode.cpp.

References error(), and TypeCheck().

◆ WrapAPSIntResult()

template<typename T>
DataStackElement lldb_private::FormatterBytecode::WrapAPSIntResult ( T result,
unsigned bit_width,
bool is_unsigned )
static

Wrap the result of a binary operator applied to two APSInts back into a DataStackElement.

Comparison operators yield bool and need bit_width/ is_unsigned to construct the boolean's APSInt representation; arithmetic operators already yield a correctly-tagged APSInt and ignore them.

Definition at line 200 of file FormatterBytecode.cpp.