[Lldb-commits] [PATCH] D32375: [DWARF] Fix lookup in the abstract origins of inlined blocks/functions
Sean Callanan via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 24 13:57:15 PDT 2017
spyffe added inline comments.
================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:3723-3742
+static DWARFDIE FindAnyChildWithAbstractOrigin(const DWARFDIE &context) {
+ for (DWARFDIE candidate = context.GetFirstChild(); candidate.IsValid();
+ candidate = candidate.GetSibling()) {
+ if (candidate.GetReferencedDIE(DW_AT_abstract_origin)) {
+ return candidate;
+ }
+ }
----------------
jingham wrote:
> The second of these functions seems dangerous since it doesn't check that `block` is contained in `function`. As such, I'm not sure it's worth breaking it out into a separate function rather than inlining it in GetDeclContextForBlock, where that relationship is already known.
I'll put in an `assert()` that `context` is a `DW_TAG_subprogram` or `DW_TAG_inlined_subroutine` iff it is `== function` to make sure people use it right.
Repository:
rL LLVM
https://reviews.llvm.org/D32375
More information about the lldb-commits
mailing list