]> granicus.if.org Git - llvm/commitdiff
Use const DebugLoc&
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 22 Apr 2019 19:14:27 +0000 (19:14 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 22 Apr 2019 19:14:27 +0000 (19:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358910 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BranchRelaxation.cpp

index 3ad6266d4f357cfe7238cadc3885c2d4b13bda4a..15edc98c47f20f6cc09aaf11a58912c85f699e2e 100644 (file)
@@ -300,7 +300,7 @@ bool BranchRelaxation::isBlockInRange(
 /// too far away to fit in its displacement field. It is converted to an inverse
 /// conditional branch + an unconditional branch to the destination.
 bool BranchRelaxation::fixupConditionalBranch(MachineInstr &MI) {
-  DebugLoc DL = MI.getDebugLoc();
+  const DebugLoc &DL = MI.getDebugLoc();
   MachineBasicBlock *MBB = MI.getParent();
   MachineBasicBlock *TBB = nullptr, *FBB = nullptr;
   MachineBasicBlock *NewBB = nullptr;
@@ -468,7 +468,7 @@ bool BranchRelaxation::fixupUnconditionalBranch(MachineInstr &MI) {
     MBB->replaceSuccessor(DestBB, BranchBB);
   }
 
-  DebugLoc DL = MI.getDebugLoc();
+  const DebugLoc &DL = MI.getDebugLoc();
   MI.eraseFromParent();
   BlockInfo[BranchBB->getNumber()].Size += TII->insertIndirectBranch(
     *BranchBB, *DestBB, DL, DestOffset - SrcOffset, RS.get());