[PATCH] D17165: Fix cloning of debug info

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 12:45:36 PST 2016


tejohnson added a subscriber: tejohnson.
tejohnson added a comment.

I was looking at this patch in the context of a related debug info cloning patch (http://reviews.llvm.org/D17338). If I understand how this and the CloneDebugInfoMetadata routine works, I think this may have some unintended consequences.

Specifically, CloneDebugInfoMetadata will not only clone the debug info metadata for the old function and place it on the new function, but will also add the cloned subprogram metadata to the list of subprograms hanging off the old module's DICompileUnit via AddOperand. This subprogram list will eventually be cloned to the dest module when named metadata is cloned.

Won't this leave the new cloned subprogram on the old module? Also, not sure what happens when the old subprogram list is mapped into the new module when the named metadata is cloned. Will the new subprogram end up in that list twice (once when mapping the old subprogram and once when mapping the new subprogram which probably uses the identify mapping since it isn't in the value map)?

If my understanding is incorrect, what am I missing?


Repository:
  rL LLVM

http://reviews.llvm.org/D17165





More information about the llvm-commits mailing list