Skip to content

Commit c71cae3

Browse files
committed
Fixed missing uses of OwningMachineModuleInfoWrapperPass.
1 parent 8c213d5 commit c71cae3

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

llvm/unittests/CodeGen/AsmPrinterDwarfTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class AsmPrinterHandlerTest : public AsmPrinterFixtureBase {
403403
AP->addAsmPrinterHandler(std::make_unique<TestHandler>(*this));
404404
TargetMachine *TM = &AP->TM;
405405
legacy::PassManager PM;
406-
PM.add(new MachineModuleInfoWrapperPass(TM));
406+
PM.add(new OwningMachineModuleInfoWrapperPass(*TM));
407407
PM.add(TestPrinter->releaseAP()); // Takes ownership of destroying AP
408408
LLVMContext Context;
409409
std::unique_ptr<Module> M(new Module("TestModule", Context));

llvm/unittests/CodeGen/X86MCInstLowerTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class X86MCInstLowerTest : public testing::Test {
149149
TEST_F(X86MCInstLowerTest, moExternalSymbol_MCSYMBOL) {
150150

151151
MachineModuleInfoWrapperPass *MMIWP =
152-
new MachineModuleInfoWrapperPass(TM.get(), &*MCFoo);
152+
new OwningMachineModuleInfoWrapperPass(*TM, *MCFoo);
153153

154154
SmallString<1024> Buf;
155155
llvm::raw_svector_ostream OS(Buf);

llvm/unittests/MI/LiveIntervalTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ std::unique_ptr<Module> parseMIR(LLVMContext &Context,
7070

7171
M->setDataLayout(TM.createDataLayout());
7272

73-
MachineModuleInfoWrapperPass *MMIWP = new MachineModuleInfoWrapperPass(&TM);
73+
MachineModuleInfoWrapperPass *MMIWP =
74+
new OwningMachineModuleInfoWrapperPass(TM);
7475
if (MIR->parseMachineFunctions(*M, MMIWP->getMMI()))
7576
return nullptr;
7677
PM.add(MMIWP);

0 commit comments

Comments
 (0)