================ @@ -1973,6 +1973,30 @@ class DWARFASTParserClang::DelayedAddObjCClassProperty { ClangASTMetadata m_metadata; }; +static std::optional<clang::APValue> MakeAPValue(const clang::ASTContext &ast, + CompilerType clang_type, + uint64_t bit_width, + uint64_t value) { + bool is_signed = false; + const bool is_integral = clang_type.IsIntegerOrEnumerationType(is_signed); + + llvm::APSInt apint(bit_width, !is_signed); + apint = value; + + if (is_integral) + return clang::APValue(apint); + + uint32_t count; + bool is_complex; + // FIXME: we currently support a limited set of floating point types. + // E.g., 16-bit floats are not supported. + if (!clang_type.IsFloatingPointType(count, is_complex)) + return std::nullopt; + + return clang::APValue(llvm::APFloat( + ast.getFloatTypeSemantics(ClangUtil::GetQualType(clang_type)), apint)); ---------------- labath wrote:
:+1: https://github.com/llvm/llvm-project/pull/127206 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits