Skip to content

Commit fedc54b

Browse files
authored
[flang] Add genEval to the AbstractConverter (#75140)
There was some discussion on discourse[1] about allowing call to FIR generation functions from other part of lowering belonging to OpenMP. This solution exposes a simple `genEval` member function on the `AbstractConverter` so that IR generation for PFT Evaluation objects can be called from lowering outside of the FirConverter but not exposing it. [1] https://discourse.llvm.org/t/openmp-lowering-from-pft-to-fir/75263
1 parent 9cf9721 commit fedc54b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

flang/include/flang/Lower/AbstractConverter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ class AbstractConverter {
280280
// Miscellaneous
281281
//===--------------------------------------------------------------------===//
282282

283+
/// Generate IR for Evaluation \p eval.
284+
virtual void genEval(pft::Evaluation &eval,
285+
bool unstructuredContext = true) = 0;
286+
283287
/// Return options controlling lowering behavior.
284288
const Fortran::lower::LoweringOptions &getLoweringOptions() const {
285289
return loweringOptions;

flang/lib/Lower/Bridge.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,11 @@ class FirConverter : public Fortran::lower::AbstractConverter {
839839
}
840840
}
841841

842+
void genEval(Fortran::lower::pft::Evaluation &eval,
843+
bool unstructuredContext) override final {
844+
genFIR(eval, unstructuredContext);
845+
}
846+
842847
//===--------------------------------------------------------------------===//
843848
// Utility methods
844849
//===--------------------------------------------------------------------===//

0 commit comments

Comments
 (0)