From c3b2e80b9d7615190bb5d50f17d6524c2fd8d66d Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 24 Aug 2016 00:42:05 +0000 Subject: MachineModuleInfo: Avoid dummy constructor, use INITIALIZE_TM_PASS Change this pass constructor to just accept a const TargetMachine * and use INITIALIZE_TM_PASS, that way we can get rid of the dummy constructor. The pass will still fail when calling the default constructor leading to TM == nullptr, this is no different than before but is more in line what other codegen passes are doing and avoids the dummy constructor. llvm-svn: 279598 --- llvm/unittests/MI/LiveIntervalTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/unittests/MI') diff --git a/llvm/unittests/MI/LiveIntervalTest.cpp b/llvm/unittests/MI/LiveIntervalTest.cpp index 12c3ad66073..9f594e58de7 100644 --- a/llvm/unittests/MI/LiveIntervalTest.cpp +++ b/llvm/unittests/MI/LiveIntervalTest.cpp @@ -69,8 +69,8 @@ std::unique_ptr parseMIR(LLVMContext &Context, if (!F) return nullptr; + PM.add(new MachineModuleInfo(&TM)); const LLVMTargetMachine &LLVMTM = static_cast(TM); - LLVMTM.addMachineModuleInfo(PM); LLVMTM.addMachineFunctionAnalysis(PM, MIR.get()); return M; -- cgit v1.2.3