diff options
author | Jie Fu <jiefu@tencent.com> | 2025-06-29 10:21:00 +0800 |
---|---|---|
committer | Jie Fu <jiefu@tencent.com> | 2025-06-29 10:21:00 +0800 |
commit | 25d52fbf96ec927914b3a5c9db0b61fe2804a3dd (patch) | |
tree | 3b6d43c96d4b9fa2a4ef8e61dfcc89956c5a14e7 /llvm | |
parent | 6c2aa37fb1fd3802de1fedb0296f38756a30389b (diff) | |
download | llvm-25d52fbf96ec927914b3a5c9db0b61fe2804a3dd.zip llvm-25d52fbf96ec927914b3a5c9db0b61fe2804a3dd.tar.gz llvm-25d52fbf96ec927914b3a5c9db0b61fe2804a3dd.tar.bz2 |
[PowerPC] Prevent copying in loop variables (NFC)
/data/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp:5769:19: error: loop variable '[Reg, N]' creates a copy from type 'std::pair<unsigned int, llvm::SDValue> const' [-Werror,-Wrange-loop-construct]
for (const auto [Reg, N] : RegsToPass)
^
/data/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp:5769:8: note: use reference type 'std::pair<unsigned int, llvm::SDValue> const &' to prevent copying
for (const auto [Reg, N] : RegsToPass)
^~~~~~~~~~~~~~~~~~~~~
&
/data/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp:6193:19: error: loop variable '[Reg, N]' creates a
copy from type 'std::pair<unsigned int, llvm::SDValue> const' [-Werror,-Wrange-loop-construct]
for (const auto [Reg, N] : RegsToPass) {
^
/data/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp:6193:8: note: use reference type 'std::pair<unsigned int, llvm::SDValue> const &' to prevent copying
for (const auto [Reg, N] : RegsToPass) {
^~~~~~~~~~~~~~~~~~~~~
&
/data/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp:6806:19: error: loop variable '[Reg, N]' creates a copy from type 'std::pair<unsigned int, llvm::SDValue> const' [-Werror,-Wrange-loop-construct]
for (const auto [Reg, N] : RegsToPass) {
^
/data/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp:6806:8: note: use reference type 'std::pair<unsigned int, llvm::SDValue> const &' to prevent copying
for (const auto [Reg, N] : RegsToPass) {
^~~~~~~~~~~~~~~~~~~~~
&
3 errors generated.
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 34500c70..5a4a634 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -5766,7 +5766,7 @@ buildCallOperands(SmallVectorImpl<SDValue> &Ops, // Add argument registers to the end of the list so that they are known live // into the call. - for (const auto [Reg, N] : RegsToPass) + for (const auto &[Reg, N] : RegsToPass) Ops.push_back(DAG.getRegister(Reg, N.getValueType())); // We cannot add R2/X2 as an operand here for PATCHPOINT, because there is @@ -6190,7 +6190,7 @@ SDValue PPCTargetLowering::LowerCall_32SVR4( // Build a sequence of copy-to-reg nodes chained together with token chain // and flag operands which copy the outgoing args into the appropriate regs. SDValue InGlue; - for (const auto [Reg, N] : RegsToPass) { + for (const auto &[Reg, N] : RegsToPass) { Chain = DAG.getCopyToReg(Chain, dl, Reg, N, InGlue); InGlue = Chain.getValue(1); } @@ -6803,7 +6803,7 @@ SDValue PPCTargetLowering::LowerCall_64SVR4( // Build a sequence of copy-to-reg nodes chained together with token chain // and flag operands which copy the outgoing args into the appropriate regs. SDValue InGlue; - for (const auto [Reg, N] : RegsToPass) { + for (const auto &[Reg, N] : RegsToPass) { Chain = DAG.getCopyToReg(Chain, dl, Reg, N, InGlue); InGlue = Chain.getValue(1); } |