[Lldb-commits] [lldb] [lldb][DWARFASTParserClang][NFCI] Factor out CV-qualifier/is_static parsing from ParseChildParameters (PR #123951)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 22 08:38:19 PST 2025
================
@@ -159,6 +159,79 @@ static bool TagIsRecordType(dw_tag_t tag) {
}
}
+/// Get the object parameter DIE if one exists, otherwise returns
+/// a default DWARFDIE. If \c containing_decl_ctx is not a valid
+/// C++ declaration context for class methods, assume no object
+/// parameter exists for the given \c subprogram.
+static DWARFDIE
+GetCXXObjectParameter(const DWARFDIE &subprogram,
+ clang::DeclContext const &containing_decl_ctx) {
+ assert(subprogram.Tag() == DW_TAG_subprogram ||
+ subprogram.Tag() == DW_TAG_inlined_subroutine ||
+ subprogram.Tag() == DW_TAG_subroutine_type);
+
+ if (!DeclKindIsCXXClass(containing_decl_ctx.getDeclKind()))
+ return {};
+
+ if (!subprogram.HasChildren())
+ return {};
+
----------------
labath wrote:
```suggestion
```
The code should work even without this.
https://github.com/llvm/llvm-project/pull/123951
More information about the lldb-commits
mailing list