================
@@ -2015,21 +2015,97 @@ static std::optional<clang::APValue> MakeAPValue(const
clang::ASTContext &ast,
return std::nullopt;
bool is_signed = false;
- const bool is_integral = clang_type.IsIntegerOrEnumerationType(is_signed);
+ const bool is_integral = clang_type.IsIntegerOrEnumerationType(is_signed) ||
+ clang_type.IsMemberDataPointerType();
llvm::APSInt apint(*bit_width, !is_signed);
apint = value;
if (is_integral)
return clang::APValue(apint);
+ if (clang_type.IsRealFloatingPointType()) {
+ return clang::APValue(llvm::APFloat(
+ ast.getFloatTypeSemantics(ClangUtil::GetQualType(clang_type)), apint));
+ }
+
// FIXME: we currently support a limited set of floating point types.
// E.g., 16-bit floats are not supported.
- if (!clang_type.IsRealFloatingPointType())
- return std::nullopt;
- return clang::APValue(llvm::APFloat(
- ast.getFloatTypeSemantics(ClangUtil::GetQualType(clang_type)), apint));
+ LLDB_LOG(GetLog(LLDBLog::Types),
+ "MakeAPValue: Unsupported NTTP type class: {0}",
+ clang_type.GetTypeClass());
+
+ lldbassert(false && "Unsupported type for non-type template parameter");
+
+ return std::nullopt;
+}
+
+clang::FieldDecl *DWARFASTParserClang::ResolveMemberDataPointerToFieldDecl(
+ const DWARFDIE &die, uint64_t member_byte_offset) {
+ Log *log = GetLog(DWARFLog::TypeCompletion);
+
+ // die (DW_AT_type) → DW_TAG_ptr_to_member_type
+ DWARFDIE type_die = die.GetReferencedDIE(DW_AT_type);
+ if (!type_die || type_die.Tag() != DW_TAG_ptr_to_member_type) {
----------------
clayborg wrote:
totally fine with changing this to a real `assert` or `llvm_unreachable` as we
check that the clang type is a data member pointer before calling this
function. Just check the code that makes the data member pointer and make sure
that the only DW_TAG that can create one is `DW_TAG_ptr_to_member_type` and
then we are find to assert or use unreachable macros.
https://github.com/llvm/llvm-project/pull/187598
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits