Skip to content

Commit

Permalink
[flang][OpenMP] Pass semantics context to all generating functions in… (
Browse files Browse the repository at this point in the history
#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.
  • Loading branch information
kparzysz committed Feb 13, 2024
1 parent bc66e0c commit 1af073a
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 129 deletions.
2 changes: 2 additions & 0 deletions flang/include/flang/Lower/OpenMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ int64_t getCollapseValue(const Fortran::parser::OmpClauseList &clauseList);
void genThreadprivateOp(AbstractConverter &, const pft::Variable &);
void genDeclareTargetIntGlobal(AbstractConverter &, const pft::Variable &);
void genOpenMPReduction(AbstractConverter &,
Fortran::semantics::SemanticsContext &,
const Fortran::parser::OmpClauseList &clauseList);

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

bool isOpenMPTargetConstruct(const parser::OpenMPConstruct &);
bool isOpenMPDeviceDeclareTarget(Fortran::lower::AbstractConverter &,
Fortran::semantics::SemanticsContext &,
Fortran::lower::pft::Evaluation &,
const parser::OpenMPDeclarativeConstruct &);
void genOpenMPRequires(mlir::Operation *, const Fortran::semantics::Symbol *);
Expand Down
3 changes: 2 additions & 1 deletion flang/lib/Lower/Bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,8 @@ class FirConverter : public Fortran::lower::AbstractConverter {
// found
ompDeviceCodeFound =
ompDeviceCodeFound ||
Fortran::lower::isOpenMPDeviceDeclareTarget(*this, getEval(), ompDecl);
Fortran::lower::isOpenMPDeviceDeclareTarget(
*this, bridge.getSemanticsContext(), getEval(), ompDecl);
genOpenMPDeclarativeConstruct(
*this, localSymbols, bridge.getSemanticsContext(), getEval(), ompDecl);
builder->restoreInsertionPoint(insertPt);
Expand Down

0 comments on commit 1af073a

Please sign in to comment.