File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2718,11 +2718,14 @@ void CGOpenMPRuntime::emitNumThreadsClause(
27182718 // as if sev-level is fatal."
27192719 Args.push_back(llvm::ConstantInt::get(
27202720 CGM.Int32Ty, Severity == OMPC_SEVERITY_warning ? 1 : 2));
2721- if (Message)
2722- Args.push_back(CGF.EmitStringLiteralLValue(cast<StringLiteral>(Message))
2723- .getPointer(CGF));
2724- else
2721+ if (Message) {
2722+ if (const StringLiteral *Msg = dyn_cast<StringLiteral>(Message))
2723+ Args.push_back(CGF.EmitStringLiteralLValue(Msg).getPointer(CGF));
2724+ else
2725+ Args.push_back(CGF.EmitScalarExpr(Message));
2726+ } else {
27252727 Args.push_back(llvm::ConstantPointerNull::get(CGF.VoidPtrTy));
2728+ }
27262729 }
27272730 CGF.EmitRuntimeCall(
27282731 OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), FnID), Args);
You can’t perform that action at this time.
0 commit comments