Skip to content

Commit 470bcce

Browse files
committed
Change analysis params to refs
1 parent 679194b commit 470bcce

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

llvm/include/llvm/CodeGen/LiveRegMatrix.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,9 @@ class LiveRegMatrix {
6767
: TRI(Other.TRI), LIS(Other.LIS), VRM(Other.VRM), UserTag(Other.UserTag),
6868
Matrix(std::move(Other.Matrix)), Queries(std::move(Other.Queries)),
6969
RegMaskTag(Other.RegMaskTag), RegMaskVirtReg(Other.RegMaskVirtReg),
70-
RegMaskUsable(std::move(Other.RegMaskUsable)) {
71-
Other.TRI = nullptr;
72-
Other.LIS = nullptr;
73-
Other.VRM = nullptr;
74-
}
70+
RegMaskUsable(std::move(Other.RegMaskUsable)) {}
7571

76-
void init(MachineFunction &MF, LiveIntervals *LIS, VirtRegMap *VRM);
72+
void init(MachineFunction &MF, LiveIntervals &LIS, VirtRegMap &VRM);
7773

7874
//===--------------------------------------------------------------------===//
7975
// High-level interface.

llvm/lib/CodeGen/LiveRegMatrix.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ void LiveRegMatrixWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
5151
}
5252

5353
bool LiveRegMatrixWrapperPass::runOnMachineFunction(MachineFunction &MF) {
54-
auto *LIS = &getAnalysis<LiveIntervalsWrapperPass>().getLIS();
55-
auto *VRM = &getAnalysis<VirtRegMapWrapperPass>().getVRM();
54+
auto &LIS = getAnalysis<LiveIntervalsWrapperPass>().getLIS();
55+
auto &VRM = getAnalysis<VirtRegMapWrapperPass>().getVRM();
5656
LRM.init(MF, LIS, VRM);
5757
return false;
5858
}
5959

60-
void LiveRegMatrix::init(MachineFunction &MF, LiveIntervals *pLIS,
61-
VirtRegMap *pVRM) {
60+
void LiveRegMatrix::init(MachineFunction &MF, LiveIntervals &pLIS,
61+
VirtRegMap &pVRM) {
6262
TRI = MF.getSubtarget().getRegisterInfo();
63-
LIS = pLIS;
64-
VRM = pVRM;
63+
LIS = &pLIS;
64+
VRM = &pVRM;
6565

6666
unsigned NumRegUnits = TRI->getNumRegUnits();
6767
if (NumRegUnits != Matrix.size())
@@ -261,6 +261,6 @@ LiveRegMatrix LiveRegMatrixAnalysis::run(MachineFunction &MF,
261261
auto &LIS = MFAM.getResult<LiveIntervalsAnalysis>(MF);
262262
auto &VRM = MFAM.getResult<VirtRegMapAnalysis>(MF);
263263
LiveRegMatrix LRM;
264-
LRM.init(MF, &LIS, &VRM);
264+
LRM.init(MF, LIS, VRM);
265265
return LRM;
266266
}

0 commit comments

Comments
 (0)