Changeset View
Changeset View
Standalone View
Standalone View
llvm/unittests/MI/LiveIntervalTest.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | if (!MIR) | ||||
return nullptr; | return nullptr; | ||||
std::unique_ptr<Module> M = MIR->parseIRModule(); | std::unique_ptr<Module> M = MIR->parseIRModule(); | ||||
if (!M) | if (!M) | ||||
return nullptr; | return nullptr; | ||||
M->setDataLayout(TM.createDataLayout()); | M->setDataLayout(TM.createDataLayout()); | ||||
MachineModuleInfo *MMI = new MachineModuleInfo(&TM); | MachineModuleInfoWrapperPass *MMIWP = new MachineModuleInfoWrapperPass(&TM); | ||||
if (MIR->parseMachineFunctions(*M, *MMI)) | if (MIR->parseMachineFunctions(*M, MMIWP->getMMI())) | ||||
return nullptr; | return nullptr; | ||||
PM.add(MMI); | PM.add(MMIWP); | ||||
return M; | return M; | ||||
} | } | ||||
typedef std::function<void(MachineFunction&,LiveIntervals&)> LiveIntervalTest; | typedef std::function<void(MachineFunction&,LiveIntervals&)> LiveIntervalTest; | ||||
struct TestPass : public MachineFunctionPass { | struct TestPass : public MachineFunctionPass { | ||||
static char ID; | static char ID; | ||||
▲ Show 20 Lines • Show All 351 Lines • Show Last 20 Lines |