]> granicus.if.org Git - llvm/commit
[Cloning] Take another pass at properly cloning debug info
authorKeno Fischer <keno@alumni.harvard.edu>
Tue, 30 May 2017 18:28:30 +0000 (18:28 +0000)
committerKeno Fischer <keno@alumni.harvard.edu>
Tue, 30 May 2017 18:28:30 +0000 (18:28 +0000)
commite34d6c6de732769fe194a20c7809cdb0564aa485
treecfeb60dccc7871f80bc856a5b239afd52d5de793
parent1f0488cec7a7f4c35ca9338bb663fb04d4225a0d
[Cloning] Take another pass at properly cloning debug info

Summary:
In rL302576, DISubprograms gained the constraint that a !dbg attachments to functions must
have a 1:1 mapping to DISubprograms. As part of that change, the function cloning support
was adjusted to attempt to enforce this invariant during cloning. However, there
were several problems with the implementation. Part of these were fixed in rL304079.
However, there was a more fundamental problem with these changes, namely that it
bypasses the matadata value map, causing the cloned metadata to be a mix of metadata
pointing to the new suprogram (where manual code was added to fix those up) and the
old suprogram (where this was not the case). This mismatch could cause a number of
different assertion failures in the DWARF emitter. Some of these are given at
https://github.com/JuliaLang/julia/issues/22069, but some others have been observed
as well. Attempt to rectify this by partially reverting the manual DI metadata fixup,
and instead using the standard value map approach. To retain the desired semantics
of not duplicating the compilation unit and inlined subprograms, explicitly freeze
these in the value map.

Reviewers: dblaikie, aprantl, GorNishanov, echristo

Reviewed By: aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304226 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DebugLoc.h
include/llvm/Transforms/Utils/Cloning.h
lib/IR/DebugLoc.cpp
lib/Transforms/Coroutines/CoroSplit.cpp
lib/Transforms/Utils/CloneFunction.cpp
unittests/Transforms/Utils/Cloning.cpp