@@ -217,7 +217,7 @@ getHostEvalInfoStackTop(lower::AbstractConverter &converter) {
217
217
}
218
218
219
219
// / Stack frame for storing the OpenMPSectionsConstruct currently being
220
- // / processed so that it can be refered to when lowering the construct.
220
+ // / processed so that it can be referred to when lowering the construct.
221
221
class SectionsConstructStackFrame
222
222
: public mlir::StateStackFrameBase<SectionsConstructStackFrame> {
223
223
public:
@@ -1852,14 +1852,13 @@ static void genTargetClauses(
1852
1852
llvm::SmallVectorImpl<const semantics::Symbol *> &hasDeviceAddrSyms,
1853
1853
llvm::SmallVectorImpl<const semantics::Symbol *> &isDevicePtrSyms,
1854
1854
llvm::SmallVectorImpl<const semantics::Symbol *> &mapSyms) {
1855
- HostEvalInfo *hostEvalInfo = getHostEvalInfoStackTop (converter);
1856
1855
ClauseProcessor cp (converter, semaCtx, clauses);
1857
1856
cp.processBare (clauseOps);
1858
1857
cp.processDefaultMap (stmtCtx, defaultMaps);
1859
1858
cp.processDepend (symTable, stmtCtx, clauseOps);
1860
1859
cp.processDevice (stmtCtx, clauseOps);
1861
1860
cp.processHasDeviceAddr (stmtCtx, clauseOps, hasDeviceAddrSyms);
1862
- if (hostEvalInfo) {
1861
+ if (HostEvalInfo * hostEvalInfo = getHostEvalInfoStackTop (converter) ) {
1863
1862
// Only process host_eval if compiling for the host device.
1864
1863
processHostEvalClauses (converter, semaCtx, stmtCtx, eval, loc);
1865
1864
hostEvalInfo->collectValues (clauseOps.hostEvalVars );
@@ -2251,9 +2250,6 @@ genScanOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
2251
2250
converter.getCurrentLocation (), clauseOps);
2252
2251
}
2253
2252
2254
- // / This breaks the normal prototype of the gen*Op functions: adding the
2255
- // / sectionBlocks argument so that the enclosed section constructs can be
2256
- // / lowered here with correct reduction symbol remapping.
2257
2253
static mlir::omp::SectionsOp
2258
2254
genSectionsOp (lower::AbstractConverter &converter, lower::SymMap &symTable,
2259
2255
semantics::SemanticsContext &semaCtx,
@@ -2262,11 +2258,10 @@ genSectionsOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
2262
2258
ConstructQueue::const_iterator item) {
2263
2259
const parser::OpenMPSectionsConstruct *sectionsConstruct =
2264
2260
getSectionsConstructStackTop (converter);
2265
- assert (sectionsConstruct);
2261
+ assert (sectionsConstruct && " Missing additional parsing information " );
2266
2262
2267
2263
const auto §ionBlocks =
2268
2264
std::get<parser::OmpSectionBlocks>(sectionsConstruct->t );
2269
- converter.getStateStack ().stackPop ();
2270
2265
mlir::omp::SectionsOperands clauseOps;
2271
2266
llvm::SmallVector<const semantics::Symbol *> reductionSyms;
2272
2267
genSectionsClauses (converter, semaCtx, item->clauses , loc, clauseOps,
@@ -4274,8 +4269,8 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
4274
4269
buildConstructQueue (converter.getFirOpBuilder ().getModule (), semaCtx,
4275
4270
eval, source, directive, clauses)};
4276
4271
4277
- converter. getStateStack (). stackPush <SectionsConstructStackFrame>(
4278
- sectionsConstruct) ;
4272
+ mlir::SaveStateStack <SectionsConstructStackFrame> saveStateStack{
4273
+ converter. getStateStack (), sectionsConstruct} ;
4279
4274
genOMPDispatch (converter, symTable, semaCtx, eval, currentLocation, queue,
4280
4275
queue.begin ());
4281
4276
}
0 commit comments