Lines Matching refs:Fortran
55 void init(Fortran::lower::AbstractConverter &converter, mlir::Location loc, in init()
56 const Fortran::lower::SomeExpr *statExpr, in init()
57 const Fortran::lower::SomeExpr *errMsgExpr) { in init()
58 Fortran::lower::StatementContext stmtCtx; in init()
115 using namespace Fortran::runtime;
211 static const Fortran::semantics::Symbol &
212 unwrapSymbol(const Fortran::parser::AllocateObject &allocObj) { in unwrapSymbol()
213 const Fortran::parser::Name &lastName = in unwrapSymbol()
214 Fortran::parser::GetLastName(allocObj); in unwrapSymbol()
220 genMutableBoxValue(Fortran::lower::AbstractConverter &converter, in genMutableBoxValue()
222 const Fortran::parser::AllocateObject &allocObj) { in genMutableBoxValue()
223 const Fortran::lower::SomeExpr *expr = Fortran::semantics::GetExpr(allocObj); in genMutableBoxValue()
231 AllocateStmtHelper(Fortran::lower::AbstractConverter &converter, in AllocateStmtHelper()
232 const Fortran::parser::AllocateStmt &stmt, in AllocateStmtHelper()
245 std::get<std::list<Fortran::parser::Allocation>>(stmt.t)) in lower()
252 const Fortran::parser::Allocation &alloc;
253 const Fortran::semantics::DeclTypeSpec &type;
255 return std::get<std::optional<Fortran::parser::AllocateCoarraySpec>>( in hasCoarraySpec()
259 const Fortran::parser::AllocateObject &getAllocObj() const { in getAllocObj()
260 return std::get<Fortran::parser::AllocateObject>(alloc.t); in getAllocObj()
262 const Fortran::semantics::Symbol &getSymbol() const { in getSymbol()
265 const std::list<Fortran::parser::AllocateShapeSpec> &getShapeSpecs() const { in getShapeSpecs()
266 return std::get<std::list<Fortran::parser::AllocateShapeSpec>>(alloc.t); in getShapeSpecs()
270 Allocation unwrapAllocation(const Fortran::parser::Allocation &alloc) { in unwrapAllocation()
271 const auto &allocObj = std::get<Fortran::parser::AllocateObject>(alloc.t); in unwrapAllocation()
272 const Fortran::semantics::Symbol &symbol = unwrapSymbol(allocObj); in unwrapAllocation()
279 std::get<std::list<Fortran::parser::AllocOpt>>(stmt.t)) in visitAllocateOptions()
281 Fortran::common::visitors{ in visitAllocateOptions()
282 [&](const Fortran::parser::StatOrErrmsg &statOrErr) { in visitAllocateOptions()
284 Fortran::common::visitors{ in visitAllocateOptions()
285 [&](const Fortran::parser::StatVariable &statVar) { in visitAllocateOptions()
286 statExpr = Fortran::semantics::GetExpr(statVar); in visitAllocateOptions()
288 [&](const Fortran::parser::MsgVariable &errMsgVar) { in visitAllocateOptions()
289 errMsgExpr = Fortran::semantics::GetExpr(errMsgVar); in visitAllocateOptions()
294 [&](const Fortran::parser::AllocOpt::Source &source) { in visitAllocateOptions()
295 sourceExpr = Fortran::semantics::GetExpr(source.v.value()); in visitAllocateOptions()
297 [&](const Fortran::parser::AllocOpt::Mold &mold) { in visitAllocateOptions()
298 moldExpr = Fortran::semantics::GetExpr(mold.v.value()); in visitAllocateOptions()
318 for (const Fortran::parser::AllocateShapeSpec &shapeSpec : in lowerBoundsAreOnes()
336 Fortran::lower::StatementContext stmtCtx; in genInlinedAllocation()
340 for (const Fortran::parser::AllocateShapeSpec &shapeSpec : in genInlinedAllocation()
344 if (const std::optional<Fortran::parser::BoundExpr> &lbExpr = in genInlinedAllocation()
347 loc, Fortran::semantics::GetExpr(*lbExpr), stmtCtx)); in genInlinedAllocation()
355 loc, Fortran::semantics::GetExpr(std::get<1>(shapeSpec.t)), stmtCtx)); in genInlinedAllocation()
401 Fortran::lower::StatementContext stmtCtx; in genSimpleAllocation()
405 if (const std::optional<Fortran::parser::BoundExpr> &lbExpr = in genSimpleAllocation()
408 loc, Fortran::semantics::GetExpr(*lbExpr), stmtCtx)); in genSimpleAllocation()
412 loc, Fortran::semantics::GetExpr(std::get<1>(bounds)), stmtCtx)); in genSimpleAllocation()
426 const Fortran::semantics::DeclTypeSpec *typeSpec = in lowerAllocateLengthParameters()
430 if (const Fortran::semantics::DerivedTypeSpec *derived = in lowerAllocateLengthParameters()
432 if (Fortran::semantics::CountLenParameters(*derived) > 0) in lowerAllocateLengthParameters()
435 Fortran::semantics::DeclTypeSpec::Category::Character) { in lowerAllocateLengthParameters()
436 Fortran::semantics::ParamValue lenParam = in lowerAllocateLengthParameters()
438 if (Fortran::semantics::MaybeIntExpr intExpr = lenParam.GetExplicit()) { in lowerAllocateLengthParameters()
439 Fortran::lower::StatementContext stmtCtx; in lowerAllocateLengthParameters()
440 Fortran::lower::SomeExpr lenExpr{*intExpr}; in lowerAllocateLengthParameters()
476 const Fortran::semantics::DeclTypeSpec *getIfAllocateStmtTypeSpec() const { in getIfAllocateStmtTypeSpec()
478 std::get<std::optional<Fortran::parser::TypeSpec>>(stmt.t)) in getIfAllocateStmtTypeSpec()
483 Fortran::lower::AbstractConverter &converter;
485 const Fortran::parser::AllocateStmt &stmt;
486 const Fortran::lower::SomeExpr *sourceExpr{nullptr};
487 const Fortran::lower::SomeExpr *moldExpr{nullptr};
488 const Fortran::lower::SomeExpr *statExpr{nullptr};
489 const Fortran::lower::SomeExpr *errMsgExpr{nullptr};
499 void Fortran::lower::genAllocateStmt( in genAllocateStmt()
500 Fortran::lower::AbstractConverter &converter, in genAllocateStmt()
501 const Fortran::parser::AllocateStmt &stmt, mlir::Location loc) { in genAllocateStmt()
526 void Fortran::lower::genDeallocateStmt( in genDeallocateStmt()
527 Fortran::lower::AbstractConverter &converter, in genDeallocateStmt()
528 const Fortran::parser::DeallocateStmt &stmt, mlir::Location loc) { in genDeallocateStmt()
529 const Fortran::lower::SomeExpr *statExpr = nullptr; in genDeallocateStmt()
530 const Fortran::lower::SomeExpr *errMsgExpr = nullptr; in genDeallocateStmt()
531 for (const Fortran::parser::StatOrErrmsg &statOrErr : in genDeallocateStmt()
532 std::get<std::list<Fortran::parser::StatOrErrmsg>>(stmt.t)) in genDeallocateStmt()
533 std::visit(Fortran::common::visitors{ in genDeallocateStmt()
534 [&](const Fortran::parser::StatVariable &statVar) { in genDeallocateStmt()
535 statExpr = Fortran::semantics::GetExpr(statVar); in genDeallocateStmt()
537 [&](const Fortran::parser::MsgVariable &errMsgVar) { in genDeallocateStmt()
538 errMsgExpr = Fortran::semantics::GetExpr(errMsgVar); in genDeallocateStmt()
546 for (const Fortran::parser::AllocateObject &allocateObject : in genDeallocateStmt()
547 std::get<std::list<Fortran::parser::AllocateObject>>(stmt.t)) { in genDeallocateStmt()
562 isNonContiguousArrayPointer(const Fortran::semantics::Symbol &sym) { in isNonContiguousArrayPointer()
563 return Fortran::semantics::IsPointer(sym) && sym.Rank() != 0 && in isNonContiguousArrayPointer()
564 !sym.attrs().test(Fortran::semantics::Attr::CONTIGUOUS); in isNonContiguousArrayPointer()
569 static bool mayBeCapturedInInternalProc(const Fortran::semantics::Symbol &sym) { in mayBeCapturedInInternalProc()
570 const Fortran::semantics::Scope &owner = sym.owner(); in mayBeCapturedInInternalProc()
571 Fortran::semantics::Scope::Kind kind = owner.kind(); in mayBeCapturedInInternalProc()
574 if (kind == Fortran::semantics::Scope::Kind::Subprogram || in mayBeCapturedInInternalProc()
575 kind == Fortran::semantics::Scope::Kind::MainProgram) in mayBeCapturedInInternalProc()
576 for (const Fortran::semantics::Scope &childScope : owner.children()) in mayBeCapturedInInternalProc()
577 if (childScope.kind() == Fortran::semantics::Scope::Kind::Subprogram) in mayBeCapturedInInternalProc()
578 if (const Fortran::semantics::Symbol *childSym = childScope.symbol()) in mayBeCapturedInInternalProc()
580 childSym->detailsIf<Fortran::semantics::SubprogramDetails>()) in mayBeCapturedInInternalProc()
590 createMutableProperties(Fortran::lower::AbstractConverter &converter, in createMutableProperties()
592 const Fortran::lower::pft::Variable &var, in createMutableProperties()
595 const Fortran::semantics::Symbol &sym = var.getSymbol(); in createMutableProperties()
607 if (var.isGlobal() || Fortran::semantics::IsDummy(sym) || in createMutableProperties()
608 Fortran::semantics::IsFunctionResult(sym) || in createMutableProperties()
609 sym.attrs().test(Fortran::semantics::Attr::VOLATILE) || in createMutableProperties()
656 fir::MutableBoxValue Fortran::lower::createMutableBox( in createMutableBox()
657 Fortran::lower::AbstractConverter &converter, mlir::Location loc, in createMutableBox()
658 const Fortran::lower::pft::Variable &var, mlir::Value boxAddr, in createMutableBox()
665 if (!var.isGlobal() && !Fortran::semantics::IsDummy(var.getSymbol())) in createMutableBox()
674 bool Fortran::lower::isArraySectionWithoutVectorSubscript( in isArraySectionWithoutVectorSubscript()
675 const Fortran::lower::SomeExpr &expr) { in isArraySectionWithoutVectorSubscript()
676 return expr.Rank() > 0 && Fortran::evaluate::IsVariable(expr) && in isArraySectionWithoutVectorSubscript()
677 !Fortran::evaluate::UnwrapWholeSymbolDataRef(expr) && in isArraySectionWithoutVectorSubscript()
678 !Fortran::evaluate::HasVectorSubscript(expr); in isArraySectionWithoutVectorSubscript()
681 void Fortran::lower::associateMutableBox( in associateMutableBox()
682 Fortran::lower::AbstractConverter &converter, mlir::Location loc, in associateMutableBox()
683 const fir::MutableBoxValue &box, const Fortran::lower::SomeExpr &source, in associateMutableBox()
684 mlir::ValueRange lbounds, Fortran::lower::StatementContext &stmtCtx) { in associateMutableBox()
686 if (Fortran::evaluate::UnwrapExpr<Fortran::evaluate::NullPointer>(source)) { in associateMutableBox()
702 bool Fortran::lower::isWholeAllocatable(const Fortran::lower::SomeExpr &expr) { in isWholeAllocatable()
703 if (const Fortran::semantics::Symbol *sym = in isWholeAllocatable()
704 Fortran::evaluate::UnwrapWholeSymbolOrComponentDataRef(expr)) in isWholeAllocatable()
705 return Fortran::semantics::IsAllocatable(*sym); in isWholeAllocatable()
709 bool Fortran::lower::isWholePointer(const Fortran::lower::SomeExpr &expr) { in isWholePointer()
710 if (const Fortran::semantics::Symbol *sym = in isWholePointer()
711 Fortran::evaluate::UnwrapWholeSymbolOrComponentDataRef(expr)) in isWholePointer()
712 return Fortran::semantics::IsPointer(*sym); in isWholePointer()