Lines Matching refs:Fortran
163 translateRelational(Fortran::common::RelationalOperator rop) { in translateRelational()
165 case Fortran::common::RelationalOperator::LT: in translateRelational()
167 case Fortran::common::RelationalOperator::LE: in translateRelational()
169 case Fortran::common::RelationalOperator::EQ: in translateRelational()
171 case Fortran::common::RelationalOperator::NE: in translateRelational()
173 case Fortran::common::RelationalOperator::GT: in translateRelational()
175 case Fortran::common::RelationalOperator::GE: in translateRelational()
190 translateFloatRelational(Fortran::common::RelationalOperator rop) { in translateFloatRelational()
192 case Fortran::common::RelationalOperator::LT: in translateFloatRelational()
194 case Fortran::common::RelationalOperator::LE: in translateFloatRelational()
196 case Fortran::common::RelationalOperator::EQ: in translateFloatRelational()
198 case Fortran::common::RelationalOperator::NE: in translateFloatRelational()
200 case Fortran::common::RelationalOperator::GT: in translateFloatRelational()
202 case Fortran::common::RelationalOperator::GE: in translateFloatRelational()
328 Fortran::lower::getAdaptToByRefAttr(builder)}); in placeScalarValueInMemory()
360 static bool isParenthesizedVariable(const Fortran::evaluate::Expr<T> &expr) { in isParenthesizedVariable()
361 using ExprVariant = decltype(Fortran::evaluate::Expr<T>::u); in isParenthesizedVariable()
362 using Parentheses = Fortran::evaluate::Parentheses<T>; in isParenthesizedVariable()
363 if constexpr (Fortran::common::HasMember<Parentheses, ExprVariant>) { in isParenthesizedVariable()
365 return Fortran::evaluate::IsVariable(parentheses->left()); in isParenthesizedVariable()
375 static bool allSymbolsInExprPresentInMap(const Fortran::lower::SomeExpr &expr, in allSymbolsInExprPresentInMap()
376 Fortran::lower::SymMap &symMap) { in allSymbolsInExprPresentInMap()
377 for (const auto &sym : Fortran::evaluate::CollectSymbols(expr)) in allSymbolsInExprPresentInMap()
486 isElementalProcWithArrayArgs(const Fortran::evaluate::ProcedureRef &procRef) { in isElementalProcWithArrayArgs()
488 for (const std::optional<Fortran::evaluate::ActualArgument> &arg : in isElementalProcWithArrayArgs()
495 static bool isElementalProcWithArrayArgs(const Fortran::evaluate::Expr<T> &) { in isElementalProcWithArrayArgs()
499 bool isElementalProcWithArrayArgs(const Fortran::lower::SomeExpr &x) { in isElementalProcWithArrayArgs()
500 if (const auto *procRef = std::get_if<Fortran::evaluate::ProcedureRef>(&x.u)) in isElementalProcWithArrayArgs()
519 argumentHostAssocs(Fortran::lower::AbstractConverter &converter, in argumentHostAssocs()
534 createBoxProcCharTuple(Fortran::lower::AbstractConverter &converter, in createBoxProcCharTuple()
577 const Fortran::semantics::Symbol &getFirstSym(const A &obj) { in getFirstSym()
583 const Fortran::semantics::Symbol &getLastSym(const A &obj) { in getLastSym()
588 isIntrinsicModuleProcRef(const Fortran::evaluate::ProcedureRef &procRef) { in isIntrinsicModuleProcRef()
589 const Fortran::semantics::Symbol *symbol = procRef.proc().GetSymbol(); in isIntrinsicModuleProcRef()
592 const Fortran::semantics::Symbol *module = in isIntrinsicModuleProcRef()
594 return module && module->attrs().test(Fortran::semantics::Attr::INTRINSIC) && in isIntrinsicModuleProcRef()
607 isOptimizableTranspose(const Fortran::evaluate::ProcedureRef &procRef) { in isOptimizableTranspose()
608 const Fortran::evaluate::SpecificIntrinsic *intrin = in isOptimizableTranspose()
615 isOptimizableTranspose(const Fortran::evaluate::FunctionRef<T> &funcRef) { in isOptimizableTranspose()
617 static_cast<const Fortran::evaluate::ProcedureRef &>(funcRef)); in isOptimizableTranspose()
621 static bool isOptimizableTranspose(Fortran::evaluate::Expr<T> expr) { in isOptimizableTranspose()
638 Fortran::lower::AbstractConverter &converter, in ScalarExprLowering()
639 Fortran::lower::SymMap &symMap, in ScalarExprLowering()
640 Fortran::lower::StatementContext &stmtCtx, in ScalarExprLowering()
646 ExtValue genExtAddr(const Fortran::lower::SomeExpr &expr) { in genExtAddr()
652 ExtValue genBoxArg(const Fortran::lower::SomeExpr &expr) { in genBoxArg()
660 ExtValue genExtValue(const Fortran::lower::SomeExpr &expr) { in genExtValue()
667 genMutableBoxValue(const Fortran::lower::SomeExpr &expr) { in genMutableBoxValue()
692 ExtValue genMutableBoxValueImpl(const Fortran::evaluate::NullPointer &) { in genMutableBoxValueImpl()
711 genMutableBoxValueImpl(const Fortran::evaluate::FunctionRef<T> &funRef) { in genMutableBoxValueImpl()
717 genMutableBoxValueImpl(const Fortran::evaluate::Designator<T> &designator) { in genMutableBoxValueImpl()
719 Fortran::common::visitors{ in genMutableBoxValueImpl()
720 [&](const Fortran::evaluate::SymbolRef &sym) -> ExtValue { in genMutableBoxValueImpl()
723 [&](const Fortran::evaluate::Component &comp) -> ExtValue { in genMutableBoxValueImpl()
734 ExtValue genMutableBoxValueImpl(const Fortran::evaluate::Expr<T> &expr) { in genMutableBoxValueImpl()
754 converter.genType(Fortran::common::TypeCategory::Integer, KIND); in genIntegerConstant()
767 mlir::Type fltTy = Fortran::lower::convertReal(context, KIND); in genRealConstant()
823 ExtValue gen(Fortran::semantics::SymbolRef sym) { in gen()
824 if (Fortran::lower::SymbolBox val = symMap.lookupSymbol(sym)) in gen()
826 [&](const Fortran::lower::SymbolBox::PointerOrAllocatable &boxAddr) { in gen()
839 ExtValue genval(Fortran::semantics::SymbolRef sym) { in genval()
849 if (Fortran::semantics::IsFunctionResult(sym)) { in genval()
860 ExtValue genval(const Fortran::evaluate::BOZLiteralConstant &) { in genval()
867 ExtValue genval(const Fortran::evaluate::ProcedureDesignator &proc) { in genval()
869 if (const Fortran::evaluate::SpecificIntrinsic *intrinsic = in genval()
872 Fortran::lower::translateSignature(proc, converter); in genval()
880 Fortran::lower::getUnrestrictedIntrinsicSymbolRefAttr( in genval()
886 const Fortran::semantics::Symbol *symbol = proc.GetSymbol(); in genval()
890 if (Fortran::semantics::IsDummy(*symbol)) { in genval()
891 Fortran::lower::SymbolBox val = symMap.lookupSymbol(*symbol); in genval()
901 Fortran::lower::getOrDeclareFunction(name, proc, converter); in genval()
912 if (Fortran::lower::mustPassLengthWithDummyProcedure(proc, converter)) { in genval()
916 Fortran::evaluate::DynamicType resultType = proc.GetType().value(); in genval()
936 ExtValue genval(const Fortran::evaluate::NullPointer &) { in genval()
941 isDerivedTypeWithLenParameters(const Fortran::semantics::Symbol &sym) { in isDerivedTypeWithLenParameters()
942 if (const Fortran::semantics::DeclTypeSpec *declTy = sym.GetType()) in isDerivedTypeWithLenParameters()
943 if (const Fortran::semantics::DerivedTypeSpec *derived = in isDerivedTypeWithLenParameters()
945 return Fortran::semantics::CountLenParameters(*derived) > 0; in isDerivedTypeWithLenParameters()
949 static bool isBuiltinCPtr(const Fortran::semantics::Symbol &sym) { in isBuiltinCPtr()
950 if (const Fortran::semantics::DeclTypeSpec *declType = sym.GetType()) in isBuiltinCPtr()
951 if (const Fortran::semantics::DerivedTypeSpec *derived = in isBuiltinCPtr()
953 return Fortran::semantics::IsIsoCType(derived); in isBuiltinCPtr()
960 const Fortran::evaluate::StructureConstructor &ctor) { in genStructComponentInInitializer()
970 if (sym->test(Fortran::semantics::Symbol::Flag::ParentComp)) in genStructComponentInInitializer()
980 if (Fortran::semantics::IsAllocatable(sym)) in genStructComponentInInitializer()
983 if (Fortran::semantics::IsPointer(sym)) { in genStructComponentInInitializer()
984 mlir::Value initialTarget = Fortran::lower::genInitialDataTarget( in genStructComponentInInitializer()
998 mlir::Value addr = fir::getBase(Fortran::lower::genExtAddrInInitializer( in genStructComponentInInitializer()
1014 Fortran::lower::builtin::cptrFieldName; in genStructComponentInInitializer()
1045 ExtValue genval(const Fortran::evaluate::StructureConstructor &ctor) { in genval()
1055 const Fortran::semantics::Symbol &sym = *value.first; in genval()
1056 const Fortran::lower::SomeExpr &expr = value.second.value(); in genval()
1059 if (sym.test(Fortran::semantics::Symbol::Flag::ParentComp)) in genval()
1084 Fortran::lower::createSomeArrayAssignment(converter, to, expr, in genval()
1088 Fortran::lower::createSomeArrayAssignment(converter, to, expr, in genval()
1097 Fortran::lower::associateMutableBox( in genval()
1112 ExtValue genval(const Fortran::evaluate::ImpliedDoIndex &var) { in genval()
1116 ExtValue genval(const Fortran::evaluate::DescriptorInquiry &desc) { in genval()
1122 using ResTy = Fortran::evaluate::DescriptorInquiry::Result; in genval()
1127 case Fortran::evaluate::DescriptorInquiry::Field::Len: in genval()
1129 case Fortran::evaluate::DescriptorInquiry::Field::LowerBound: in genval()
1133 case Fortran::evaluate::DescriptorInquiry::Field::Extent: in genval()
1136 case Fortran::evaluate::DescriptorInquiry::Field::Rank: in genval()
1138 case Fortran::evaluate::DescriptorInquiry::Field::Stride: in genval()
1145 ExtValue genval(const Fortran::evaluate::TypeParamInquiry &) { in genval()
1155 ExtValue genval(const Fortran::evaluate::ComplexComponent<KIND> &part) { in genval()
1160 ExtValue genval(const Fortran::evaluate::Negate<Fortran::evaluate::Type< in genval()
1161 Fortran::common::TypeCategory::Integer, KIND>> &op) { in genval()
1168 ExtValue genval(const Fortran::evaluate::Negate<Fortran::evaluate::Type< in genval()
1169 Fortran::common::TypeCategory::Real, KIND>> &op) { in genval()
1173 ExtValue genval(const Fortran::evaluate::Negate<Fortran::evaluate::Type< in genval()
1174 Fortran::common::TypeCategory::Complex, KIND>> &op) { in genval()
1196 ExtValue genval(const Fortran::evaluate::GenBinEvOp<Fortran::evaluate::Type< \
1197 Fortran::common::TypeCategory::GenBinTyCat, KIND>> &x) { \
1214 template <Fortran::common::TypeCategory TC, int KIND> in GENBIN()
1216 const Fortran::evaluate::Power<Fortran::evaluate::Type<TC, KIND>> &op) { in GENBIN()
1220 return Fortran::lower::genPow(builder, getLoc(), ty, lhs, rhs); in GENBIN()
1223 template <Fortran::common::TypeCategory TC, int KIND>
1225 const Fortran::evaluate::RealToIntPower<Fortran::evaluate::Type<TC, KIND>> in genval()
1230 return Fortran::lower::genPow(builder, getLoc(), ty, lhs, rhs); in genval()
1234 ExtValue genval(const Fortran::evaluate::ComplexConstructor<KIND> &op) { in genval()
1241 ExtValue genval(const Fortran::evaluate::Concat<KIND> &op) { in genval()
1253 template <Fortran::common::TypeCategory TC, int KIND>
1255 genval(const Fortran::evaluate::Extremum<Fortran::evaluate::Type<TC, KIND>> in genval()
1260 case Fortran::evaluate::Ordering::Greater: in genval()
1261 return Fortran::lower::genMax(builder, getLoc(), in genval()
1263 case Fortran::evaluate::Ordering::Less: in genval()
1264 return Fortran::lower::genMin(builder, getLoc(), in genval()
1266 case Fortran::evaluate::Ordering::Equal: in genval()
1297 ExtValue genval(const Fortran::evaluate::SetLength<KIND> &x) { in genval()
1304 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type< in genval()
1305 Fortran::common::TypeCategory::Integer, KIND>> &op) { in genval()
1310 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type< in genval()
1311 Fortran::common::TypeCategory::Real, KIND>> &op) { in genval()
1316 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type< in genval()
1317 Fortran::common::TypeCategory::Complex, KIND>> &op) { in genval()
1321 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type< in genval()
1322 Fortran::common::TypeCategory::Character, KIND>> &op) { in genval()
1327 genval(const Fortran::evaluate::Relational<Fortran::evaluate::SomeType> &op) { in genval()
1331 template <Fortran::common::TypeCategory TC1, int KIND,
1332 Fortran::common::TypeCategory TC2>
1334 genval(const Fortran::evaluate::Convert<Fortran::evaluate::Type<TC1, KIND>, in genval()
1341 if constexpr (TC1 == Fortran::common::TypeCategory::Character && in genval()
1393 ExtValue genval(const Fortran::evaluate::Parentheses<A> &op) { in genval()
1402 ExtValue genval(const Fortran::evaluate::Not<KIND> &op) { in genval()
1411 ExtValue genval(const Fortran::evaluate::LogicalOperation<KIND> &op) { in genval()
1418 case Fortran::evaluate::LogicalOperator::And: in genval()
1420 case Fortran::evaluate::LogicalOperator::Or: in genval()
1422 case Fortran::evaluate::LogicalOperator::Eqv: in genval()
1425 case Fortran::evaluate::LogicalOperator::Neqv: in genval()
1428 case Fortran::evaluate::LogicalOperator::Not: in genval()
1436 template <Fortran::common::TypeCategory TC, int KIND>
1438 const Fortran::evaluate::Scalar<Fortran::evaluate::Type<TC, KIND>> in genScalarLit()
1440 if constexpr (TC == Fortran::common::TypeCategory::Integer) { in genScalarLit()
1442 } else if constexpr (TC == Fortran::common::TypeCategory::Logical) { in genScalarLit()
1444 } else if constexpr (TC == Fortran::common::TypeCategory::Real) { in genScalarLit()
1467 } else if constexpr (TC == Fortran::common::TypeCategory::Complex) { in genScalarLit()
1469 Fortran::evaluate::Type<Fortran::common::TypeCategory::Real, KIND>; in genScalarLit()
1470 Fortran::evaluate::ComplexConstructor<KIND> ctor( in genScalarLit()
1471 Fortran::evaluate::Expr<TR>{ in genScalarLit()
1472 Fortran::evaluate::Constant<TR>{value.REAL()}}, in genScalarLit()
1473 Fortran::evaluate::Expr<TR>{ in genScalarLit()
1474 Fortran::evaluate::Constant<TR>{value.AIMAG()}}); in genScalarLit()
1499 template <Fortran::common::TypeCategory TC, int KIND>
1501 genRawLit(const Fortran::evaluate::Scalar<Fortran::evaluate::Type<TC, KIND>> in genRawLit()
1505 if constexpr (TC == Fortran::common::TypeCategory::Integer) { in genRawLit()
1508 } else if constexpr (TC == Fortran::common::TypeCategory::Logical) { in genRawLit()
1510 converter.genType(Fortran::common::TypeCategory::Integer, KIND); in genRawLit()
1512 } else if constexpr (TC == Fortran::common::TypeCategory::Real) { in genRawLit()
1518 } else if constexpr (TC == Fortran::common::TypeCategory::Complex) { in genRawLit()
1536 genScalarLit(const Fortran::evaluate::Scalar<Fortran::evaluate::Type< in genScalarLit()
1537 Fortran::common::TypeCategory::Character, KIND>> &value, in genScalarLit()
1599 template <Fortran::common::TypeCategory TC, int KIND>
1601 const Fortran::evaluate::Constant<Fortran::evaluate::Type<TC, KIND>> in genArrayLit()
1605 Fortran::evaluate::ConstantSubscript size = in genArrayLit()
1606 Fortran::evaluate::GetSize(con.shape()); in genArrayLit()
1609 if constexpr (TC == Fortran::common::TypeCategory::Character) in genArrayLit()
1625 if constexpr (TC == Fortran::common::TypeCategory::Character) { in genArrayLit()
1632 Fortran::evaluate::ConstantSubscripts subscripts = con.lbounds(); in genArrayLit()
1640 if constexpr (TC == Fortran::common::TypeCategory::Character) { in genArrayLit()
1663 Fortran::evaluate::ConstantSubscripts nextSubscripts = subscripts; in genArrayLit()
1697 const Fortran::evaluate::Constant<Fortran::evaluate::SomeDerived> &con) { in genArrayLit()
1700 Fortran::evaluate::ConstantSubscript size = in genArrayLit()
1701 Fortran::evaluate::GetSize(con.shape()); in genArrayLit()
1714 Fortran::evaluate::ConstantSubscripts subscripts = con.lbounds(); in genArrayLit()
1726 template <Fortran::common::TypeCategory TC, int KIND>
1728 genval(const Fortran::evaluate::Constant<Fortran::evaluate::Type<TC, KIND>> in genval()
1732 std::optional<Fortran::evaluate::Scalar<Fortran::evaluate::Type<TC, KIND>>> in genval()
1735 if constexpr (TC == Fortran::common::TypeCategory::Character) { in genval()
1742 const Fortran::evaluate::Constant<Fortran::evaluate::SomeDerived> &con) { in genval()
1752 ExtValue genval(const Fortran::evaluate::ArrayConstructor<A> &) { in genval()
1756 ExtValue gen(const Fortran::evaluate::ComplexPart &x) { in gen()
1766 x.part() == Fortran::evaluate::ComplexPart::Part::RE ? 0 : 1); in gen()
1771 ExtValue genval(const Fortran::evaluate::ComplexPart &x) { in genval()
1776 ExtValue gen(const Fortran::evaluate::Substring &s) { in gen()
1779 Fortran::common::visitors{ in gen()
1780 [&](const Fortran::evaluate::DataRef &x) { return gen(x); }, in gen()
1781 [&](const Fortran::evaluate::StaticDataObject::Pointer &p) in gen()
1797 if (Fortran::evaluate::MaybeExtentExpr upperBound = s.upper()) { in gen()
1817 ExtValue genval(const Fortran::evaluate::Substring &ss) { in genval()
1823 ExtValue genval(const Fortran::evaluate::Subscript &subs) { in genval()
1824 if (auto *s = std::get_if<Fortran::evaluate::IndirectSubscriptIntegerExpr>( in genval()
1832 ExtValue genSubscript(const Fortran::evaluate::Subscript &subs) { in genSubscript()
1836 ExtValue gen(const Fortran::evaluate::DataRef &dref) { in gen()
1839 ExtValue genval(const Fortran::evaluate::DataRef &dref) { in genval()
1850 static Fortran::evaluate::DataRef const *
1851 reverseComponents(const Fortran::evaluate::Component &cmpt, in reverseComponents()
1852 std::list<const Fortran::evaluate::Component *> &list) { in reverseComponents()
1853 if (!getLastSym(cmpt).test(Fortran::semantics::Symbol::Flag::ParentComp)) in reverseComponents()
1856 Fortran::common::visitors{ in reverseComponents()
1857 [&](const Fortran::evaluate::Component &x) { in reverseComponents()
1858 if (Fortran::semantics::IsAllocatableOrPointer(getLastSym(x))) in reverseComponents()
1868 ExtValue genComponent(const Fortran::evaluate::Component &cmpt) { in genComponent()
1869 std::list<const Fortran::evaluate::Component *> list; in genComponent()
1870 const Fortran::evaluate::DataRef *base = reverseComponents(cmpt, list); in genComponent()
1877 for (const Fortran::evaluate::Component *field : list) { in genComponent()
1879 const Fortran::semantics::Symbol &sym = getLastSym(*field); in genComponent()
1892 ExtValue gen(const Fortran::evaluate::Component &cmpt) { in gen()
1903 ExtValue genval(const Fortran::evaluate::Component &cmpt) { in genval()
1927 ExtValue genval(const Fortran::semantics::Bound &bound) { in genval()
1929 Fortran::semantics::MaybeSubscriptIntExpr sub = bound.GetExplicit(); in genval()
1937 static bool isSlice(const Fortran::evaluate::ArrayRef &aref) { in isSlice()
1938 for (const Fortran::evaluate::Subscript &sub : aref.subscript()) in isSlice()
1939 if (std::holds_alternative<Fortran::evaluate::Triplet>(sub.u)) in isSlice()
1946 const Fortran::evaluate::ArrayRef &aref) { in genCoordinateOp()
1985 const Fortran::evaluate::ArrayRef &aref) { in genOffsetAndCoordinateOp()
2070 const Fortran::evaluate::ArrayRef &aref) { in genArrayCoorOp()
2095 ExtValue gen(const Fortran::evaluate::ArrayRef &aref) { in gen()
2115 ExtValue genval(const Fortran::evaluate::ArrayRef &aref) { in genval()
2119 ExtValue gen(const Fortran::evaluate::CoarrayRef &coref) { in gen()
2120 return Fortran::lower::CoarrayExprHelper{converter, getLoc(), symMap} in gen()
2124 ExtValue genval(const Fortran::evaluate::CoarrayRef &coref) { in genval()
2125 return Fortran::lower::CoarrayExprHelper{converter, getLoc(), symMap} in genval()
2130 ExtValue gen(const Fortran::evaluate::Designator<A> &des) { in gen()
2134 ExtValue genval(const Fortran::evaluate::Designator<A> &des) { in genval()
2138 mlir::Type genType(const Fortran::evaluate::DynamicType &dt) { in genType()
2139 if (dt.category() != Fortran::common::TypeCategory::Derived) in genType()
2146 ExtValue genFunctionRef(const Fortran::evaluate::FunctionRef<A> &funcRef) { in genFunctionRef()
2156 ExtValue gen(const Fortran::evaluate::FunctionRef<A> &funcRef) { in gen()
2164 lowerIntrinsicArgumentAsInquired(const Fortran::lower::SomeExpr &expr) { in lowerIntrinsicArgumentAsInquired()
2165 if (Fortran::evaluate::IsAllocatableOrPointerObject( in lowerIntrinsicArgumentAsInquired()
2170 if (Fortran::evaluate::IsVariable(expr) && isArray(expr) && in lowerIntrinsicArgumentAsInquired()
2171 !Fortran::evaluate::UnwrapWholeSymbolOrComponentDataRef(expr)) in lowerIntrinsicArgumentAsInquired()
2179 ExtValue lowerIntrinsicArgumentAsBox(const Fortran::lower::SomeExpr &expr) { in lowerIntrinsicArgumentAsBox()
2190 const Fortran::evaluate::ProcedureRef &procRef, in genIntrinsicRef()
2192 llvm::Optional<const Fortran::evaluate::SpecificIntrinsic> intrinsic = in genIntrinsicRef()
2200 if (intrinsic && Fortran::lower::intrinsicRequiresCustomOptionalHandling( in genIntrinsicRef()
2204 auto prepareOptionalArg = [&](const Fortran::lower::SomeExpr &expr) { in genIntrinsicRef()
2210 auto prepareOtherArg = [&](const Fortran::lower::SomeExpr &expr) { in genIntrinsicRef()
2213 Fortran::lower::prepareCustomIntrinsicArgument( in genIntrinsicRef()
2226 return Fortran::lower::lowerCustomIntrinsic( in genIntrinsicRef()
2231 const Fortran::lower::IntrinsicArgumentLoweringRules *argLowering = in genIntrinsicRef()
2232 Fortran::lower::getIntrinsicArgumentLowering(name); in genIntrinsicRef()
2235 Fortran::evaluate::UnwrapExpr<Fortran::lower::SomeExpr>(arg.value()); in genIntrinsicRef()
2238 operands.emplace_back(Fortran::lower::getAbsentIntrinsicArgument()); in genIntrinsicRef()
2247 Fortran::lower::ArgLoweringRule argRules = in genIntrinsicRef()
2248 Fortran::lower::lowerIntrinsicArgumentAs(*argLowering, arg.index()); in genIntrinsicRef()
2250 Fortran::evaluate::MayBePassedAsAbsentOptional( in genIntrinsicRef()
2255 case Fortran::lower::LowerIntrinsicArgAs::Value: in genIntrinsicRef()
2259 case Fortran::lower::LowerIntrinsicArgAs::Addr: in genIntrinsicRef()
2263 case Fortran::lower::LowerIntrinsicArgAs::Box: in genIntrinsicRef()
2267 case Fortran::lower::LowerIntrinsicArgAs::Inquired: in genIntrinsicRef()
2274 case Fortran::lower::LowerIntrinsicArgAs::Value: in genIntrinsicRef()
2277 case Fortran::lower::LowerIntrinsicArgAs::Addr: in genIntrinsicRef()
2280 case Fortran::lower::LowerIntrinsicArgAs::Box: in genIntrinsicRef()
2283 case Fortran::lower::LowerIntrinsicArgAs::Inquired: in genIntrinsicRef()
2290 return Fortran::lower::genIntrinsicCall(builder, getLoc(), name, resultType, in genIntrinsicRef()
2296 isStatementFunctionCall(const Fortran::evaluate::ProcedureRef &procRef) { in isStatementFunctionCall()
2297 if (const Fortran::semantics::Symbol *symbol = procRef.proc().GetSymbol()) in isStatementFunctionCall()
2299 symbol->detailsIf<Fortran::semantics::SubprogramDetails>()) in isStatementFunctionCall()
2305 ExtValue genStmtFunctionRef(const Fortran::evaluate::ProcedureRef &procRef) { in genStmtFunctionRef()
2306 const Fortran::semantics::Symbol *symbol = procRef.proc().GetSymbol(); in genStmtFunctionRef()
2308 const auto &details = symbol->get<Fortran::semantics::SubprogramDetails>(); in genStmtFunctionRef()
2329 if (const Fortran::semantics::DeclTypeSpec *type = arg->GetType()) in genStmtFunctionRef()
2330 if (type->category() == Fortran::semantics::DeclTypeSpec::Character) in genStmtFunctionRef()
2331 if (const Fortran::semantics::MaybeIntExpr &lenExpr = in genStmtFunctionRef()
2345 for (const Fortran::semantics::SymbolRef &sym : in genStmtFunctionRef()
2346 Fortran::evaluate::CollectSymbols(*details.stmtFunction())) in genStmtFunctionRef()
2348 sym->detailsIf<Fortran::semantics::HostAssocDetails>()) in genStmtFunctionRef()
2442 ExtValue genProcedureRef(const Fortran::evaluate::ProcedureRef &procRef, in genProcedureRef()
2458 ExtValue genCallOpAndResult(Fortran::lower::CallerInterface &caller, in genCallOpAndResult()
2462 using PassBy = Fortran::lower::CallerInterface::PassEntityBy; in genCallOpAndResult()
2468 Fortran::lower::mapCallInterfaceSymbols(converter, caller, symMap); in genCallOpAndResult()
2475 if (const Fortran::semantics::Symbol *sym = in genCallOpAndResult()
2500 caller.walkResultExtents([&](const Fortran::lower::SomeExpr &e) { in genCallOpAndResult()
2503 caller.walkResultLengths([&](const Fortran::lower::SomeExpr &e) { in genCallOpAndResult()
2551 if (std::optional<Fortran::lower::CallInterface< in genCallOpAndResult()
2552 Fortran::lower::CallerInterface>::PassedEntity> in genCallOpAndResult()
2712 ExtValue genTempExtAddr(const Fortran::lower::SomeExpr &expr) { in genTempExtAddr()
2792 const Fortran::lower::CallerInterface::PassedEntity &arg, in genCopyIn()
2860 prepareActualThatMayBeAbsent(const Fortran::lower::SomeExpr &expr) { in prepareActualThatMayBeAbsent()
2862 if (Fortran::evaluate::IsAllocatableOrPointerObject( in prepareActualThatMayBeAbsent()
2911 Fortran::lower::getAdaptToByRefAttr(builder)}); in createScalarTempForArgThatMayBeAbsent()
2919 Fortran::lower::getAdaptToByRefAttr(builder)}); in createScalarTempForArgThatMayBeAbsent()
2925 return type->category() == Fortran::common::TypeCategory::Character; in isCharacterType()
2935 const Fortran::lower::SomeExpr &expr, in prepareActualToBaseAddressLike()
2936 const Fortran::lower::CallerInterface::PassedEntity &arg, in prepareActualToBaseAddressLike()
2940 const bool actualArgIsVariable = Fortran::evaluate::IsVariable(expr); in prepareActualToBaseAddressLike()
2948 byValue && Fortran::evaluate::IsActuallyConstant(expr) && in prepareActualToBaseAddressLike()
2952 (byValue || (isArray && !Fortran::evaluate::IsSimplyContiguous( in prepareActualToBaseAddressLike()
2961 if (arg.isOptional() && Fortran::evaluate::MayBePassedAsAbsentOptional( in prepareActualToBaseAddressLike()
3021 ExtValue genRawProcedureRef(const Fortran::evaluate::ProcedureRef &procRef, in genRawProcedureRef()
3028 if (const Fortran::evaluate::SpecificIntrinsic *intrinsic = in genRawProcedureRef()
3038 Fortran::lower::CallerInterface caller(procRef, converter); in genRawProcedureRef()
3039 using PassBy = Fortran::lower::CallerInterface::PassEntityBy; in genRawProcedureRef()
3049 for (const Fortran::lower::CallInterface< in genRawProcedureRef()
3050 Fortran::lower::CallerInterface>::PassedEntity &arg : in genRawProcedureRef()
3073 if (Fortran::evaluate::UnwrapExpr<Fortran::evaluate::NullPointer>( in genRawProcedureRef()
3093 !Fortran::evaluate::IsObjectPointer( in genRawProcedureRef()
3104 Fortran::lower::associateMutableBox(converter, loc, pointer, *expr, in genRawProcedureRef()
3159 if (arg.isOptional() && Fortran::evaluate::IsAllocatableOrPointerObject( in genRawProcedureRef()
3184 Fortran::evaluate::IsVariable(*expr) in genRawProcedureRef()
3220 ExtValue genval(const Fortran::evaluate::FunctionRef<A> &funcRef) { in genval()
3227 ExtValue genval(const Fortran::evaluate::ProcedureRef &procRef) { in genval()
3245 bool isTransformationalRef(const Fortran::evaluate::FunctionRef<T> &funcRef) { in isTransformationalRef()
3249 bool isTransformationalRef(Fortran::evaluate::Expr<T> expr) { in isTransformationalRef()
3256 return Fortran::lower::createSomeArrayTempValue(converter, toEvExpr(x), in asArray()
3263 ExtValue asArrayArg(const Fortran::evaluate::Expr<A> &x) { in asArrayArg()
3267 ExtValue asArrayArg(const Fortran::evaluate::Expr<A> &x, const B &y) { in asArrayArg()
3271 ExtValue asArrayArg(const Fortran::evaluate::Designator<A> &, const B &x) { in asArrayArg()
3275 return Fortran::lower::createBoxValue(getLoc(), converter, someExpr, symMap, in asArrayArg()
3286 ExtValue gen(const Fortran::evaluate::Expr<A> &x) { in gen()
3291 Fortran::evaluate::UnwrapWholeSymbolOrComponentDataRef(x) || in gen()
3299 ExtValue genval(const Fortran::evaluate::Expr<A> &x) { in genval()
3300 if (isScalar(x) || Fortran::evaluate::UnwrapWholeSymbolDataRef(x) || in genval()
3307 ExtValue genval(const Fortran::evaluate::Expr<Fortran::evaluate::Type< in genval()
3308 Fortran::common::TypeCategory::Logical, KIND>> &exp) { in genval()
3313 std::tuple<Fortran::evaluate::ComplexPart, Fortran::evaluate::Substring,
3314 Fortran::evaluate::DataRef, Fortran::evaluate::Component,
3315 Fortran::evaluate::ArrayRef, Fortran::evaluate::CoarrayRef,
3316 Fortran::semantics::SymbolRef>;
3318 static constexpr bool inRefSet = Fortran::common::HasMember<A, RefSet>;
3337 std::is_same_v<B, Fortran::evaluate::Expr<A>> ||
3338 std::is_same_v<B, Fortran::evaluate::Designator<A>> ||
3339 std::is_same_v<B, Fortran::evaluate::FunctionRef<A>>,
3347 Fortran::lower::AbstractConverter &converter;
3349 Fortran::lower::StatementContext &stmtCtx;
3350 Fortran::lower::SymMap &symMap;
3360 Fortran::common::ScopedSet(semant, PushVal);
3534 using ImplicitSubscripts = Fortran::lower::details::ImplicitSubscripts;
3535 using PathComponent = Fortran::lower::PathComponent;
3538 using IterationSpace = Fortran::lower::IterationSpace;
3539 using IterSpace = const Fortran::lower::IterationSpace &;
3543 using CC = Fortran::lower::GenerateElementalArrayFunc;
3549 std::variant<std::monostate, const Fortran::evaluate::ArrayRef *,
3550 const Fortran::evaluate::DataRef *>;
3551 using ComponentPath = Fortran::lower::ComponentPath;
3561 static void lowerArrayAssignment(Fortran::lower::AbstractConverter &converter, in lowerArrayAssignment()
3562 Fortran::lower::SymMap &symMap, in lowerArrayAssignment()
3563 Fortran::lower::StatementContext &stmtCtx, in lowerArrayAssignment()
3601 Fortran::lower::AbstractConverter &converter, in lowerAnyMaskedArrayAssignment()
3602 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx, in lowerAnyMaskedArrayAssignment()
3603 const Fortran::lower::SomeExpr &lhs, const Fortran::lower::SomeExpr &rhs, in lowerAnyMaskedArrayAssignment()
3604 Fortran::lower::ExplicitIterSpace &explicitSpace, in lowerAnyMaskedArrayAssignment()
3605 Fortran::lower::ImplicitIterSpace &implicitSpace) { in lowerAnyMaskedArrayAssignment()
3627 Fortran::lower::AbstractConverter &converter, in lowerArrayOfPointerAssignment()
3628 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx, in lowerArrayOfPointerAssignment()
3629 const Fortran::lower::SomeExpr &lhs, const Fortran::lower::SomeExpr &rhs, in lowerArrayOfPointerAssignment()
3630 Fortran::lower::ExplicitIterSpace &explicitSpace, in lowerArrayOfPointerAssignment()
3631 Fortran::lower::ImplicitIterSpace &implicitSpace, in lowerArrayOfPointerAssignment()
3650 const Fortran::lower::SomeExpr &lhs, const Fortran::lower::SomeExpr &rhs, in lowerArrayOfPointerAssignment()
3655 (Fortran::evaluate::UnwrapWholeSymbolOrComponentDataRef(rhs) && in lowerArrayOfPointerAssignment()
3656 Fortran::evaluate::IsAllocatableOrPointerObject( in lowerArrayOfPointerAssignment()
3671 Fortran::lower::AbstractConverter &converter, in lowerAllocatableArrayAssignment()
3672 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx, in lowerAllocatableArrayAssignment()
3673 const Fortran::lower::SomeExpr &lhs, const Fortran::lower::SomeExpr &rhs, in lowerAllocatableArrayAssignment()
3674 Fortran::lower::ExplicitIterSpace &explicitSpace, in lowerAllocatableArrayAssignment()
3675 Fortran::lower::ImplicitIterSpace &implicitSpace) { in lowerAllocatableArrayAssignment()
3719 void lowerAllocatableArrayAssignment(const Fortran::lower::SomeExpr &lhs, in lowerAllocatableArrayAssignment()
3720 const Fortran::lower::SomeExpr &rhs) { in lowerAllocatableArrayAssignment()
3728 Fortran::lower::createMutableBox(loc, converter, lhs, symMap); in lowerAllocatableArrayAssignment()
3753 Fortran::evaluate::UnwrapWholeSymbolOrComponentDataRef(rhs)) { in lowerAllocatableArrayAssignment()
3777 lowerBoxedArrayExpression(Fortran::lower::AbstractConverter &converter, in lowerBoxedArrayExpression()
3778 Fortran::lower::SymMap &symMap, in lowerBoxedArrayExpression()
3779 Fortran::lower::StatementContext &stmtCtx, in lowerBoxedArrayExpression()
3780 const Fortran::lower::SomeExpr &expr) { in lowerBoxedArrayExpression()
3786 ExtValue lowerBoxedArrayExpr(const Fortran::lower::SomeExpr &exp) { in lowerBoxedArrayExpr()
3802 lowerNewArrayExpression(Fortran::lower::AbstractConverter &converter, in lowerNewArrayExpression()
3803 Fortran::lower::SymMap &symMap, in lowerNewArrayExpression()
3804 Fortran::lower::StatementContext &stmtCtx, in lowerNewArrayExpression()
3805 const Fortran::lower::SomeExpr &expr) { in lowerNewArrayExpression()
3831 Fortran::lower::AbstractConverter &converter, in lowerLazyArrayExpression()
3832 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx, in lowerLazyArrayExpression()
3833 const Fortran::lower::SomeExpr &expr, mlir::Value raggedHeader) { in lowerLazyArrayExpression()
3841 void lowerLazyArrayExpression(const Fortran::lower::SomeExpr &expr, in lowerLazyArrayExpression()
3909 lowerElementalUserAssignment(Fortran::lower::AbstractConverter &converter, in lowerElementalUserAssignment()
3910 Fortran::lower::SymMap &symMap, in lowerElementalUserAssignment()
3911 Fortran::lower::StatementContext &stmtCtx, in lowerElementalUserAssignment()
3912 Fortran::lower::ExplicitIterSpace &explicitSpace, in lowerElementalUserAssignment()
3913 Fortran::lower::ImplicitIterSpace &implicitSpace, in lowerElementalUserAssignment()
3914 const Fortran::evaluate::ProcedureRef &procRef) { in lowerElementalUserAssignment()
3924 Fortran::lower::CallerInterface(procRef, converter).getFuncOp(); in lowerElementalUserAssignment()
3929 const Fortran::lower::SomeExpr &lhs, in lowerElementalUserAssignment()
3930 const Fortran::lower::SomeExpr &rhs) { in lowerElementalUserAssignment()
3963 lowerElementalSubroutine(Fortran::lower::AbstractConverter &converter, in lowerElementalSubroutine()
3964 Fortran::lower::SymMap &symMap, in lowerElementalSubroutine()
3965 Fortran::lower::StatementContext &stmtCtx, in lowerElementalSubroutine()
3966 const Fortran::lower::SomeExpr &call) { in lowerElementalSubroutine()
3975 void lowerElementalSubroutine(const Fortran::lower::SomeExpr &call) { in lowerElementalSubroutine()
3984 ExtValue lowerScalarAssignment(const Fortran::lower::SomeExpr &lhs, in lowerScalarAssignment()
3985 const Fortran::lower::SomeExpr &rhs) { in lowerScalarAssignment()
4021 Fortran::lower::AbstractConverter &converter, in lowerScalarUserAssignment()
4022 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx, in lowerScalarUserAssignment()
4023 Fortran::lower::ExplicitIterSpace &explicitIterSpace, in lowerScalarUserAssignment()
4025 const Fortran::lower::SomeExpr &lhs, in lowerScalarUserAssignment()
4026 const Fortran::lower::SomeExpr &rhs) { in lowerScalarUserAssignment()
4027 Fortran::lower::ImplicitIterSpace implicit; in lowerScalarUserAssignment()
4035 const Fortran::lower::SomeExpr &lhs, in lowerScalarUserAssignment()
4036 const Fortran::lower::SomeExpr &rhs) { in lowerScalarUserAssignment()
4083 void determineShapeOfDest(const Fortran::lower::SomeExpr &lhs) { in determineShapeOfDest()
4090 if (std::optional<Fortran::evaluate::ConstantSubscripts> constantShape = in determineShapeOfDest()
4091 Fortran::evaluate::GetConstantExtents(converter.getFoldingContext(), in determineShapeOfDest()
4093 for (Fortran::common::ConstantSubscript extent : *constantShape) in determineShapeOfDest()
4097 bool genShapeFromDataRef(const Fortran::semantics::Symbol &x) { in genShapeFromDataRef()
4100 bool genShapeFromDataRef(const Fortran::evaluate::CoarrayRef &) { in genShapeFromDataRef()
4104 bool genShapeFromDataRef(const Fortran::evaluate::Component &x) { in genShapeFromDataRef()
4107 bool genShapeFromDataRef(const Fortran::evaluate::ArrayRef &x) { in genShapeFromDataRef()
4122 std::visit(Fortran::common::visitors{ in genShapeFromDataRef()
4123 [&](const Fortran::evaluate::Triplet &trip) { in genShapeFromDataRef()
4147 bool genShapeFromDataRef(const Fortran::evaluate::NamedEntity &x) { in genShapeFromDataRef()
4152 bool genShapeFromDataRef(const Fortran::evaluate::DataRef &x) { in genShapeFromDataRef()
4160 bool determineShapeWithSlice(const Fortran::lower::SomeExpr &lhs) { in determineShapeWithSlice()
4161 LLVM_DEBUG(Fortran::lower::DumpEvaluateExpr::dump( in determineShapeWithSlice()
4165 std::optional<Fortran::evaluate::DataRef> dref = in determineShapeWithSlice()
4166 Fortran::evaluate::ExtractDataRef(lhs); in determineShapeWithSlice()
4180 ExtValue lowerArrayExpression(const Fortran::lower::SomeExpr &exp) { in lowerArrayExpression()
4193 const Fortran::evaluate::Substring *substring) { in populateBounds()
4258 CC defaultStoreToDestination(const Fortran::evaluate::Substring *substring) { in defaultStoreToDestination()
4428 mlir::Value prepareRaggedArrays(Fortran::lower::FrontEndExpr expr) { in prepareRaggedArrays()
4509 Fortran::lower::createLazyArrayTempValue(converter, *e, header, in genMasks()
4518 fir::ExtendedValue tmp = Fortran::lower::createSomeArrayTempValue( in genMasks()
4667 auto genCond = [&](Fortran::lower::FrontEndExpr e, IterSpace iters) { in genIterSpace()
4673 for (llvm::SmallVector<Fortran::lower::FrontEndExpr> maskExprs : in genIterSpace()
4797 Fortran::lower::StatementContext &getElementCtx() { in getElementCtx()
4824 if (!Fortran::evaluate::IsVariable(x)) { in genElementalArgument()
4847 const Fortran::evaluate::ProcedureRef &procRef, in genElementalIntrinsicProcRef()
4849 llvm::Optional<const Fortran::evaluate::SpecificIntrinsic> intrinsic = in genElementalIntrinsicProcRef()
4856 const Fortran::lower::IntrinsicArgumentLoweringRules *argLowering = in genElementalIntrinsicProcRef()
4857 Fortran::lower::getIntrinsicArgumentLowering(name); in genElementalIntrinsicProcRef()
4859 if (intrinsic && Fortran::lower::intrinsicRequiresCustomOptionalHandling( in genElementalIntrinsicProcRef()
4863 auto prepareOptionalArg = [&](const Fortran::lower::SomeExpr &expr) { in genElementalIntrinsicProcRef()
4878 auto prepareOtherArg = [&](const Fortran::lower::SomeExpr &expr) { in genElementalIntrinsicProcRef()
4882 Fortran::lower::prepareCustomIntrinsicArgument( in genElementalIntrinsicProcRef()
4894 return Fortran::lower::lowerCustomIntrinsic( in genElementalIntrinsicProcRef()
4902 Fortran::evaluate::UnwrapExpr<Fortran::lower::SomeExpr>(arg.value()); in genElementalIntrinsicProcRef()
4912 Fortran::lower::ArgLoweringRule argRules = in genElementalIntrinsicProcRef()
4913 Fortran::lower::lowerIntrinsicArgumentAs(*argLowering, arg.index()); in genElementalIntrinsicProcRef()
4915 Fortran::evaluate::MayBePassedAsAbsentOptional( in genElementalIntrinsicProcRef()
4920 if (argRules.lowerAs != Fortran::lower::LowerIntrinsicArgAs::Value) in genElementalIntrinsicProcRef()
4928 case Fortran::lower::LowerIntrinsicArgAs::Value: { in genElementalIntrinsicProcRef()
4932 case Fortran::lower::LowerIntrinsicArgAs::Addr: { in genElementalIntrinsicProcRef()
4937 case Fortran::lower::LowerIntrinsicArgAs::Box: { in genElementalIntrinsicProcRef()
4944 case Fortran::lower::LowerIntrinsicArgAs::Inquired: in genElementalIntrinsicProcRef()
4956 return Fortran::lower::genIntrinsicCall(builder, loc, name, retTy, args, in genElementalIntrinsicProcRef()
4963 const Fortran::evaluate::ProcedureRef &procRef, in genElementalUserDefinedProcRef()
4965 using PassBy = Fortran::lower::CallerInterface::PassEntityBy; in genElementalUserDefinedProcRef()
4968 if (const Fortran::semantics::Symbol *procSym = procRef.proc().GetSymbol()) in genElementalUserDefinedProcRef()
4969 if (!Fortran::semantics::IsPureProcedure(*procSym)) in genElementalUserDefinedProcRef()
4972 Fortran::lower::CallerInterface caller(procRef, converter); in genElementalUserDefinedProcRef()
4977 for (const Fortran::lower::CallInterface< in genElementalUserDefinedProcRef()
4978 Fortran::lower::CallerInterface>::PassedEntity &arg : in genElementalUserDefinedProcRef()
4999 if (arg.isOptional() && Fortran::evaluate::MayBePassedAsAbsentOptional( in genElementalUserDefinedProcRef()
5020 Fortran::lower::getAdaptToByRefAttr(builder)}); in genElementalUserDefinedProcRef()
5100 CC genTransposeProcRef(const Fortran::evaluate::ProcedureRef &procRef) { in genTransposeProcRef()
5138 CC genProcRef(const Fortran::evaluate::ProcedureRef &procRef, in genProcRef()
5146 if (const Fortran::evaluate::SpecificIntrinsic *intrin = in genProcRef()
5171 if (const Fortran::evaluate::SpecificIntrinsic *intrinsic = in genProcRef()
5202 CC genarr(const Fortran::evaluate::ProcedureDesignator &) { in genarr()
5205 CC genarr(const Fortran::evaluate::ProcedureRef &x) { in genarr()
5216 template <typename A, typename = std::enable_if_t<Fortran::common::HasMember<
5217 A, Fortran::evaluate::TypelessExpression>>>
5223 CC genarr(const Fortran::evaluate::Expr<A> &x) { in genarr()
5224 LLVM_DEBUG(Fortran::lower::DumpEvaluateExpr::dump(llvm::dbgs(), x)); in genarr()
5256 template <Fortran::common::TypeCategory TC1, int KIND,
5257 Fortran::common::TypeCategory TC2>
5258 CC genarr(const Fortran::evaluate::Convert<Fortran::evaluate::Type<TC1, KIND>, in genarr()
5275 CC genarr(const Fortran::evaluate::ComplexComponent<KIND> &x) { in genarr()
5287 CC genarr(const Fortran::evaluate::Parentheses<T> &x) { in genarr()
5306 CC genarr(const Fortran::evaluate::Negate<Fortran::evaluate::Type< in genarr()
5307 Fortran::common::TypeCategory::Integer, KIND>> &x) { in genarr()
5313 converter.genType(Fortran::common::TypeCategory::Integer, KIND); in genarr()
5319 CC genarr(const Fortran::evaluate::Negate<Fortran::evaluate::Type< in genarr()
5320 Fortran::common::TypeCategory::Real, KIND>> &x) { in genarr()
5328 CC genarr(const Fortran::evaluate::Negate<Fortran::evaluate::Type< in genarr()
5329 Fortran::common::TypeCategory::Complex, KIND>> &x) { in genarr()
5356 CC genarr(const Fortran::evaluate::GenBinEvOp<Fortran::evaluate::Type< \
5357 Fortran::common::TypeCategory::GenBinTyCat, KIND>> &x) { \
5374 template <Fortran::common::TypeCategory TC, int KIND> in GENBIN()
5376 const Fortran::evaluate::Power<Fortran::evaluate::Type<TC, KIND>> &x) { in GENBIN()
5384 return Fortran::lower::genPow(builder, loc, ty, lhs, rhs); in GENBIN()
5387 template <Fortran::common::TypeCategory TC, int KIND>
5389 const Fortran::evaluate::Extremum<Fortran::evaluate::Type<TC, KIND>> &x) { in genarr()
5394 case Fortran::evaluate::Ordering::Greater: in genarr()
5398 return Fortran::lower::genMax(builder, loc, in genarr()
5401 case Fortran::evaluate::Ordering::Less: in genarr()
5405 return Fortran::lower::genMin(builder, loc, in genarr()
5408 case Fortran::evaluate::Ordering::Equal: in genarr()
5413 template <Fortran::common::TypeCategory TC, int KIND>
5415 const Fortran::evaluate::RealToIntPower<Fortran::evaluate::Type<TC, KIND>> in genarr()
5424 return Fortran::lower::genPow(builder, loc, ty, lhs, rhs); in genarr()
5428 CC genarr(const Fortran::evaluate::ComplexConstructor<KIND> &x) { in genarr()
5441 CC genarr(const Fortran::evaluate::Concat<KIND> &x) { in genarr()
5460 CC genarr(const Fortran::evaluate::SetLength<KIND> &x) { in genarr()
5470 CC genarr(const Fortran::evaluate::Constant<A> &x) { in genarr()
5476 std::string globalName = Fortran::lower::mangle::mangleArrayLiteral(x); in genarr()
5494 global = Fortran::lower::createDenseGlobal( in genarr()
5503 Fortran::lower::StatementContext stmtCtx( in genarr()
5506 Fortran::lower::createSomeInitializerExpression( in genarr()
5533 static Fortran::lower::SomeExpr
5534 ignoreEvConvert(const Fortran::evaluate::Expr<Fortran::evaluate::Type< in ignoreEvConvert()
5535 Fortran::common::TypeCategory::Integer, 8>> &x) { in ignoreEvConvert()
5538 template <Fortran::common::TypeCategory FROM>
5539 static Fortran::lower::SomeExpr ignoreEvConvert( in ignoreEvConvert()
5540 const Fortran::evaluate::Convert< in ignoreEvConvert()
5541 Fortran::evaluate::Type<Fortran::common::TypeCategory::Integer, 8>, in ignoreEvConvert()
5546 static Fortran::lower::SomeExpr ignoreEvConvert(const A &x) { in ignoreEvConvert()
5555 static const Fortran::semantics::Symbol *
5556 extractSubscriptSymbol(const Fortran::evaluate::Expr<A> &x) { in extractSubscriptSymbol()
5561 static const Fortran::semantics::Symbol *
5562 extractSubscriptSymbol(const Fortran::evaluate::Designator<A> &x) { in extractSubscriptSymbol()
5563 return Fortran::evaluate::UnwrapWholeSymbolDataRef(x); in extractSubscriptSymbol()
5566 static const Fortran::semantics::Symbol *extractSubscriptSymbol(const A &x) { in extractSubscriptSymbol()
5603 : public Fortran::evaluate::AnyTraverse<HasEvArrayRefHelper> { in hasEvArrayRef()
5605 : Fortran::evaluate::AnyTraverse<HasEvArrayRefHelper>(*this) {} in hasEvArrayRef()
5606 using Fortran::evaluate::AnyTraverse<HasEvArrayRefHelper>::operator(); in hasEvArrayRef()
5607 bool operator()(const Fortran::evaluate::ArrayRef &) const { in hasEvArrayRef()
5614 CC genVectorSubscriptArrayFetch(const Fortran::lower::SomeExpr &expr, in genVectorSubscriptArrayFetch()
5617 auto saved = Fortran::common::ScopedSet(explicitSpace, nullptr); in genVectorSubscriptArrayFetch()
5654 const Fortran::evaluate::ArrayRef &x, bool atBase) { in genSliceIndices()
5668 Fortran::common::visitors{ in genSliceIndices()
5669 [&](const Fortran::evaluate::Triplet &t) { in genSliceIndices()
5719 [&](const Fortran::evaluate::IndirectSubscriptIntegerExpr &ie) { in genSliceIndices()
5835 CC genarr(const Fortran::semantics::SymbolRef &sym, in genarr()
5944 eleTy = Fortran::lower::convertReal(realTy.getContext(), in genarr()
6078 Fortran::lower::getAdaptToByRefAttr(builder)}); in genarr()
6114 genOptionalArrayFetch(const Fortran::lower::SomeExpr &expr) { in genOptionalArrayFetch()
6126 const bool isAllocOrPtr = Fortran::evaluate::IsAllocatableOrPointerObject( in genOptionalArrayFetch()
6175 CC genarrForwardOptionalArgumentToCall(const Fortran::lower::SomeExpr &expr) { in genarrForwardOptionalArgumentToCall()
6238 CC genarr(const Fortran::evaluate::ComplexPart &x, in genarr()
6249 CC genarr(const Fortran::evaluate::StaticDataObject::Pointer &, in genarr()
6255 CC genarr(const Fortran::evaluate::Substring &x, ComponentPath &components) { in genarr()
6262 CC genarr(const Fortran::evaluate::FunctionRef<T> &funRef) { in genarr()
6513 genArrayCtorInitializer(const Fortran::evaluate::Expr<A> &x, mlir::Type, in genArrayCtorInitializer()
6515 Fortran::lower::StatementContext &stmtCtx) { in genArrayCtorInitializer()
6525 genArrayCtorInitializer(const Fortran::evaluate::ImpliedDo<A> &x, in genArrayCtorInitializer()
6528 Fortran::lower::StatementContext &) { in genArrayCtorInitializer()
6555 for (const Fortran::evaluate::ArrayConstructorValue<A> &acv : x.values()) { in genArrayCtorInitializer()
6597 CC genarr(const Fortran::evaluate::ArrayConstructor<A> &x) { in genarr()
6675 CC genarr(const Fortran::evaluate::ImpliedDoIndex &) { in genarr()
6678 CC genarr(const Fortran::evaluate::TypeParamInquiry &x) { in genarr()
6682 CC genarr(const Fortran::evaluate::DescriptorInquiry &x) { in genarr()
6686 CC genarr(const Fortran::evaluate::StructureConstructor &x) { in genarr()
6696 CC genarr(const Fortran::evaluate::Not<KIND> &x) { in genarr()
6736 CC genarr(const Fortran::evaluate::LogicalOperation<KIND> &x) { in genarr()
6738 case Fortran::evaluate::LogicalOperator::And: in genarr()
6740 case Fortran::evaluate::LogicalOperator::Or: in genarr()
6742 case Fortran::evaluate::LogicalOperator::Eqv: in genarr()
6745 case Fortran::evaluate::LogicalOperator::Neqv: in genarr()
6748 case Fortran::evaluate::LogicalOperator::Not: in genarr()
6781 CC genarr(const Fortran::evaluate::Relational<Fortran::evaluate::Type< in genarr()
6782 Fortran::common::TypeCategory::Integer, KIND>> &x) { in genarr()
6786 CC genarr(const Fortran::evaluate::Relational<Fortran::evaluate::Type< in genarr()
6787 Fortran::common::TypeCategory::Character, KIND>> &x) { in genarr()
6791 CC genarr(const Fortran::evaluate::Relational<Fortran::evaluate::Type< in genarr()
6792 Fortran::common::TypeCategory::Real, KIND>> &x) { in genarr()
6797 CC genarr(const Fortran::evaluate::Relational<Fortran::evaluate::Type< in genarr()
6798 Fortran::common::TypeCategory::Complex, KIND>> &x) { in genarr()
6802 const Fortran::evaluate::Relational<Fortran::evaluate::SomeType> &r) { in genarr()
6807 CC genarr(const Fortran::evaluate::Designator<A> &des) { in genarr()
6815 return std::visit(Fortran::common::visitors{ in ranked()
6821 void extendComponent(Fortran::lower::ComponentPath &component, in extendComponent()
6875 Fortran::common::visitors{ in lowerPath()
6880 [&](const Fortran::evaluate::ComplexPart *x) { in lowerPath()
6884 x->part() == Fortran::evaluate::ComplexPart::Part::RE ? 0 in lowerPath()
6889 [&](const Fortran::evaluate::ArrayRef *x) { in lowerPath()
6890 if (Fortran::lower::isRankedArrayAccess(*x)) { in lowerPath()
6900 Fortran::common::visitors{ in lowerPath()
6901 [&](const Fortran::evaluate:: in lowerPath()
6942 [&](const Fortran::evaluate::Component *x) { in lowerPath()
7159 CC genImplicitArrayAccess(const Fortran::evaluate::NamedEntity &x, in genImplicitArrayAccess()
7194 bool tailIsPointerInPointerAssignment(const Fortran::semantics::Symbol &x, in tailIsPointerInPointerAssignment()
7196 return isPointerAssignment() && Fortran::semantics::IsPointer(x) && in tailIsPointerInPointerAssignment()
7199 bool tailIsPointerInPointerAssignment(const Fortran::evaluate::Component &x, in tailIsPointerInPointerAssignment()
7204 CC genarr(const Fortran::semantics::Symbol &x, ComponentPath &components) { in genarr()
7224 CC genarr(const Fortran::evaluate::Component &x, ComponentPath &components) { in genarr()
7236 if (!getLastSym(x).test(Fortran::semantics::Symbol::Flag::ParentComp)) in genarr()
7259 CC genarr(const Fortran::evaluate::ArrayRef &x, ComponentPath &components) { in genarr()
7261 if (Fortran::lower::isRankedArrayAccess(x)) in genarr()
7268 if (Fortran::lower::isRankedArrayAccess(x)) { in genarr()
7289 CC genarr(const Fortran::evaluate::CoarrayRef &x, ComponentPath &components) { in genarr()
7293 CC genarr(const Fortran::evaluate::NamedEntity &x, in genarr()
7299 CC genarr(const Fortran::evaluate::DataRef &x, ComponentPath &components) { in genarr()
7308 explicit ArrayExprLowering(Fortran::lower::AbstractConverter &converter, in ArrayExprLowering()
7309 Fortran::lower::StatementContext &stmtCtx, in ArrayExprLowering()
7310 Fortran::lower::SymMap &symMap) in ArrayExprLowering()
7314 explicit ArrayExprLowering(Fortran::lower::AbstractConverter &converter, in ArrayExprLowering()
7315 Fortran::lower::StatementContext &stmtCtx, in ArrayExprLowering()
7316 Fortran::lower::SymMap &symMap, in ArrayExprLowering()
7321 explicit ArrayExprLowering(Fortran::lower::AbstractConverter &converter, in ArrayExprLowering()
7322 Fortran::lower::StatementContext &stmtCtx, in ArrayExprLowering()
7323 Fortran::lower::SymMap &symMap, in ArrayExprLowering()
7325 Fortran::lower::ExplicitIterSpace *expSpace, in ArrayExprLowering()
7326 Fortran::lower::ImplicitIterSpace *impSpace) in ArrayExprLowering()
7401 Fortran::lower::AbstractConverter &converter;
7403 Fortran::lower::StatementContext &stmtCtx;
7405 Fortran::lower::SymMap &symMap;
7420 Fortran::lower::ExplicitIterSpace *explicitSpace = nullptr;
7421 Fortran::lower::ImplicitIterSpace *implicitSpace = nullptr;
7433 fir::ExtendedValue Fortran::lower::createSomeExtendedExpression( in createSomeExtendedExpression()
7434 mlir::Location loc, Fortran::lower::AbstractConverter &converter, in createSomeExtendedExpression()
7435 const Fortran::lower::SomeExpr &expr, Fortran::lower::SymMap &symMap, in createSomeExtendedExpression()
7436 Fortran::lower::StatementContext &stmtCtx) { in createSomeExtendedExpression()
7441 fir::GlobalOp Fortran::lower::createDenseGlobal( in createDenseGlobal()
7444 const Fortran::lower::SomeExpr &expr, in createDenseGlobal()
7445 Fortran::lower::AbstractConverter &converter) { in createDenseGlobal()
7447 Fortran::lower::StatementContext stmtCtx(/*prohibited=*/true); in createDenseGlobal()
7448 Fortran::lower::SymMap emptyMap; in createDenseGlobal()
7467 fir::ExtendedValue Fortran::lower::createSomeInitializerExpression( in createSomeInitializerExpression()
7468 mlir::Location loc, Fortran::lower::AbstractConverter &converter, in createSomeInitializerExpression()
7469 const Fortran::lower::SomeExpr &expr, Fortran::lower::SymMap &symMap, in createSomeInitializerExpression()
7470 Fortran::lower::StatementContext &stmtCtx) { in createSomeInitializerExpression()
7478 fir::ExtendedValue Fortran::lower::createSomeExtendedAddress( in createSomeExtendedAddress()
7479 mlir::Location loc, Fortran::lower::AbstractConverter &converter, in createSomeExtendedAddress()
7480 const Fortran::lower::SomeExpr &expr, Fortran::lower::SymMap &symMap, in createSomeExtendedAddress()
7481 Fortran::lower::StatementContext &stmtCtx) { in createSomeExtendedAddress()
7486 fir::ExtendedValue Fortran::lower::createInitializerAddress( in createInitializerAddress()
7487 mlir::Location loc, Fortran::lower::AbstractConverter &converter, in createInitializerAddress()
7488 const Fortran::lower::SomeExpr &expr, Fortran::lower::SymMap &symMap, in createInitializerAddress()
7489 Fortran::lower::StatementContext &stmtCtx) { in createInitializerAddress()
7495 void Fortran::lower::createSomeArrayAssignment( in createSomeArrayAssignment()
7496 Fortran::lower::AbstractConverter &converter, in createSomeArrayAssignment()
7497 const Fortran::lower::SomeExpr &lhs, const Fortran::lower::SomeExpr &rhs, in createSomeArrayAssignment()
7498 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) { in createSomeArrayAssignment()
7504 void Fortran::lower::createSomeArrayAssignment( in createSomeArrayAssignment()
7505 Fortran::lower::AbstractConverter &converter, const fir::ExtendedValue &lhs, in createSomeArrayAssignment()
7506 const Fortran::lower::SomeExpr &rhs, Fortran::lower::SymMap &symMap, in createSomeArrayAssignment()
7507 Fortran::lower::StatementContext &stmtCtx) { in createSomeArrayAssignment()
7512 void Fortran::lower::createSomeArrayAssignment( in createSomeArrayAssignment()
7513 Fortran::lower::AbstractConverter &converter, const fir::ExtendedValue &lhs, in createSomeArrayAssignment()
7514 const fir::ExtendedValue &rhs, Fortran::lower::SymMap &symMap, in createSomeArrayAssignment()
7515 Fortran::lower::StatementContext &stmtCtx) { in createSomeArrayAssignment()
7521 void Fortran::lower::createAnyMaskedArrayAssignment( in createAnyMaskedArrayAssignment()
7522 Fortran::lower::AbstractConverter &converter, in createAnyMaskedArrayAssignment()
7523 const Fortran::lower::SomeExpr &lhs, const Fortran::lower::SomeExpr &rhs, in createAnyMaskedArrayAssignment()
7524 Fortran::lower::ExplicitIterSpace &explicitSpace, in createAnyMaskedArrayAssignment()
7525 Fortran::lower::ImplicitIterSpace &implicitSpace, in createAnyMaskedArrayAssignment()
7526 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) { in createAnyMaskedArrayAssignment()
7536 void Fortran::lower::createAllocatableArrayAssignment( in createAllocatableArrayAssignment()
7537 Fortran::lower::AbstractConverter &converter, in createAllocatableArrayAssignment()
7538 const Fortran::lower::SomeExpr &lhs, const Fortran::lower::SomeExpr &rhs, in createAllocatableArrayAssignment()
7539 Fortran::lower::ExplicitIterSpace &explicitSpace, in createAllocatableArrayAssignment()
7540 Fortran::lower::ImplicitIterSpace &implicitSpace, in createAllocatableArrayAssignment()
7541 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) { in createAllocatableArrayAssignment()
7551 void Fortran::lower::createArrayOfPointerAssignment( in createArrayOfPointerAssignment()
7552 Fortran::lower::AbstractConverter &converter, in createArrayOfPointerAssignment()
7553 const Fortran::lower::SomeExpr &lhs, const Fortran::lower::SomeExpr &rhs, in createArrayOfPointerAssignment()
7554 Fortran::lower::ExplicitIterSpace &explicitSpace, in createArrayOfPointerAssignment()
7555 Fortran::lower::ImplicitIterSpace &implicitSpace, in createArrayOfPointerAssignment()
7558 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) { in createArrayOfPointerAssignment()
7570 fir::ExtendedValue Fortran::lower::createSomeArrayTempValue( in createSomeArrayTempValue()
7571 Fortran::lower::AbstractConverter &converter, in createSomeArrayTempValue()
7572 const Fortran::lower::SomeExpr &expr, Fortran::lower::SymMap &symMap, in createSomeArrayTempValue()
7573 Fortran::lower::StatementContext &stmtCtx) { in createSomeArrayTempValue()
7579 void Fortran::lower::createLazyArrayTempValue( in createLazyArrayTempValue()
7580 Fortran::lower::AbstractConverter &converter, in createLazyArrayTempValue()
7581 const Fortran::lower::SomeExpr &expr, mlir::Value raggedHeader, in createLazyArrayTempValue()
7582 Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) { in createLazyArrayTempValue()
7589 Fortran::lower::createSomeArrayBox(Fortran::lower::AbstractConverter &converter, in createSomeArrayBox()
7590 const Fortran::lower::SomeExpr &expr, in createSomeArrayBox()
7591 Fortran::lower::SymMap &symMap, in createSomeArrayBox()
7592 Fortran::lower::StatementContext &stmtCtx) { in createSomeArrayBox()
7598 fir::MutableBoxValue Fortran::lower::createMutableBox( in createMutableBox()
7599 mlir::Location loc, Fortran::lower::AbstractConverter &converter, in createMutableBox()
7600 const Fortran::lower::SomeExpr &expr, Fortran::lower::SymMap &symMap) { in createMutableBox()
7606 Fortran::lower::StatementContext dummyStmtCtx; in createMutableBox()
7611 fir::ExtendedValue Fortran::lower::createBoxValue( in createBoxValue()
7612 mlir::Location loc, Fortran::lower::AbstractConverter &converter, in createBoxValue()
7613 const Fortran::lower::SomeExpr &expr, Fortran::lower::SymMap &symMap, in createBoxValue()
7614 Fortran::lower::StatementContext &stmtCtx) { in createBoxValue()
7615 if (expr.Rank() > 0 && Fortran::evaluate::IsVariable(expr) && in createBoxValue()
7616 !Fortran::evaluate::HasVectorSubscript(expr)) in createBoxValue()
7617 return Fortran::lower::createSomeArrayBox(converter, expr, symMap, stmtCtx); in createBoxValue()
7618 fir::ExtendedValue addr = Fortran::lower::createSomeExtendedAddress( in createBoxValue()
7623 mlir::Value Fortran::lower::createSubroutineCall( in createSubroutineCall()
7644 Fortran::lower::CallerInterface(call, converter).getFuncOp(); in createSubroutineCall()
7660 Fortran::lower::createSomeExtendedExpression( in createSubroutineCall()
7675 auto res = Fortran::lower::createSomeExtendedExpression( in createSubroutineCall()
7682 Fortran::lower::AbstractConverter &converter, in genArrayLoad()
7684 Fortran::lower::SymMap &symMap, in genArrayLoad()
7685 Fortran::lower::StatementContext &stmtCtx) { in genArrayLoad()
7696 genArrayLoad(mlir::Location loc, Fortran::lower::AbstractConverter &converter, in genArrayLoad()
7697 fir::FirOpBuilder &builder, const Fortran::evaluate::ArrayRef *x, in genArrayLoad()
7698 Fortran::lower::SymMap &symMap, in genArrayLoad()
7699 Fortran::lower::StatementContext &stmtCtx) { in genArrayLoad()
7707 void Fortran::lower::createArrayLoads( in createArrayLoads()
7708 Fortran::lower::AbstractConverter &converter, in createArrayLoads()
7709 Fortran::lower::ExplicitIterSpace &esp, Fortran::lower::SymMap &symMap) { in createArrayLoads()
7713 Fortran::lower::StatementContext &stmtCtx = esp.stmtContext(); in createArrayLoads()
7729 void Fortran::lower::createArrayMergeStores( in createArrayMergeStores()
7730 Fortran::lower::AbstractConverter &converter, in createArrayMergeStores()
7731 Fortran::lower::ExplicitIterSpace &esp) { in createArrayMergeStores()