================ @@ -0,0 +1,117 @@ +//===-- DILEval.cpp -------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "lldb/ValueObject/DILEval.h" + +#include <memory> + +#include "lldb/ValueObject/DILAST.h" +#include "lldb/ValueObject/ValueObject.h" +#include "llvm/Support/FormatAdapters.h" + +namespace lldb_private { + +namespace dil { + +DILInterpreter::DILInterpreter(lldb::TargetSP target, + std::shared_ptr<std::string> sm) + : m_target(std::move(target)), m_sm(std::move(sm)) { + m_default_dynamic = lldb::eNoDynamicValues; +} + +DILInterpreter::DILInterpreter(lldb::TargetSP target, + std::shared_ptr<std::string> sm, + lldb::DynamicValueType use_dynamic) + : m_target(std::move(target)), m_sm(std::move(sm)), + m_default_dynamic(use_dynamic) {} + +DILInterpreter::DILInterpreter(lldb::TargetSP target, + std::shared_ptr<std::string> sm, + lldb::ValueObjectSP scope) + : m_target(std::move(target)), m_sm(std::move(sm)), + m_scope(std::move(scope)) { + m_default_dynamic = lldb::eNoDynamicValues; + // If `m_scope` is a reference, dereference it. All operations on a reference + // should be operations on the referent. + if (m_scope->GetCompilerType().IsValid() && + m_scope->GetCompilerType().IsReferenceType()) { + Status error; + m_scope = m_scope->Dereference(error); ---------------- cmtice wrote:
Could m_scope->GetCompilerType().IsReferenceType() (the test on the line above) return 'true' if the dereferencing could fail? https://github.com/llvm/llvm-project/pull/120971 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits