@@ -1819,6 +1819,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
1819
1819
auto loc = toLocation ();
1820
1820
std::visit (
1821
1821
Fortran::common::visitors{
1822
+ // [1] Plain old assignment.
1822
1823
[&](const Fortran::evaluate::Assignment::Intrinsic &) {
1823
1824
const auto *sym = Fortran::evaluate::GetLastSymbol (assign.lhs );
1824
1825
@@ -1905,15 +1906,19 @@ class FirConverter : public Fortran::lower::AbstractConverter {
1905
1906
}
1906
1907
llvm_unreachable (" unknown category" );
1907
1908
},
1909
+
1910
+ // [2] User defined assignment. If the context is a scalar
1911
+ // expression then call the procedure.
1908
1912
[&](const Fortran::evaluate::ProcedureRef &procRef) {
1909
- // User defined assignment: call the procedure.
1910
1913
if (explicitIterationSpace ())
1911
1914
TODO (loc, " user defined assignment within FORALL" );
1912
1915
Fortran::semantics::SomeExpr expr{procRef};
1913
1916
createFIRExpr (toLocation (), &expr, stmtCtx);
1914
1917
},
1918
+
1919
+ // [3] Pointer assignment with possibly empty bounds-spec. R1035: a
1920
+ // bounds-spec is a lower bound value.
1915
1921
[&](const Fortran::evaluate::Assignment::BoundsSpec &lbExprs) {
1916
- // Pointer assignment with possibly empty bounds-spec
1917
1922
auto lhsType = assign.lhs .GetType ();
1918
1923
auto rhsType = assign.rhs .GetType ();
1919
1924
// Polymorphic lhs/rhs may need more care. See F2018 10.2.2.3.
@@ -1931,9 +1936,11 @@ class FirConverter : public Fortran::lower::AbstractConverter {
1931
1936
Fortran::lower::associateMutableBox (*this , loc, lhs, assign.rhs ,
1932
1937
lbounds, stmtCtx);
1933
1938
},
1939
+
1940
+ // [4] Pointer assignment with bounds-remapping. R1036: a
1941
+ // bounds-remapping is a pair, lower bound and upper bound.
1934
1942
[&](const Fortran::evaluate::Assignment::BoundsRemapping
1935
1943
&boundExprs) {
1936
- // Pointer assignment with bounds-remapping
1937
1944
if (explicitIterationSpace ())
1938
1945
TODO (loc, " pointer assignment within FORALL" );
1939
1946
auto lhs = genExprMutableBox (loc, assign.lhs );
@@ -1961,10 +1968,16 @@ class FirConverter : public Fortran::lower::AbstractConverter {
1961
1968
? Fortran::lower::createSomeArrayBox (
1962
1969
*this , assign.rhs , localSymbols, stmtCtx)
1963
1970
: genExprAddr (assign.rhs , stmtCtx);
1971
+ <<<<<<< Updated upstream
1964
1972
fir::factory::associateMutableBoxWithRemap (*builder, loc, lhs,
1965
1973
rhs, lbounds, ubounds);
1966
1974
},
1967
1975
},
1976
+ =======
1977
+ Fortran::lower::associateMutableBoxWithRemap (
1978
+ *builder, loc, lhs, rhs, lbounds, ubounds);
1979
+ }},
1980
+ >>>>>>> Stashed changes
1968
1981
assign.u);
1969
1982
}
1970
1983
0 commit comments