Unverified Commit 45f34727 authored by Jonas Devlieghere's avatar Jonas Devlieghere
Browse files

[dsymutil] Avoid invalid keep chains due to pruning

The pruning property that's part of the DIE info is fully computing
during the analyzeContextInfo phase, but can be updated during the
lookForDIEsToKeep phase.

  // Keep a module forward declaration if there is no definition.
  if (!(isODRAttribute(AttrSpec.Attr) && Info.Ctxt &&
        Info.Ctxt->hasCanonicalDIE()))
    Info.Prune = false;

When the pruning property is updated during the lookForDIEsToKeep phase,
it's not propagated to the parent, unlike during the analyzeContextInfo
phase. This can result in an invalid keep chain with the child DIE being
marked as kept while its parent is still marked as pruned and therefore
never kept, a situation that's now caught by 1b79bed8.

This patch fixes this issue by updating the pruning properties of the
parent DIE during the parent walk.

Differential revision: https://reviews.llvm.org/D140930
parent f95108f3
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment