================ @@ -1973,6 +1973,27 @@ class DWARFASTParserClang::DelayedAddObjCClassProperty { ClangASTMetadata m_metadata; }; +static clang::APValue MakeAPValue(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; + assert(clang_type.IsFloatingPointType(count, is_complex)); + + if (bit_width == 32) + return clang::APValue(llvm::APFloat(apint.bitsToFloat())); + + return clang::APValue(llvm::APFloat(apint.bitsToDouble())); ---------------- labath wrote:
Any chance this could be something like `return clang::APValue(llvm::APFloat(fltSemantics_I_somehow_got_from_clang_type, apint))` Reason being `float`s and `double`s aren't the only floating point type, so this will likely not work on any of the fancier float types. 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