Lines Matching defs:box

227 /// create initial-data-target fir.box in a global initializer region.
268 // Handle NULL(mold) as a special case. Return an unallocated box of MOLD
269 // type. The return box is correctly created as a fir.box<fir.ptr<T>> where
284 mlir::Value box =
286 return box;
310 // The targetBox is a fir.box<T>, not a fir.box<fir.ptr<T>> as it should for
549 mlir::Value box = Fortran::lower::genInitialDataTarget(
551 b.create<fir::HasValueOp>(loc, box);
557 mlir::Value box = fir::factory::createUnallocatedBox(
561 b.create<fir::HasValueOp>(loc, box);
597 auto box{Fortran::lower::convertProcedureDesignatorInitialTarget(
599 auto castTo{builder.createConvert(loc, symTy, box)};
605 auto box{fir::factory::createNullBoxProc(b, loc, symTy)};
606 b.create<fir::HasValueOp>(loc, box);
613 auto box{fir::factory::createNullBoxProc(b, loc, symTy)};
614 b.create<fir::HasValueOp>(loc, box);
751 auto box{fir::factory::createNullBoxProc(builder, loc, ty)};
752 builder.create<fir::StoreOp>(loc, box, res);
795 auto box = builder.createBox(loc, exv);
796 fir::runtime::genDerivedTypeInitialize(builder, loc, box);
800 mlir::Value box = builder.createBox(loc, exv);
801 fir::runtime::genDerivedTypeInitialize(builder, loc, box);
815 mlir::Value box = builder.createBox(loc, hexv);
816 fir::runtime::genDerivedTypeInitializeClone(builder, loc, newBox, box);
894 auto box = builder.createBox(loc, exv);
895 fir::runtime::genDerivedTypeDestroy(builder, loc, box);
899 mlir::Value box = builder.createBox(loc, exv);
900 fir::runtime::genDerivedTypeDestroy(builder, loc, box);
988 mlir::Value box = builder->createBox(loc, exv);
989 fir::runtime::genDerivedTypeDestroy(*builder, loc, box);
1491 // Only dummy arguments coming as fir.box can be tracked in an BoxValue.
1498 // Assumed rank and optional fir.box cannot yet be read while lowering the
1503 // Polymorphic entity should be tracked through a fir.box that has the
1526 const Fortran::lower::BoxAnalyzer &box,
1529 if (!box.isArray() || box.lboundIsAllOnes())
1533 if (box.isStaticArray()) {
1534 for (int64_t lb : box.staticLBound())
1538 for (const Fortran::semantics::ShapeSpec *spec : box.dynamicBound()) {
1546 assert(result.empty() || result.size() == box.dynamicBound().size());
1563 mlir::Location loc, const Fortran::lower::BoxAnalyzer &box,
1568 if (!box.isArray())
1572 if (box.isStaticArray()) {
1573 for (int64_t extent : box.staticShape())
1577 for (const auto &spec : llvm::enumerate(box.dynamicBound())) {
1591 assert(result.empty() || result.size() == box.dynamicBound().size());
1598 mlir::Location loc, const Fortran::lower::BoxAnalyzer &box,
1601 if (!box.isChar())
1605 if (std::optional<int64_t> len = box.getCharLenConst())
1607 if (std::optional<Fortran::lower::SomeExpr> lenExpr = box.getCharLenExpr())
1713 /// Not for symbols lowered to fir.box.
1787 // box from now on. The base_addr of the descriptor must be updated
1869 fir::MutableBoxValue box, bool force = false) {
1871 symMap.addAllocatableOrPointer(sym, box, force);
1874 assert(!box.isDescribedByVariables() &&
1875 "HLFIR alloctables/pointers must be fir.ref<fir.box>");
1876 mlir::Value base = box.getAddr();
1878 if (box.hasNonDeferredLenParams()) {
1879 if (!box.isCharacter())
1882 explictLength = box.nonDeferredLenParams()[0];
1899 /// Map a symbol represented with a runtime descriptor to its FIR fir.box and
1904 mlir::Value box, llvm::ArrayRef<mlir::Value> lbounds,
1909 fir::BoxValue boxValue{box, lbounds, explicitParams, explicitExtents};
1915 symMap.addBoxSymbol(sym, box, lbounds, explicitParams, explicitExtents,
1993 // Get address of fir.box describing the entity.
2021 fir::MutableBoxValue box = Fortran::lower::createMutableBox(
2026 genAllocatableOrPointerDeclare(converter, symMap, var.getSymbol(), box,
2044 // Do not keep scalar characters as fir.box (even when optional).
2046 // fir.box outside of calls.
2116 // - Allocate a heap box/descriptor, initialized to zero. This always
2124 // The box is read right away because lowering code does not expect
2161 auto populateShape = [&](auto &shapes, const auto &bounds, mlir::Value box) {
2172 assert(box && "assumed bounds require a descriptor");
2176 builder.create<fir::BoxDimsOp>(loc, idxTy, idxTy, idxTy, box, dim);
2188 const auto &bounds, mlir::Value box) {
2196 assert(box && "deferred bounds require a descriptor");
2200 builder.create<fir::BoxDimsOp>(loc, idxTy, idxTy, idxTy, box, dim);
2246 // Contiguous assumed shape that can be tracked without a fir.box.
2285 // Assumed length fir.box (possible for contiguous assumed shapes).
2286 // Read length from box.
2288 "must be character dummy fir.box");
2509 // The pointer box's sequence type must be with unknown shape.