[llvm] [NFC] Use references to avoid copying (PR #99863)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 05:18:08 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff c3c2370c9a2465f57849861b13c59566b6f26daf 995536d6ce7128799706e9240466b304153de233 --extensions h,cpp -- llvm/include/llvm/CodeGen/MachineInstrBuilder.h llvm/lib/CodeGen/MachineInstr.cpp llvm/lib/CodeGen/RegAllocFast.cpp llvm/lib/CodeGen/WindowScheduler.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
index 6e058da551..49d9402d0c 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -537,10 +537,10 @@ MachineInstr *buildDbgValueForSpill(MachineBasicBlock &BB,
MachineBasicBlock::iterator I,
const MachineInstr &Orig, int FrameIndex,
Register SpillReg);
-MachineInstr *
-buildDbgValueForSpill(MachineBasicBlock &BB, MachineBasicBlock::iterator I,
- const MachineInstr &Orig, int FrameIndex,
- const SmallVectorImpl<const MachineOperand *> &SpilledOperands);
+MachineInstr *buildDbgValueForSpill(
+ MachineBasicBlock &BB, MachineBasicBlock::iterator I,
+ const MachineInstr &Orig, int FrameIndex,
+ const SmallVectorImpl<const MachineOperand *> &SpilledOperands);
/// Update a DBG_VALUE whose value has been spilled to FrameIndex. Useful when
/// modifying an instruction in place while iterating over a basic block.
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 2b3f499105..0f2acdb123 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -2296,9 +2296,9 @@ MachineInstrBuilder llvm::BuildMI(MachineBasicBlock &BB,
/// Compute the new DIExpression to use with a DBG_VALUE for a spill slot.
/// This prepends DW_OP_deref when spilling an indirect DBG_VALUE.
-static const DIExpression *
-computeExprForSpill(const MachineInstr &MI,
- const SmallVectorImpl<const MachineOperand *> &SpilledOperands) {
+static const DIExpression *computeExprForSpill(
+ const MachineInstr &MI,
+ const SmallVectorImpl<const MachineOperand *> &SpilledOperands) {
assert(MI.getDebugVariable()->isValidLocationForIntrinsic(MI.getDebugLoc()) &&
"Expected inlined-at fields to agree");
``````````
</details>
https://github.com/llvm/llvm-project/pull/99863
More information about the llvm-commits
mailing list