llvm.org GIT mirror llvm / 9fed20c
[llvm-rtdyld] Turn assertion into errors, it seems more appropriate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253766 91177308-0d34-0410-b5e6-96231b3b80d8 Davide Italiano 3 years ago
1 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
609609
610610 std::unique_ptr STI(
611611 TheTarget->createMCSubtargetInfo(TripleName, MCPU, ""));
612 assert(STI && "Unable to create subtarget info!");
612 if (!STI)
613 return Error("Unable to create subtarget info!");
613614
614615 std::unique_ptr MRI(TheTarget->createMCRegInfo(TripleName));
615 assert(MRI && "Unable to create target register info!");
616 if (!MRI)
617 return Error("Unable to create target register info!");
616618
617619 std::unique_ptr MAI(TheTarget->createMCAsmInfo(*MRI, TripleName));
618 assert(MAI && "Unable to create target asm info!");
620 if (!MAI)
621 return Error("Unable to create target asm info!");
619622
620623 MCContext Ctx(MAI.get(), MRI.get(), nullptr);
621624
622625 std::unique_ptr Disassembler(
623626 TheTarget->createMCDisassembler(*STI, Ctx));
624 assert(Disassembler && "Unable to create disassembler!");
627 if (!Disassembler)
628 return Error("Unable to create disassembler!");
625629
626630 std::unique_ptr MII(TheTarget->createMCInstrInfo());
627631