[llvm] r253766 - [llvm-rtdyld] Turn assertion into errors, it seems more appropriate.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 20 21:49:07 PST 2015
Author: davide
Date: Fri Nov 20 23:49:07 2015
New Revision: 253766
URL: http://llvm.org/viewvc/llvm-project?rev=253766&view=rev
Log:
[llvm-rtdyld] Turn assertion into errors, it seems more appropriate.
Modified:
llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
Modified: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=253766&r1=253765&r2=253766&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp (original)
+++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp Fri Nov 20 23:49:07 2015
@@ -610,19 +610,23 @@ static int linkAndVerify() {
std::unique_ptr<MCSubtargetInfo> STI(
TheTarget->createMCSubtargetInfo(TripleName, MCPU, ""));
- assert(STI && "Unable to create subtarget info!");
+ if (!STI)
+ return Error("Unable to create subtarget info!");
std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
- assert(MRI && "Unable to create target register info!");
+ if (!MRI)
+ return Error("Unable to create target register info!");
std::unique_ptr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TripleName));
- assert(MAI && "Unable to create target asm info!");
+ if (!MAI)
+ return Error("Unable to create target asm info!");
MCContext Ctx(MAI.get(), MRI.get(), nullptr);
std::unique_ptr<MCDisassembler> Disassembler(
TheTarget->createMCDisassembler(*STI, Ctx));
- assert(Disassembler && "Unable to create disassembler!");
+ if (!Disassembler)
+ return Error("Unable to create disassembler!");
std::unique_ptr<MCInstrInfo> MII(TheTarget->createMCInstrInfo());
More information about the llvm-commits
mailing list