[Lldb-commits] [lldb] [LLDB] Add unary plus and minus to DIL (PR #155617)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 16 08:54:50 PDT 2025
================
@@ -21,6 +21,104 @@
namespace lldb_private::dil {
+static llvm::Expected<lldb::TypeSystemSP>
+GetTypeSystemFromCU(std::shared_ptr<ExecutionContextScope> ctx) {
+ auto stack_frame = ctx->CalculateStackFrame();
+ if (!stack_frame)
+ return llvm::createStringError("no stack frame in this context");
+ SymbolContext symbol_context =
+ stack_frame->GetSymbolContext(lldb::eSymbolContextCompUnit);
+ lldb::LanguageType language = symbol_context.comp_unit->GetLanguage();
+
+ symbol_context = stack_frame->GetSymbolContext(lldb::eSymbolContextModule);
+ return symbol_context.module_sp->GetTypeSystemForLanguage(language);
+}
+
+static CompilerType GetBasicType(lldb::TypeSystemSP type_system,
+ lldb::BasicType basic_type) {
+ if (type_system)
+ return type_system.get()->GetBasicTypeFromAST(basic_type);
+
+ return CompilerType();
+}
+
+static lldb::ValueObjectSP
+ArrayToPointerConversion(lldb::ValueObjectSP valobj,
+ std::shared_ptr<ExecutionContextScope> ctx) {
+ assert(valobj->IsArrayType() &&
----------------
adrian-prantl wrote:
Yes, the correct thing to do would be to return a ValueObject wrapping an Error, although it might be even nicer to return an Expected<ValueObjectSP>.
https://github.com/llvm/llvm-project/pull/155617
More information about the lldb-commits
mailing list