Lines Matching defs:partInfo
198 PartInfo &partInfo,
202 if (partInfo.base && mlir::isa<fir::SequenceType>(resultValueType) &&
203 !partInfo.resultShape)
204 partInfo.resultShape =
205 hlfir::genShape(getLoc(), getBuilder(), *partInfo.base);
218 mayHaveNonDefaultLowerBounds(partInfo))
241 PartInfo &partInfo,
244 computeDesignatorType(resultValueType, partInfo, designatorNode);
245 return genDesignate(designatorType, partInfo, /*attributes=*/{});
248 genDesignate(mlir::Type designatorType, PartInfo &partInfo,
267 getLoc(), designatorType, partInfo.base.value().getBase(),
268 partInfo.componentName, partInfo.componentShape, partInfo.subscripts,
269 partInfo.substring, partInfo.complexPart, partInfo.resultShape,
270 partInfo.typeParams, attributes);
324 PartInfo partInfo;
325 mlir::Type resultType = visit(component, partInfo);
326 return genDesignate(resultType, partInfo, component);
331 PartInfo partInfo;
332 mlir::Type resultType = visit(arrayRef, partInfo);
333 return genDesignate(resultType, partInfo, arrayRef);
347 PartInfo partInfo;
352 partInfo.complexPart = {complexBit};
354 mlir::Type resultType = visit(complexPart.complex(), partInfo);
361 return genDesignate(designatorType, partInfo, complexPart);
366 PartInfo partInfo;
368 [&](const auto &x) { return visit(x, partInfo); }, substring.parent());
369 assert(partInfo.typeParams.size() == 1 && "expect base string length");
371 partInfo.substring.push_back(genSubscript(substring.lower()));
373 partInfo.substring.push_back(genSubscript(*upperBound));
375 partInfo.substring.push_back(partInfo.typeParams[0]);
379 partInfo.substring[0] =
380 builder.createConvert(loc, idxTy, partInfo.substring[0]);
381 partInfo.substring[1] =
382 builder.createConvert(loc, idxTy, partInfo.substring[1]);
390 partInfo.typeParams[0] =
396 loc, partInfo.substring[1], partInfo.substring[0]);
398 partInfo.typeParams[0] =
408 return genDesignate(resultType, partInfo, substring);
428 PartInfo partInfo;
429 mlir::Type componentType = visitComponentImpl(component, partInfo).second;
434 return genDesignate(designatorType, partInfo, attributes);
438 PartInfo &partInfo) {
440 [&](const auto &x) { return visit(x, partInfo); }, dataRef.u);
445 PartInfo &partInfo) {
458 partInfo.base = hlfir::genDeclare(loc, builder, exv, ".stringlit", flags);
459 partInfo.typeParams.push_back(fir::getLen(exv));
460 return partInfo.base->getElementOrSequenceType();
464 PartInfo &partInfo) {
469 partInfo.base =
471 hlfir::genLengthParameters(loc, getBuilder(), *partInfo.base,
472 partInfo.typeParams);
473 return partInfo.base->getElementOrSequenceType();
477 PartInfo &partInfo) {
486 baseType = visit(*component, partInfo);
489 visitComponentImpl(*component, partInfo).second);
491 baseType = visit(arrayRef.base().GetLastSymbol(), partInfo);
500 if (partInfo.componentName.empty()) {
501 bounds = hlfir::genBounds(loc, builder, partInfo.base.value());
504 partInfo.componentShape &&
506 bounds = hlfir::genBounds(loc, builder, partInfo.componentShape);
552 partInfo.subscripts.emplace_back(
560 partInfo.subscripts.push_back(subscript);
579 return createVectorSubscriptElementAddrOp(partInfo, baseType,
588 assert(!partInfo.resultShape &&
590 partInfo.resultShape = builder.genShape(loc, resultExtents);
591 } else if (!partInfo.componentName.empty() &&
592 partInfo.base.value().isArray()) {
595 auto compBaseTy = partInfo.base->getElementOrSequenceType();
597 assert(!partInfo.resultShape && "should not have been computed already");
598 partInfo.resultShape = hlfir::genShape(loc, builder, *partInfo.base);
614 static bool mayHaveNonDefaultLowerBounds(const PartInfo &partInfo) {
615 return partInfo.resultShape &&
617 partInfo.resultShape.getType());
621 PartInfo &partInfo) {
625 partInfo.base = genWholeAllocatableOrPointerComponent(component);
626 partInfo.base = hlfir::derefPointersAndAllocatables(loc, getBuilder(),
627 *partInfo.base);
628 hlfir::genLengthParameters(loc, getBuilder(), *partInfo.base,
629 partInfo.typeParams);
630 return partInfo.base->getElementOrSequenceType();
636 auto [baseType, componentType] = visitComponentImpl(component, partInfo);
639 if (partInfo.base.value().isArray()) {
644 partInfo.resultShape = hlfir::genShape(loc, getBuilder(), *partInfo.base);
645 assert(!partInfo.componentShape &&
650 if (partInfo.complexPart && partInfo.componentShape) {
660 auto bounds = hlfir::genBounds(loc, builder, partInfo.componentShape);
663 partInfo.subscripts.emplace_back(hlfir::DesignateOp::Triplet{
670 partInfo.resultShape = builder.genShape(loc, resultExtents);
676 partInfo.resultShape = partInfo.componentShape;
677 partInfo.componentShape = {};
681 // Returns the <BaseType, ComponentType> pair, computes partInfo.base,
682 // partInfo.componentShape and partInfo.typeParams, but does not set the
683 // partInfo.resultShape yet. The result shape will be computed after
687 PartInfo &partInfo) {
693 partInfo.base = gen(component.base());
696 partInfo.base =
697 hlfir::derefPointersAndAllocatables(loc, builder, *partInfo.base);
698 assert(partInfo.typeParams.empty() && "should not have been computed yet");
700 hlfir::genLengthParameters(getLoc(), getBuilder(), *partInfo.base,
701 partInfo.typeParams);
702 mlir::Type baseType = partInfo.base->getElementOrSequenceType();
707 partInfo.componentName = converter.getRecordTypeFieldName(componentSym);
712 mlir::Type fieldType = recordType.getType(partInfo.componentName);
716 partInfo.componentShape = genComponentShape(componentSym, fieldBaseType);
726 partInfo.typeParams.push_back(
765 PartInfo &partInfo, mlir::Type baseType,
778 assert(partInfo.base.has_value() &&
780 mlir::Value mold = *partInfo.base;
795 for (hlfir::DesignateOp::Subscript &subscript : partInfo.subscripts) {