Skip to content

Commit 6752860

Browse files
committed
Mark the other constructor explicit, use emplace_back
1 parent 8400415 commit 6752860

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/include/llvm/CodeGen/MachineTraceMetrics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class MachineTraceMetrics {
162162
/// For regunits: Height of the highest user in the trace.
163163
unsigned Height;
164164

165-
LiveInReg(VirtRegOrUnit VRegOrUnit, unsigned Height = 0)
165+
explicit LiveInReg(VirtRegOrUnit VRegOrUnit, unsigned Height = 0)
166166
: VRegOrUnit(VRegOrUnit), Height(Height) {}
167167
};
168168

llvm/lib/CodeGen/MachineTraceMetrics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ addLiveIns(const MachineInstr *DefMI, unsigned DefOp,
10211021
return;
10221022
TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
10231023
// Just add the register. The height will be updated later.
1024-
TBI.LiveIns.push_back(VirtRegOrUnit(Reg));
1024+
TBI.LiveIns.emplace_back(VirtRegOrUnit(Reg));
10251025
}
10261026
}
10271027

@@ -1170,7 +1170,7 @@ computeInstrHeights(const MachineBasicBlock *MBB) {
11701170

11711171
// Transfer the live regunits to the live-in list.
11721172
for (const LiveRegUnit &RU : RegUnits) {
1173-
TBI.LiveIns.push_back(LiveInReg(VirtRegOrUnit(RU.RegUnit), RU.Cycle));
1173+
TBI.LiveIns.emplace_back(VirtRegOrUnit(RU.RegUnit), RU.Cycle);
11741174
LLVM_DEBUG(dbgs() << ' ' << printRegUnit(RU.RegUnit, MTM.TRI) << '@'
11751175
<< RU.Cycle);
11761176
}

0 commit comments

Comments
 (0)