<div dir="ltr">If anyone's reverting this - note you'll need to revert Gor's changes on top of it (I forget the specific revision for his commit)</div><br><div class="gmail_quote"><div dir="ltr">On Sun, May 28, 2017 at 4:00 PM Keno Fischer via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">loladiro added a comment.<br>
<br>
I'm really confused by the entirety of the changes to the CloneFunction parts of this. The whole point of the ValueMapper is to fix up value/metadata references. Why do we need a manual version? Also what's up with the `DISubprogram::getDistinct`? The ValueMapper will create new distinct  nodes as it goes along unless `RF_MoveDistinctMDs` is set (which it isn't inside CloneFunction). Could the problem perhaps have been an incorrectly unset `ModuleLevelChanges` flag? I'm seeing a ton of assertion failures after this change. I'll submit an appropriate PR to revert the CloneFunction parts of this.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D32975" rel="noreferrer" target="_blank">https://reviews.llvm.org/D32975</a><br>
<br>
<br>
<br>
</blockquote></div>