aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Lower/Bridge.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <Krzysztof.Parzyszek@amd.com>2023-12-04 08:27:57 -0600
committerGitHub <noreply@github.com>2023-12-04 08:27:57 -0600
commitdd376f859526d9023c879e880f380158050daa5b (patch)
tree110b65f8051fcd77f560f9cb7bda359bb7bf3139 /flang/lib/Lower/Bridge.cpp
parentc556c9c3792a322dfc3a9c60be9d7d32cf335235 (diff)
downloadllvm-dd376f859526d9023c879e880f380158050daa5b.zip
llvm-dd376f859526d9023c879e880f380158050daa5b.tar.gz
llvm-dd376f859526d9023c879e880f380158050daa5b.tar.bz2
[flang] Fix move-assign operator for struct IncrementLoopInfo (#74137)
Diffstat (limited to 'flang/lib/Lower/Bridge.cpp')
-rw-r--r--flang/lib/Lower/Bridge.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index 61c02c89..328bb58 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -82,12 +82,12 @@ struct IncrementLoopInfo {
explicit IncrementLoopInfo(Fortran::semantics::Symbol &sym, const T &lower,
const T &upper, const std::optional<T> &step,
bool isUnordered = false)
- : loopVariableSym{sym}, lowerExpr{Fortran::semantics::GetExpr(lower)},
+ : loopVariableSym{&sym}, lowerExpr{Fortran::semantics::GetExpr(lower)},
upperExpr{Fortran::semantics::GetExpr(upper)},
stepExpr{Fortran::semantics::GetExpr(step)}, isUnordered{isUnordered} {}
IncrementLoopInfo(IncrementLoopInfo &&) = default;
- IncrementLoopInfo &operator=(IncrementLoopInfo &&x) { return x; }
+ IncrementLoopInfo &operator=(IncrementLoopInfo &&x) = default;
bool isStructured() const { return !headerBlock; }
@@ -102,7 +102,7 @@ struct IncrementLoopInfo {
}
// Data members common to both structured and unstructured loops.
- const Fortran::semantics::Symbol &loopVariableSym;
+ const Fortran::semantics::Symbol *loopVariableSym;
const Fortran::lower::SomeExpr *lowerExpr;
const Fortran::lower::SomeExpr *upperExpr;
const Fortran::lower::SomeExpr *stepExpr;
@@ -1737,7 +1737,7 @@ private:
bounds->step);
if (unstructuredContext) {
maybeStartBlock(preheaderBlock);
- info.hasRealControl = info.loopVariableSym.GetType()->IsNumeric(
+ info.hasRealControl = info.loopVariableSym->GetType()->IsNumeric(
Fortran::common::TypeCategory::Real);
info.headerBlock = headerBlock;
info.bodyBlock = bodyBlock;
@@ -1827,7 +1827,7 @@ private:
mlir::Location loc = toLocation();
for (IncrementLoopInfo &info : incrementLoopNestInfo) {
info.loopVariable =
- genLoopVariableAddress(loc, info.loopVariableSym, info.isUnordered);
+ genLoopVariableAddress(loc, *info.loopVariableSym, info.isUnordered);
mlir::Value lowerValue = genControlValue(info.lowerExpr, info);
mlir::Value upperValue = genControlValue(info.upperExpr, info);
bool isConst = true;