<div dir="ltr"><div dir="ltr"></div>Sorry, had to revert this in r358940.<div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 22, 2019 at 12:12 PM Matt Arsenault via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: arsenm<br>
Date: Mon Apr 22 12:14:27 2019<br>
New Revision: 358910<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=358910&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=358910&view=rev</a><br>
Log:<br>
Use const DebugLoc&<br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/BranchRelaxation.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/BranchRelaxation.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchRelaxation.cpp?rev=358910&r1=358909&r2=358910&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchRelaxation.cpp?rev=358910&r1=358909&r2=358910&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/BranchRelaxation.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/BranchRelaxation.cpp Mon Apr 22 12:14:27 2019<br>
@@ -300,7 +300,7 @@ bool BranchRelaxation::isBlockInRange(<br>
 /// too far away to fit in its displacement field. It is converted to an inverse<br>
 /// conditional branch + an unconditional branch to the destination.<br>
 bool BranchRelaxation::fixupConditionalBranch(MachineInstr &MI) {<br>
-  DebugLoc DL = MI.getDebugLoc();<br>
+  const DebugLoc &DL = MI.getDebugLoc();<br></blockquote><div><br></div><div>See my commit log in the revert -- these copies are in fact necessary to avoid the debug location's metadata going away prior to its use.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
   MachineBasicBlock *MBB = MI.getParent();<br>
   MachineBasicBlock *TBB = nullptr, *FBB = nullptr;<br>
   MachineBasicBlock *NewBB = nullptr;<br>
@@ -468,7 +468,7 @@ bool BranchRelaxation::fixupUnconditiona<br>
     MBB->replaceSuccessor(DestBB, BranchBB);<br>
   }<br>
<br>
-  DebugLoc DL = MI.getDebugLoc();<br>
+  const DebugLoc &DL = MI.getDebugLoc();<br>
   MI.eraseFromParent();<br>
   BlockInfo[BranchBB->getNumber()].Size += TII->insertIndirectBranch(<br>
     *BranchBB, *DestBB, DL, DestOffset - SrcOffset, RS.get());<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div></div>