Skip to content

Commit c79a1f1

Browse files
committed
implement feedback
1 parent 8296fde commit c79a1f1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)