Skip to content

Commit 59ab4be

Browse files
author
Chandra Ghale
committed
fix for user-defined reduction op
1 parent 18e1708 commit 59ab4be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4993,9 +4993,11 @@ void CGOpenMPRuntime::emitPrivateReduction(
49934993
continue;
49944994

49954995
BinaryOperatorKind BO = BO_Comma;
4996-
if (const auto *BORHS =
4997-
dyn_cast<BinaryOperator>(RHSExpr->IgnoreParenImpCasts())) {
4996+
const Expr *StripRHS = RHSExpr->IgnoreParenImpCasts();
4997+
if (const auto *BORHS = dyn_cast<BinaryOperator>(StripRHS)) {
49984998
BO = BORHS->getOpcode();
4999+
} else if (const auto *OpCall = dyn_cast<CXXOperatorCallExpr>(StripRHS)) {
5000+
BO = BinaryOperator::getOverloadedOpcode(OpCall->getOperator());
49995001
}
50005002

50015003
LValue SharedLV = CGF.MakeAddrLValue(SharedResult, PrivateType);

0 commit comments

Comments
 (0)