@@ -215,7 +215,7 @@ getHostEvalInfoStackTop(lower::AbstractConverter &converter) {
215
215
}
216
216
217
217
// / Stack frame for storing the OpenMPSectionsConstruct currently being
218
- // / processed so that it can be refered to when lowering the construct.
218
+ // / processed so that it can be referred to when lowering the construct.
219
219
class SectionsConstructStackFrame
220
220
: public mlir::StateStackFrameBase<SectionsConstructStackFrame> {
221
221
public:
@@ -1840,14 +1840,13 @@ static void genTargetClauses(
1840
1840
llvm::SmallVectorImpl<const semantics::Symbol *> &hasDeviceAddrSyms,
1841
1841
llvm::SmallVectorImpl<const semantics::Symbol *> &isDevicePtrSyms,
1842
1842
llvm::SmallVectorImpl<const semantics::Symbol *> &mapSyms) {
1843
- HostEvalInfo *hostEvalInfo = getHostEvalInfoStackTop (converter);
1844
1843
ClauseProcessor cp (converter, semaCtx, clauses);
1845
1844
cp.processBare (clauseOps);
1846
1845
cp.processDefaultMap (stmtCtx, defaultMaps);
1847
1846
cp.processDepend (symTable, stmtCtx, clauseOps);
1848
1847
cp.processDevice (stmtCtx, clauseOps);
1849
1848
cp.processHasDeviceAddr (stmtCtx, clauseOps, hasDeviceAddrSyms);
1850
- if (hostEvalInfo) {
1849
+ if (HostEvalInfo * hostEvalInfo = getHostEvalInfoStackTop (converter) ) {
1851
1850
// Only process host_eval if compiling for the host device.
1852
1851
processHostEvalClauses (converter, semaCtx, stmtCtx, eval, loc);
1853
1852
hostEvalInfo->collectValues (clauseOps.hostEvalVars );
@@ -2240,9 +2239,6 @@ genScanOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
2240
2239
converter.getCurrentLocation (), clauseOps);
2241
2240
}
2242
2241
2243
- // / This breaks the normal prototype of the gen*Op functions: adding the
2244
- // / sectionBlocks argument so that the enclosed section constructs can be
2245
- // / lowered here with correct reduction symbol remapping.
2246
2242
static mlir::omp::SectionsOp
2247
2243
genSectionsOp (lower::AbstractConverter &converter, lower::SymMap &symTable,
2248
2244
semantics::SemanticsContext &semaCtx,
@@ -2251,11 +2247,10 @@ genSectionsOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
2251
2247
ConstructQueue::const_iterator item) {
2252
2248
const parser::OpenMPSectionsConstruct *sectionsConstruct =
2253
2249
getSectionsConstructStackTop (converter);
2254
- assert (sectionsConstruct);
2250
+ assert (sectionsConstruct && " Missing additional parsing information " );
2255
2251
2256
2252
const auto §ionBlocks =
2257
2253
std::get<parser::OmpSectionBlocks>(sectionsConstruct->t );
2258
- converter.getStateStack ().stackPop ();
2259
2254
mlir::omp::SectionsOperands clauseOps;
2260
2255
llvm::SmallVector<const semantics::Symbol *> reductionSyms;
2261
2256
genSectionsClauses (converter, semaCtx, item->clauses , loc, clauseOps,
@@ -3810,8 +3805,8 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
3810
3805
buildConstructQueue (converter.getFirOpBuilder ().getModule (), semaCtx,
3811
3806
eval, source, directive, clauses)};
3812
3807
3813
- converter. getStateStack (). stackPush <SectionsConstructStackFrame>(
3814
- sectionsConstruct) ;
3808
+ mlir::SaveStateStack <SectionsConstructStackFrame> saveStateStack{
3809
+ converter. getStateStack (), sectionsConstruct} ;
3815
3810
genOMPDispatch (converter, symTable, semaCtx, eval, currentLocation, queue,
3816
3811
queue.begin ());
3817
3812
}
0 commit comments