[all-commits] [llvm/llvm-project] f95108: [DWARFLinker] Clean up analyzeContextInfo signatur...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Wed Jan 4 15:06:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f95108f38a2dccf32cebd18e8e9ebf8c0b80ca80
      https://github.com/llvm/llvm-project/commit/f95108f38a2dccf32cebd18e8e9ebf8c0b80ca80
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M llvm/lib/DWARFLinker/DWARFLinker.cpp

  Log Message:
  -----------
  [DWARFLinker] Clean up analyzeContextInfo signature (NFC)

 - Remove always-false flag.
 - Remove unused return value.


  Commit: 45f347270caffafe48146c6c7ed8301d91e492ad
      https://github.com/llvm/llvm-project/commit/45f347270caffafe48146c6c7ed8301d91e492ad
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M llvm/lib/DWARFLinker/DWARFLinker.cpp

  Log Message:
  -----------
  [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 1b79bed8f532.

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


Compare: https://github.com/llvm/llvm-project/compare/2a43a4478cb7...45f347270caf


More information about the All-commits mailing list