Skip to content

Commit ddacb71

Browse files
committed
Remove reference to *nullptr
1 parent c158867 commit ddacb71

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,9 +3770,12 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
37703770
assert(firstOp && "Should have created an atomic operation");
37713771
atomicAt = getInsertionPointAfter(firstOp);
37723772

3773-
mlir::Operation *secondOp = genAtomicOperation(
3774-
converter, loc, stmtCtx, analysis.op1.what, atomAddr, atom,
3775-
*get(analysis.op1.expr), hint, memOrder, atomicAt, prepareAt);
3773+
mlir::Operation *secondOp = nullptr;
3774+
if (analysis.op1.what != analysis.None) {
3775+
secondOp = genAtomicOperation(converter, loc, stmtCtx, analysis.op1.what,
3776+
atomAddr, atom, *get(analysis.op1.expr),
3777+
hint, memOrder, atomicAt, prepareAt);
3778+
}
37763779

37773780
if (secondOp) {
37783781
builder.setInsertionPointAfter(secondOp);

0 commit comments

Comments
 (0)