@@ -1214,6 +1214,7 @@ struct PushAndPopStackRAII {
12141214 CodeGenFunction::JumpDest Dest =
12151215 CGF.getOMPCancelDestination(OMPD_parallel);
12161216 CGF.EmitBranchThroughCleanup(Dest);
1217+ return llvm::Error::success();
12171218 };
12181219
12191220 // TODO: Remove this once we emit parallel regions through the
@@ -2355,8 +2356,11 @@ void CGOpenMPRuntime::emitBarrierCall(CodeGenFunction &CGF, SourceLocation Loc,
23552356 auto *OMPRegionInfo =
23562357 dyn_cast_or_null<CGOpenMPRegionInfo>(CGF.CapturedStmtInfo);
23572358 if (CGF.CGM.getLangOpts().OpenMPIRBuilder) {
2358- CGF.Builder.restoreIP(OMPBuilder.createBarrier(
2359- CGF.Builder, Kind, ForceSimpleCall, EmitChecks));
2359+ llvm::OpenMPIRBuilder::InsertPointOrErrorTy AfterIP =
2360+ OMPBuilder.createBarrier(CGF.Builder, Kind, ForceSimpleCall,
2361+ EmitChecks);
2362+ assert(AfterIP && "unexpected error creating barrier");
2363+ CGF.Builder.restoreIP(*AfterIP);
23602364 return;
23612365 }
23622366
@@ -5977,8 +5981,10 @@ void CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(
59775981 /*CanHaveMultiDeviceArgs*/ true, /*IsTopKernel*/ true);
59785982 };
59795983
5980- OMPBuilder.emitTargetRegionFunction(EntryInfo, GenerateOutlinedFunction,
5981- IsOffloadEntry, OutlinedFn, OutlinedFnID);
5984+ llvm::Error Err = OMPBuilder.emitTargetRegionFunction(
5985+ EntryInfo, GenerateOutlinedFunction, IsOffloadEntry, OutlinedFn,
5986+ OutlinedFnID);
5987+ assert(!Err && "unexpected error creating target region");
59825988
59835989 if (!OutlinedFn)
59845990 return;
@@ -9970,9 +9976,12 @@ static void emitTargetCallKernelLaunch(
99709976 NumTargetItems, RTArgs, NumIterations, NumTeams, NumThreads,
99719977 DynCGGroupMem, HasNoWait);
99729978
9973- CGF.Builder.restoreIP(OMPRuntime->getOMPBuilder().emitKernelLaunch(
9974- CGF.Builder, OutlinedFnID, EmitTargetCallFallbackCB, Args, DeviceID,
9975- RTLoc, AllocaIP));
9979+ llvm::OpenMPIRBuilder::InsertPointOrErrorTy AfterIP =
9980+ OMPRuntime->getOMPBuilder().emitKernelLaunch(
9981+ CGF.Builder, OutlinedFnID, EmitTargetCallFallbackCB, Args, DeviceID,
9982+ RTLoc, AllocaIP);
9983+ assert(AfterIP && "unexpected error creating kernel launch");
9984+ CGF.Builder.restoreIP(*AfterIP);
99769985 };
99779986
99789987 if (RequiresOuterTask) {
@@ -10668,9 +10677,12 @@ void CGOpenMPRuntime::emitTargetDataCalls(
1066810677 InsertPointTy CodeGenIP(CGF.Builder.GetInsertBlock(),
1066910678 CGF.Builder.GetInsertPoint());
1067010679 llvm::OpenMPIRBuilder::LocationDescription OmpLoc(CodeGenIP);
10671- CGF.Builder.restoreIP(OMPBuilder.createTargetData(
10672- OmpLoc, AllocaIP, CodeGenIP, DeviceID, IfCondVal, Info, GenMapInfoCB,
10673- /*MapperFunc=*/nullptr, BodyCB, DeviceAddrCB, CustomMapperCB, RTLoc));
10680+ llvm::OpenMPIRBuilder::InsertPointOrErrorTy AfterIP =
10681+ OMPBuilder.createTargetData(
10682+ OmpLoc, AllocaIP, CodeGenIP, DeviceID, IfCondVal, Info, GenMapInfoCB,
10683+ /*MapperFunc=*/nullptr, BodyCB, DeviceAddrCB, CustomMapperCB, RTLoc);
10684+ assert(AfterIP && "unexpected error creating target data");
10685+ CGF.Builder.restoreIP(*AfterIP);
1067410686}
1067510687
1067610688void CGOpenMPRuntime::emitTargetDataStandAloneCall(
0 commit comments