@@ -561,8 +561,7 @@ class ClauseProcessor {
561
561
bool processDepend (llvm::SmallVectorImpl<mlir::Attribute> &dependTypeOperands,
562
562
llvm::SmallVectorImpl<mlir::Value> &dependOperands) const ;
563
563
bool
564
- processIf (Fortran::lower::StatementContext &stmtCtx,
565
- Fortran::parser::OmpIfClause::DirectiveNameModifier directiveName,
564
+ processIf (Fortran::parser::OmpIfClause::DirectiveNameModifier directiveName,
566
565
mlir::Value &result) const ;
567
566
bool
568
567
processLink (llvm::SmallVectorImpl<DeclareTargetCapturePair> &result) const ;
@@ -1116,7 +1115,6 @@ genDependKindAttr(fir::FirOpBuilder &firOpBuilder,
1116
1115
1117
1116
static mlir::Value getIfClauseOperand (
1118
1117
Fortran::lower::AbstractConverter &converter,
1119
- Fortran::lower::StatementContext &stmtCtx,
1120
1118
const Fortran::parser::OmpClause::If *ifClause,
1121
1119
Fortran::parser::OmpIfClause::DirectiveNameModifier directiveName,
1122
1120
mlir::Location clauseLocation) {
@@ -1127,6 +1125,7 @@ static mlir::Value getIfClauseOperand(
1127
1125
if (directive && directive.value () != directiveName)
1128
1126
return nullptr ;
1129
1127
1128
+ Fortran::lower::StatementContext stmtCtx;
1130
1129
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder ();
1131
1130
auto &expr = std::get<Fortran::parser::ScalarLogicalExpr>(ifClause->v .t );
1132
1131
mlir::Value ifVal = fir::getBase (
@@ -1672,15 +1671,14 @@ bool ClauseProcessor::processDepend(
1672
1671
}
1673
1672
1674
1673
bool ClauseProcessor::processIf (
1675
- Fortran::lower::StatementContext &stmtCtx,
1676
1674
Fortran::parser::OmpIfClause::DirectiveNameModifier directiveName,
1677
1675
mlir::Value &result) const {
1678
1676
bool found = false ;
1679
1677
findRepeatableClause<ClauseTy::If>(
1680
1678
[&](const ClauseTy::If *ifClause,
1681
1679
const Fortran::parser::CharBlock &source) {
1682
1680
mlir::Location clauseLocation = converter.genLocation (source);
1683
- mlir::Value operand = getIfClauseOperand (converter, stmtCtx, ifClause,
1681
+ mlir::Value operand = getIfClauseOperand (converter, ifClause,
1684
1682
directiveName, clauseLocation);
1685
1683
// Assume that, at most, a single 'if' clause will be applicable to the
1686
1684
// given directive.
@@ -2305,8 +2303,7 @@ genParallelOp(Fortran::lower::AbstractConverter &converter,
2305
2303
llvm::SmallVector<mlir::Attribute> reductionDeclSymbols;
2306
2304
2307
2305
ClauseProcessor cp (converter, clauseList);
2308
- cp.processIf (stmtCtx,
2309
- Fortran::parser::OmpIfClause::DirectiveNameModifier::Parallel,
2306
+ cp.processIf (Fortran::parser::OmpIfClause::DirectiveNameModifier::Parallel,
2310
2307
ifClauseOperand);
2311
2308
cp.processNumThreads (stmtCtx, numThreadsClauseOperand);
2312
2309
cp.processProcBind (procBindKindAttr);
@@ -2360,8 +2357,7 @@ genTaskOp(Fortran::lower::AbstractConverter &converter,
2360
2357
dependOperands;
2361
2358
2362
2359
ClauseProcessor cp (converter, clauseList);
2363
- cp.processIf (stmtCtx,
2364
- Fortran::parser::OmpIfClause::DirectiveNameModifier::Task,
2360
+ cp.processIf (Fortran::parser::OmpIfClause::DirectiveNameModifier::Task,
2365
2361
ifClauseOperand);
2366
2362
cp.processAllocate (allocatorOperands, allocateOperands);
2367
2363
cp.processDefault ();
@@ -2418,8 +2414,7 @@ genDataOp(Fortran::lower::AbstractConverter &converter,
2418
2414
llvm::SmallVector<const Fortran::semantics::Symbol *> useDeviceSymbols;
2419
2415
2420
2416
ClauseProcessor cp (converter, clauseList);
2421
- cp.processIf (stmtCtx,
2422
- Fortran::parser::OmpIfClause::DirectiveNameModifier::TargetData,
2417
+ cp.processIf (Fortran::parser::OmpIfClause::DirectiveNameModifier::TargetData,
2423
2418
ifClauseOperand);
2424
2419
cp.processDevice (stmtCtx, deviceOperand);
2425
2420
cp.processUseDevicePtr (devicePtrOperands, useDeviceTypes, useDeviceLocs,
@@ -2464,7 +2459,7 @@ genEnterExitDataOp(Fortran::lower::AbstractConverter &converter,
2464
2459
}
2465
2460
2466
2461
ClauseProcessor cp (converter, clauseList);
2467
- cp.processIf (stmtCtx, directiveName, ifClauseOperand);
2462
+ cp.processIf (directiveName, ifClauseOperand);
2468
2463
cp.processDevice (stmtCtx, deviceOperand);
2469
2464
cp.processNowait (nowaitAttr);
2470
2465
cp.processMap (currentLocation, directive, semanticsContext, stmtCtx,
@@ -2588,8 +2583,7 @@ genTargetOp(Fortran::lower::AbstractConverter &converter,
2588
2583
llvm::SmallVector<const Fortran::semantics::Symbol *> mapSymbols;
2589
2584
2590
2585
ClauseProcessor cp (converter, clauseList);
2591
- cp.processIf (stmtCtx,
2592
- Fortran::parser::OmpIfClause::DirectiveNameModifier::Target,
2586
+ cp.processIf (Fortran::parser::OmpIfClause::DirectiveNameModifier::Target,
2593
2587
ifClauseOperand);
2594
2588
cp.processDevice (stmtCtx, deviceOperand);
2595
2589
cp.processThreadLimit (stmtCtx, threadLimitOperand);
@@ -2743,8 +2737,7 @@ genTeamsOp(Fortran::lower::AbstractConverter &converter,
2743
2737
llvm::SmallVector<mlir::Attribute> reductionDeclSymbols;
2744
2738
2745
2739
ClauseProcessor cp (converter, clauseList);
2746
- cp.processIf (stmtCtx,
2747
- Fortran::parser::OmpIfClause::DirectiveNameModifier::Teams,
2740
+ cp.processIf (Fortran::parser::OmpIfClause::DirectiveNameModifier::Teams,
2748
2741
ifClauseOperand);
2749
2742
cp.processAllocate (allocatorOperands, allocateOperands);
2750
2743
cp.processDefault ();
@@ -3019,8 +3012,7 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
3019
3012
llvm::SmallVector<mlir::Value> alignedVars, nontemporalVars;
3020
3013
mlir::Value ifClauseOperand;
3021
3014
mlir::IntegerAttr simdlenClauseOperand, safelenClauseOperand;
3022
- cp.processIf (stmtCtx,
3023
- Fortran::parser::OmpIfClause::DirectiveNameModifier::Simd,
3015
+ cp.processIf (Fortran::parser::OmpIfClause::DirectiveNameModifier::Simd,
3024
3016
ifClauseOperand);
3025
3017
cp.processSimdlen (simdlenClauseOperand);
3026
3018
cp.processSafelen (safelenClauseOperand);
0 commit comments