Skip to content

Commit 5543d9d

Browse files
[RegAlloc][NFC] Use std::move to avoid copy (#134533)
1 parent 7d32d72 commit 5543d9d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

llvm/include/llvm/CodeGen/RegAllocFast.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class RegAllocFastPass : public PassInfoMixin<RegAllocFastPass> {
2222
bool ClearVRegs;
2323
Options(RegAllocFilterFunc F = nullptr, StringRef FN = "all",
2424
bool CV = true)
25-
: Filter(F), FilterName(FN), ClearVRegs(CV) {}
25+
: Filter(std::move(F)), FilterName(FN), ClearVRegs(CV) {}
2626
};
2727

28-
RegAllocFastPass(Options Opts = Options()) : Opts(Opts) {}
28+
RegAllocFastPass(Options Opts = Options()) : Opts(std::move(Opts)) {}
2929

3030
MachineFunctionProperties getRequiredProperties() const {
3131
return MachineFunctionProperties().set(

llvm/include/llvm/CodeGen/RegAllocGreedyPass.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class RAGreedyPass : public PassInfoMixin<RAGreedyPass> {
2121
RegAllocFilterFunc Filter;
2222
StringRef FilterName;
2323
Options(RegAllocFilterFunc F = nullptr, StringRef FN = "all")
24-
: Filter(F), FilterName(FN) {};
24+
: Filter(std::move(F)), FilterName(FN) {};
2525
};
2626

27-
RAGreedyPass(Options Opts = Options()) : Opts(Opts) {}
27+
RAGreedyPass(Options Opts = Options()) : Opts(std::move(Opts)) {}
2828
PreservedAnalyses run(MachineFunction &F, MachineFunctionAnalysisManager &AM);
2929

3030
MachineFunctionProperties getRequiredProperties() const {

llvm/lib/CodeGen/RegAllocGreedy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class RAGreedyLegacy : public MachineFunctionPass {
179179
} // end anonymous namespace
180180

181181
RAGreedyLegacy::RAGreedyLegacy(const RegAllocFilterFunc F)
182-
: MachineFunctionPass(ID), F(F) {
182+
: MachineFunctionPass(ID), F(std::move(F)) {
183183
initializeRAGreedyLegacyPass(*PassRegistry::getPassRegistry());
184184
}
185185

0 commit comments

Comments
 (0)