diff --git a/flang/include/flang/Lower/AbstractConverter.h b/flang/include/flang/Lower/AbstractConverter.h --- a/flang/include/flang/Lower/AbstractConverter.h +++ b/flang/include/flang/Lower/AbstractConverter.h @@ -78,19 +78,24 @@ // Expressions //===--------------------------------------------------------------------===// + /// Generate the address of the location holding the expression, someExpr. + /// If SomeExpr is a Designator that is not compile time contiguous, the + /// address returned is the one of a contiguous temporary storage holding the + /// expression value. The clean-up for this temporary is added to the + /// StatementContext. + virtual fir::ExtendedValue genExprAddr(const SomeExpr &, + mlir::Location *loc = nullptr) = 0; /// Generate the address of the location holding the expression, someExpr - virtual mlir::Value genExprAddr(const SomeExpr &, - mlir::Location *loc = nullptr) = 0; - /// Generate the address of the location holding the expression, someExpr - mlir::Value genExprAddr(const SomeExpr *someExpr, mlir::Location loc) { + fir::ExtendedValue genExprAddr(const SomeExpr *someExpr, mlir::Location loc) { return genExprAddr(*someExpr, &loc); } /// Generate the computations of the expression to produce a value - virtual mlir::Value genExprValue(const SomeExpr &, - mlir::Location *loc = nullptr) = 0; + virtual fir::ExtendedValue genExprValue(const SomeExpr &, + mlir::Location *loc = nullptr) = 0; /// Generate the computations of the expression, someExpr, to produce a value - mlir::Value genExprValue(const SomeExpr *someExpr, mlir::Location loc) { + fir::ExtendedValue genExprValue(const SomeExpr *someExpr, + mlir::Location loc) { return genExprValue(*someExpr, &loc); } diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp --- a/flang/lib/Lower/Bridge.cpp +++ b/flang/lib/Lower/Bridge.cpp @@ -71,12 +71,13 @@ return lookupSymbol(sym).getAddr(); } - mlir::Value genExprAddr(const Fortran::lower::SomeExpr &expr, - mlir::Location *loc = nullptr) override final { + fir::ExtendedValue genExprAddr(const Fortran::lower::SomeExpr &expr, + mlir::Location *loc = nullptr) override final { TODO_NOLOC("Not implemented. Needed for more complex expression lowering"); } - mlir::Value genExprValue(const Fortran::lower::SomeExpr &expr, - mlir::Location *loc = nullptr) override final { + fir::ExtendedValue + genExprValue(const Fortran::lower::SomeExpr &expr, + mlir::Location *loc = nullptr) override final { TODO_NOLOC("Not implemented. Needed for more complex expression lowering"); }