|
LLDB mainline
|
Classes | |
| struct | DataStack |
| class | Dictionary |
Typedefs | |
| using | ControlStackElement = llvm::StringRef |
| using | ControlStack = std::vector<ControlStackElement> |
| using | DictionarySP = std::shared_ptr<Dictionary> |
| using | DataStackElement |
| template<typename T> | |
| using | EnableIfSigned |
| template<typename T> | |
| using | EnableIfUnsigned |
Enumerations | |
| enum | DataType : uint8_t { Any , String , Int , UInt , Object , Type , Selector , Integer , Dict } |
| enum | OpCodes : uint8_t |
| enum | Selectors : uint8_t |
| enum | Signatures : uint8_t |
Functions | |
| llvm::Error | Interpret (ControlStack &control, DataStack &data, Signatures sig, uint32_t version) |
Interpret the bytecode on control. | |
| static llvm::Expected< std::string > | SanitizeFormatString (llvm::StringRef fmt) |
| Check a format string, and remove the layout and options of each replacement. | |
| static llvm::Error | FormatImpl (DataStack &data, uint32_t version) |
| 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) |
| static llvm::Error | TypeCheck (llvm::ArrayRef< DataStackElement > data, DataType type1, DataType type2, DataType type3, DataType type4) |
| 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. | |
| static bool | Reaches (const Dictionary *from, const Dictionary *target) |
| Returns true if target is transitively reachable via from. | |
| template<typename T, EnableIfSigned< T > = 0> | |
| static DataStackElement | MakeInt (T value, uint32_t version) |
| template<typename T, EnableIfUnsigned< T > = 0> | |
| static DataStackElement | MakeInt (T value, uint32_t version) |
| using lldb_private::FormatterBytecode::ControlStack = std::vector<ControlStackElement> |
Definition at line 55 of file FormatterBytecode.h.
| using lldb_private::FormatterBytecode::ControlStackElement = llvm::StringRef |
Definition at line 54 of file FormatterBytecode.h.
Definition at line 68 of file FormatterBytecode.h.
| using lldb_private::FormatterBytecode::DictionarySP = std::shared_ptr<Dictionary> |
Definition at line 64 of file FormatterBytecode.h.
| using lldb_private::FormatterBytecode::EnableIfSigned |
Definition at line 309 of file FormatterBytecode.cpp.
| using lldb_private::FormatterBytecode::EnableIfUnsigned |
Definition at line 312 of file FormatterBytecode.cpp.
| enum lldb_private::FormatterBytecode::DataType : uint8_t |
| Enumerator | |
|---|---|
| Any | |
| String | |
| Int | Deprecated: use Integer. |
| UInt | Deprecated: use Integer. |
| Object | |
| Type | |
| Selector | |
| Integer | |
| Dict | |
Definition at line 22 of file FormatterBytecode.h.
| enum lldb_private::FormatterBytecode::OpCodes : uint8_t |
Definition at line 36 of file FormatterBytecode.h.
| enum lldb_private::FormatterBytecode::Selectors : uint8_t |
Definition at line 42 of file FormatterBytecode.h.
| enum lldb_private::FormatterBytecode::Signatures : uint8_t |
Definition at line 48 of file FormatterBytecode.h.
|
static |
Implement the @format function.
Definition at line 148 of file FormatterBytecode.cpp.
References lldb_private::Align(), lldb_private::FormatterBytecode::DataStack::Pop(), lldb_private::FormatterBytecode::DataStack::Push(), SanitizeFormatString(), and lldb_private::toString().
Referenced by Interpret().
| llvm::Error lldb_private::FormatterBytecode::Interpret | ( | ControlStack & | control, |
| DataStack & | data, | ||
| Signatures | sig, | ||
| uint32_t | version ) |
Interpret the bytecode on control.
version is the version of the record the bytecode was loaded from, which determines the types used by selectors.
Activate the top most block from the control stack.
Fetch the next byte in the instruction stream.
Definition at line 332 of file FormatterBytecode.cpp.
References Any, BINOP, BINOP_CHECKZERO, BITOP, lldb_private::bits(), CMPOP, lldb_private::DataFormatters, Dict, error(), FormatImpl(), lldb_private::GetLog(), Int, Integer, LLDB_LOG_VERBOSE, MakeInt(), Object, pc, lldb_private::FormatterBytecode::DataStack::Pop(), POP_VALOBJ, lldb_private::FormatterBytecode::DataStack::PopAny(), lldb_private::FormatterBytecode::DataStack::Push(), Reaches(), Selector, SHIFTOP, String, lldb_private::toString(), Type, TYPE_CHECK, UInt, and UINT32_MAX.
Referenced by lldb_private::BytecodeSyntheticChildren::FrontEnd::CalculateNumChildren(), lldb_private::BytecodeSummaryFormat::FormatObject(), lldb_private::BytecodeSyntheticChildren::FrontEnd::GetChildAtIndex(), lldb_private::BytecodeSyntheticChildren::FrontEnd::GetIndexOfChildWithName(), and lldb_private::BytecodeSyntheticChildren::FrontEnd::Update().
|
static |
Definition at line 318 of file FormatterBytecode.cpp.
Referenced by Interpret().
|
static |
Definition at line 325 of file FormatterBytecode.cpp.
|
static |
Returns true if target is transitively reachable via from.
Likewise, returns true if they are the same dictionary. This is used to prevent memory leaks caused by retain cycles. Dictionaries can be shared by multiple parents, so each one is visited only once to prevent exponential running time.
Definition at line 292 of file FormatterBytecode.cpp.
Referenced by Interpret().
|
static |
Check a format string, and remove the layout and options of each replacement.
The format string may contain literal text, escaped braces ("{{"), and automatically indexed replacements:
"{" [ "," layout ] [ ":" options ] "}"
Explicit indexes are not supported. Layouts and options are accepted, so that support for them can be added without changing the ABI, but they are currently ignored. The result contains only literal text, escaped braces, and "{}", so malformed format strings never reach formatv.
Definition at line 110 of file FormatterBytecode.cpp.
References lldb_private::DataFormatters, lldb_private::GetLog(), and LLDB_LOG.
Referenced by FormatImpl().
|
static |
Definition at line 206 of file FormatterBytecode.cpp.
References Any, Dict, Int, Integer, Object, Selector, String, Type, and UInt.
Referenced by TypeCheck(), TypeCheck(), and TypeCheck().
|
static |
Definition at line 252 of file FormatterBytecode.cpp.
References error(), and TypeCheck().
|
static |
Definition at line 259 of file FormatterBytecode.cpp.
References error(), and TypeCheck().
|
static |
Definition at line 266 of file FormatterBytecode.cpp.
References error(), and TypeCheck().
|
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 279 of file FormatterBytecode.cpp.