[all-commits] [llvm/llvm-project] 5e3fd4: [Cloning] Fix to cloning DISubprograms.

Amy Huang via All-commits all-commits at lists.llvm.org
Fri Aug 21 11:55:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5e3fd471acb7fb01514b55bd24522da099a7b97c
      https://github.com/llvm/llvm-project/commit/5e3fd471acb7fb01514b55bd24522da099a7b97c
  Author: Amy Huang <akhuang at google.com>
  Date:   2020-08-21 (Fri, 21 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/CloneFunction.cpp
    M llvm/unittests/Transforms/Utils/CloningTest.cpp

  Log Message:
  -----------
  [Cloning] Fix to cloning DISubprograms.

When trying to enable -debug-info-kind=constructor there was an assert
that occurs during debug info cloning ("mismatched subprogram between
llvm.dbg.value variable and !dbg attachment").
It appears that during llvm::CloneFunctionInto, a DISubprogram could be
duplicated when MapMetadata is called, and then added to the MD map again
when DIFinder gets a list of subprograms. This results in two different
versions of the DISubprogram.

This patch switches the order so that the DIFinder subprograms are
added before MapMetadata is called.

Fixes https://bugs.llvm.org/show_bug.cgi?id=46784

Differential Revision: https://reviews.llvm.org/D86185




More information about the All-commits mailing list