diff options
author | Matthias Braun <matze@braunis.de> | 2017-06-06 00:44:35 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2017-06-06 00:44:35 +0000 |
commit | 7bda19581229e4b78ccab72a2102d251cc1ab279 (patch) | |
tree | b8e784f75744254b876fe5d18ba9d248515332cc /llvm/unittests/MI/LiveIntervalTest.cpp | |
parent | 707524556c490b05f62529d6ccf7e646e7e9d52c (diff) | |
download | bcm5719-llvm-7bda19581229e4b78ccab72a2102d251cc1ab279.tar.gz bcm5719-llvm-7bda19581229e4b78ccab72a2102d251cc1ab279.zip |
CodeGen: Refactor MIR parsing
When parsing .mir files immediately construct the MachineFunctions and
put them into MachineModuleInfo.
This allows us to get rid of the delayed construction (and delayed error
reporting) through the MachineFunctionInitialzier interface.
Differential Revision: https://reviews.llvm.org/D33809
llvm-svn: 304758
Diffstat (limited to 'llvm/unittests/MI/LiveIntervalTest.cpp')
-rw-r--r-- | llvm/unittests/MI/LiveIntervalTest.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/unittests/MI/LiveIntervalTest.cpp b/llvm/unittests/MI/LiveIntervalTest.cpp index 026fb42d345..a37d6ed8f63 100644 --- a/llvm/unittests/MI/LiveIntervalTest.cpp +++ b/llvm/unittests/MI/LiveIntervalTest.cpp @@ -59,18 +59,15 @@ std::unique_ptr<Module> parseMIR(LLVMContext &Context, if (!MIR) return nullptr; - std::unique_ptr<Module> M = MIR->parseLLVMModule(); + std::unique_ptr<Module> M = MIR->parseIRModule(); if (!M) return nullptr; M->setDataLayout(TM.createDataLayout()); - Function *F = M->getFunction(FuncName); - if (!F) - return nullptr; - MachineModuleInfo *MMI = new MachineModuleInfo(&TM); - MMI->setMachineFunctionInitializer(MIR.get()); + if (MIR->parseMachineFunctions(*M, *MMI)) + return nullptr; PM.add(MMI); return M; @@ -154,6 +151,7 @@ body: | std::unique_ptr<MIRParser> MIR; std::unique_ptr<Module> M = parseMIR(Context, PM, MIR, *TM, MIRString, "func"); + assert(M && "MIR parsing successfull"); PM.add(new TestPass(T)); |