Skip to content

Commit 1af073a

Browse files
authored
[flang][OpenMP] Pass semantics context to all generating functions in… (#81269)
… lower The convention is to pass it after "symTable" if present, otherwise after "converter": - converter, symTable, semaCtx - converter, semaCtx This makes the interfaces more uniform---some of these functions were already taking the semantics context, while others were not. The context will be used in future patches.
1 parent bc66e0c commit 1af073a

File tree

3 files changed

+147
-129
lines changed

3 files changed

+147
-129
lines changed

flang/include/flang/Lower/OpenMP.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ int64_t getCollapseValue(const Fortran::parser::OmpClauseList &clauseList);
7272
void genThreadprivateOp(AbstractConverter &, const pft::Variable &);
7373
void genDeclareTargetIntGlobal(AbstractConverter &, const pft::Variable &);
7474
void genOpenMPReduction(AbstractConverter &,
75+
Fortran::semantics::SemanticsContext &,
7576
const Fortran::parser::OmpClauseList &clauseList);
7677

7778
mlir::Operation *findReductionChain(mlir::Value, mlir::Value * = nullptr);
@@ -82,6 +83,7 @@ void removeStoreOp(mlir::Operation *, mlir::Value);
8283

8384
bool isOpenMPTargetConstruct(const parser::OpenMPConstruct &);
8485
bool isOpenMPDeviceDeclareTarget(Fortran::lower::AbstractConverter &,
86+
Fortran::semantics::SemanticsContext &,
8587
Fortran::lower::pft::Evaluation &,
8688
const parser::OpenMPDeclarativeConstruct &);
8789
void genOpenMPRequires(mlir::Operation *, const Fortran::semantics::Symbol *);

flang/lib/Lower/Bridge.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,8 @@ class FirConverter : public Fortran::lower::AbstractConverter {
24702470
// found
24712471
ompDeviceCodeFound =
24722472
ompDeviceCodeFound ||
2473-
Fortran::lower::isOpenMPDeviceDeclareTarget(*this, getEval(), ompDecl);
2473+
Fortran::lower::isOpenMPDeviceDeclareTarget(
2474+
*this, bridge.getSemanticsContext(), getEval(), ompDecl);
24742475
genOpenMPDeclarativeConstruct(
24752476
*this, localSymbols, bridge.getSemanticsContext(), getEval(), ompDecl);
24762477
builder->restoreInsertionPoint(insertPt);

0 commit comments

Comments
 (0)