@@ -234,9 +234,9 @@ BitVector getFunctionReservedRegs(const TargetMachine &TM) {
234234 std::unique_ptr<Module> Module = createModule (Context, TM.createDataLayout ());
235235 // TODO: This only works for targets implementing LLVMTargetMachine.
236236 const LLVMTargetMachine &LLVMTM = static_cast <const LLVMTargetMachine &>(TM);
237- auto MMIWP = std::make_unique<MachineModuleInfoWrapperPass> (&LLVMTM);
237+ MachineModuleInfo MMI (&LLVMTM);
238238 MachineFunction &MF = createVoidVoidPtrMachineFunction (
239- FunctionID, Module.get (), &MMIWP-> getMMI () );
239+ FunctionID, Module.get (), &MMI );
240240 // Saving reserved registers for client.
241241 return MF.getSubtarget ().getRegisterInfo ()->getReservedRegs (MF);
242242}
@@ -249,9 +249,9 @@ Error assembleToStream(const ExegesisTarget &ET,
249249 auto Context = std::make_unique<LLVMContext>();
250250 std::unique_ptr<Module> Module =
251251 createModule (Context, TM->createDataLayout ());
252- auto MMIWP = std::make_unique<MachineModuleInfoWrapperPass> (TM.get ());
252+ MachineModuleInfo MMI (TM.get ());
253253 MachineFunction &MF = createVoidVoidPtrMachineFunction (
254- FunctionID, Module.get (), &MMIWP. get ()-> getMMI () );
254+ FunctionID, Module.get (), &MMI );
255255 MF.ensureAlignment (kFunctionAlignment );
256256
257257 // We need to instruct the passes that we're done with SSA and virtual
@@ -308,15 +308,15 @@ Error assembleToStream(const ExegesisTarget &ET,
308308 MF.getRegInfo ().freezeReservedRegs ();
309309
310310 // We create the pass manager, run the passes to populate AsmBuffer.
311- MCContext &MCContext = MMIWP-> getMMI () .getContext ();
311+ MCContext &MCContext = MMI .getContext ();
312312 legacy::PassManager PM;
313313
314314 TargetLibraryInfoImpl TLII (Triple (Module->getTargetTriple ()));
315315 PM.add (new TargetLibraryInfoWrapperPass (TLII));
316316
317317 TargetPassConfig *TPC = TM->createPassConfig (PM);
318318 PM.add (TPC);
319- PM.add (MMIWP. release ( ));
319+ PM.add (new llvm::MachineModuleInfoWrapperPass (MMI ));
320320 TPC->printAndVerify (" MachineFunctionGenerator::assemble" );
321321 // Add target-specific passes.
322322 ET.addTargetSpecificPasses (PM);
0 commit comments