Lines Matching defs:box

470     // Call is expecting a raw data pointer, not a box. Get the data pointer out
471 // of the box and pass that.
578 [&](const fir::ArrayBoxValue &box) { return genShape(loc, box); },
579 [&](const fir::CharArrayBoxValue &box) { return genShape(loc, box); },
580 [&](const fir::BoxValue &box) -> mlir::Value {
581 if (!box.getLBounds().empty()) {
583 fir::ShiftType::get(getContext(), box.getLBounds().size());
584 return create<fir::ShiftOp>(loc, shiftType, box.getLBounds());
627 [&](const fir::ArrayBoxValue &box) {
628 return fullShape(box.getLBounds(), box.getExtents());
630 [&](const fir::CharArrayBoxValue &box) {
631 return fullShape(box.getLBounds(), box.getExtents());
633 [&](const fir::BoxValue &box) {
634 auto extents = fir::factory::readExtents(*this, loc, box);
635 return fullShape(box.getLBounds(), extents);
662 // Avoid to wrap a box/class with box/class.
677 [&](const fir::ArrayBoxValue &box) -> mlir::Value {
683 isPolymorphic ? box.getSourceBox() : tdesc);
685 [&](const fir::CharArrayBoxValue &box) -> mlir::Value {
691 llvm::SmallVector<mlir::Value> lenParams{box.getLen()};
695 [&](const fir::CharBoxValue &box) -> mlir::Value {
699 llvm::SmallVector<mlir::Value> lenParams{box.getLen()};
850 const fir::ExtendedValue &box) {
851 return box.match(
875 const fir::ExtendedValue &box,
877 assert(box.rank() > dim);
878 return box.match(
907 const fir::ExtendedValue &box,
910 assert(box.rank() > dim);
911 auto lb = box.match(
936 const fir::BoxValue &box) {
938 auto explicitExtents = box.getExplicitExtents();
943 auto rank = box.rank();
948 box.getAddr(), dimVal);
956 const fir::ExtendedValue &box) {
957 return box.match(
976 const fir::BoxValue &box) {
977 assert(!box.hasAssumedRank() &&
978 "cannot read unlimited polymorphic or assumed rank fir.box");
980 builder.create<fir::BoxAddrOp>(loc, box.getMemTy(), box.getAddr());
981 if (box.isCharacter()) {
982 auto len = fir::factory::readCharLen(builder, loc, box);
983 if (box.rank() == 0)
986 fir::factory::readExtents(builder, loc, box),
987 box.getLBounds());
989 if (box.isDerivedWithLenParameters())
990 TODO(loc, "read fir.box with length parameters");
992 if (box.isPolymorphic())
993 sourceBox = box.getAddr();
994 if (box.isPolymorphic() && box.rank() == 0)
996 if (box.rank() == 0)
998 return fir::ArrayBoxValue(addr, fir::factory::readExtents(builder, loc, box),
999 box.getLBounds(), sourceBox);
1014 [&](const fir::BoxValue &box) -> llvm::SmallVector<mlir::Value> {
1015 return {box.getLBounds().begin(), box.getLBounds().end()};
1017 [&](const fir::MutableBoxValue &box) -> llvm::SmallVector<mlir::Value> {
1018 auto load = fir::factory::genMutableBoxRead(builder, loc, box);
1031 [&](const fir::MutableBoxValue &box) -> llvm::SmallVector<mlir::Value> {
1032 return {box.nonDeferredLenParams().begin(),
1033 box.nonDeferredLenParams().end()};
1035 [&](const fir::BoxValue &box) -> llvm::SmallVector<mlir::Value> {
1036 return {box.getExplicitParameters().begin(),
1037 box.getExplicitParameters().end()};
1042 // If valTy is a box type, then we need to extract the type parameters from
1043 // the box value.
1079 auto handleBoxed = [&](const auto &box) -> llvm::SmallVector<mlir::Value> {
1080 if (box.isCharacter())
1082 if (box.isDerivedWithLenParameters()) {
1083 // This should generate code to read the type parameters from the box.
1093 [&](const fir::BoxValue &box) { return handleBoxed(box); },
1094 [&](const fir::MutableBoxValue &box) { return handleBoxed(box); },
1257 [&](const fir::BoxValue &box) -> fir::ExtendedValue {
1258 if (box.isCharacter()) {
1259 auto len = fir::factory::readCharLen(builder, loc, box);
1262 if (box.isDerivedWithLenParameters())
1264 if (box.isPolymorphic()) {
1265 return fir::PolymorphicValue(element, fir::getBase(box));
1269 [&](const fir::ArrayBoxValue &box) -> fir::ExtendedValue {
1270 if (box.getSourceBox())
1271 return fir::PolymorphicValue(element, box.getSourceBox());
1458 // so just create a fir.ref<fir.box<>> from the fir.box to comply with the
1459 // runtime interface, but assume the fir.box is unchanged.
1691 mlir::Value box = builder.createBox(loc, exv);
1695 [&](const fir::ArrayBoxValue &box) {
1696 lbounds.append(box.getLBounds().begin(), box.getLBounds().end());
1698 [&](const fir::CharArrayBoxValue &box) {
1699 lbounds.append(box.getLBounds().begin(), box.getLBounds().end());
1700 explicitTypeParams.emplace_back(box.getLen());
1702 [&](const fir::CharBoxValue &box) {
1703 explicitTypeParams.emplace_back(box.getLen());
1707 // The resulting box lbounds must be coming from the mutable box.
1712 fir::emitFatalError(loc, "mutable box read cannot be mutable box");
1713 fir::BoxValue box =
1715 lbounds.append(box.getLBounds().begin(), box.getLBounds().end());
1721 return fir::BoxValue(box, lbounds, explicitTypeParams);