Index: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp =================================================================== --- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -394,9 +394,10 @@ // A PHI or Select is a base defining value. The outer findBasePointer // algorithm is responsible for constructing a base value for this BDV. - assert((isa(I) || isa(I)) && - "unknown vector instruction - no base found for vector element"); - return BaseDefiningValueResult(I, false); + if (isa(I) || isa(I)) + return BaseDefiningValueResult(I, false); + + report_fatal_error("unknown vector instruction - no base found for vector element"); } /// Helper function for findBasePointer - Will return a value which either a) @@ -428,13 +429,14 @@ Value *Def = CI->stripPointerCasts(); // If stripping pointer casts changes the address space there is an // addrspacecast in between. - assert(cast(Def->getType())->getAddressSpace() == - cast(CI->getType())->getAddressSpace() && - "unsupported addrspacecast"); + if (Def->getType()->getPointerAddressSpace() != + CI->getType()->getPointerAddressSpace()) + report_fatal_error("unsupported addrspacecast"); // If we find a cast instruction here, it means we've found a cast which is // not simply a pointer cast (i.e. an inttoptr). We don't know how to // handle int->ptr conversion. - assert(!isa(Def) && "shouldn't find another cast here"); + if (isa(Def)) + report_fatal_error("shouldn't find another cast here"); return findBaseDefiningValue(Def); } @@ -476,7 +478,8 @@ // I have absolutely no idea how to implement this part yet. It's not // necessarily hard, I just haven't really looked at it yet. - assert(!isa(I) && "Landing Pad is unimplemented"); + if (isa(I)) + report_fatal_error("Landing Pad is unimplemented"); if (isa(I)) // A CAS is effectively a atomic store and load combined under a @@ -512,9 +515,10 @@ // return a value which dynamically selects from among several base // derived pointers (each with it's own base potentially). It's the job of // the caller to resolve these. - assert((isa(I) || isa(I)) && - "missing instruction case in findBaseDefiningValing"); - return BaseDefiningValueResult(I, false); + if (isa(I) || isa(I)) + return BaseDefiningValueResult(I, false); + + report_fatal_error("missing instruction case in findBaseDefiningValue"); } /// Returns the base defining value for this value. @@ -2293,8 +2297,8 @@ : iterator_range(Statepoint(CS).vm_state_args()); for (Value *Arg : DeoptStateRange) { - assert(!isUnhandledGCPointerType(Arg->getType()) && - "support for FCA unimplemented"); + if (isUnhandledGCPointerType(Arg->getType())) + report_fatal_error("support for FCA unimplemented"); if (isHandledGCPointerType(Arg->getType())) DeoptValues.push_back(Arg); } @@ -2699,8 +2703,8 @@ // USE - Add to the LiveIn set for this instruction for (Value *V : I->operands()) { - assert(!isUnhandledGCPointerType(V->getType()) && - "support for FCA unimplemented"); + if (isUnhandledGCPointerType(V->getType())) + report_fatal_error("support for FCA unimplemented"); if (isHandledGCPointerType(V->getType()) && !isa(V)) { // The choice to exclude all things constant here is slightly subtle. // There are two independent reasons: @@ -2725,8 +2729,8 @@ for (BasicBlock::iterator I = Succ->begin(); I != E; I++) { PHINode *Phi = cast(&*I); Value *V = Phi->getIncomingValueForBlock(BB); - assert(!isUnhandledGCPointerType(V->getType()) && - "support for FCA unimplemented"); + if (isUnhandledGCPointerType(V->getType())) + report_fatal_error("support for FCA unimplemented"); if (isHandledGCPointerType(V->getType()) && !isa(V)) { LiveTmp.insert(V); }