================
@@ -251,3 +253,122 @@ std::string ScriptedSyntheticChildren::GetDescription() {
return std::string(sstr.GetString());
}
+
+BytecodeSyntheticChildren::FrontEnd::FrontEnd(
+ ValueObject &backend,
+ FormatterBytecode::SyntheticProviderDefinition &definition)
+ : SyntheticChildrenFrontEnd(backend), m_definition(definition) {
+ FormatterBytecode::DataStack data(backend.GetSP());
+ if (!m_definition.init) {
+ m_self = std::move(data);
+ return;
+ }
+
+ FormatterBytecode::ControlStack control = {m_definition.init->getBuffer()};
+ auto error =
+ FormatterBytecode::Interpret(control, data, FormatterBytecode::sig_init);
+
+ if (!error && data.size() > 0)
+ m_self = std::move(data);
+}
+
+lldb::ChildCacheState BytecodeSyntheticChildren::FrontEnd::Update() {
+ if (!m_definition.update)
+ return ChildCacheState::eRefetch;
+
+ FormatterBytecode::ControlStack control = {m_definition.update->getBuffer()};
+ FormatterBytecode::DataStack data = m_self;
+ auto error = FormatterBytecode::Interpret(control, data,
----------------
adrian-prantl wrote:
Technically the LLVM style only allows if the type is obvious from the context,
so it might be better to spell it out here. (I was just asking myself if this
is an llvm::Error and if it needs to be consumed?)
https://github.com/llvm/llvm-project/pull/179832
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits