[llvm] 0f83456 - [CodeGen] SDDbgValue::getSDNodes() - use const-ref to avoid unnecessary copies. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 21 05:01:33 PDT 2021
Author: Simon Pilgrim
Date: 2021-09-21T13:01:08+01:00
New Revision: 0f83456cf5bfaa731f9d5aa2500a5f10dd9de1b7
URL: https://github.com/llvm/llvm-project/commit/0f83456cf5bfaa731f9d5aa2500a5f10dd9de1b7
DIFF: https://github.com/llvm/llvm-project/commit/0f83456cf5bfaa731f9d5aa2500a5f10dd9de1b7.diff
LOG: [CodeGen] SDDbgValue::getSDNodes() - use const-ref to avoid unnecessary copies. NFCI.
Reported by MSVC static analyzer.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h b/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h
index 75b4242a415c4..f64b332a7feff 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h
+++ b/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h
@@ -192,7 +192,7 @@ class SDDbgValue {
// Returns the SDNodes which this SDDbgValue depends on.
SmallVector<SDNode *> getSDNodes() const {
SmallVector<SDNode *> Dependencies;
- for (SDDbgOperand DbgOp : getLocationOps())
+ for (const SDDbgOperand &DbgOp : getLocationOps())
if (DbgOp.getKind() == SDDbgOperand::SDNODE)
Dependencies.push_back(DbgOp.getSDNode());
for (SDNode *Node : getAdditionalDependencies())
More information about the llvm-commits
mailing list