Skip to content

Commit 2a5936f

Browse files
committed
[CodeGen] ProcessSDDbgValues - use const-ref value in for-range loop. NFCI.
Avoid unnecessary copies, reported by MSVC static analyzer.
1 parent 5cabe4d commit 2a5936f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ ProcessSDDbgValues(SDNode *N, SelectionDAG *DAG, InstrEmitter &Emitter,
742742
/// Returns true if \p DV has any VReg operand locations which don't exist in
743743
/// VRBaseMap.
744744
auto HasUnknownVReg = [&VRBaseMap](SDDbgValue *DV) {
745-
for (SDDbgOperand L : DV->getLocationOps()) {
745+
for (const SDDbgOperand &L : DV->getLocationOps()) {
746746
if (L.getKind() == SDDbgOperand::SDNODE &&
747747
VRBaseMap.count({L.getSDNode(), L.getResNo()}) == 0)
748748
return true;

0 commit comments

Comments
 (0)