Lines Matching defs:callContext

1149     CallContext &callContext) {
1152 callContext.converter.getFoldingContext();
1324 mlir::Type storageType = callContext.converter.genType(*expr);
1362 bool needsZeroLowerBounds = callContext.isBindcCall() && entity.isArray();
1411 CallContext &callContext) {
1414 dummyType, arg, callContext);
1436 dummyType, arg, callContext);
1478 CallContext &callContext) {
1506 CallContext &callContext, llvm::SmallVector<CallCleanUp> &callCleanUps) {
1508 mlir::Location loc = callContext.loc;
1510 fir::FirOpBuilder &builder = callContext.getBuilder();
1569 loc, builder, *preparedActual, argTy, arg, callContext);
1580 argTy, arg, callContext);
1628 loc, callContext.converter, actual, callContext.stmtCtx,
1649 callContext.isBindcCall()) {
1658 Fortran::lower::genDeallocateIfAllocated(callContext.converter,
1668 remapActualToDummyDescriptors(loc, callContext.converter,
1669 callContext.symMap, loweredActuals, caller,
1670 callContext.isBindcCall());
1682 mlir::FunctionType callSiteType, CallContext &callContext) {
1683 mlir::Location loc = callContext.loc;
1685 fir::FirOpBuilder &builder = callContext.getBuilder();
1687 prepareUserCallArguments(loweredActuals, caller, callSiteType, callContext,
1694 loc, callContext.converter, callContext.symMap, callContext.stmtCtx,
1695 caller, callSiteType, callContext.resultType,
1696 callContext.isElementalProcWithArrayArgs());
1708 if (callContext.resultType &&
1709 mlir::isa<fir::BoxProcType>(*callContext.resultType))
1839 CallContext &callContext) {
1840 auto &builder = callContext.getBuilder();
1841 const auto &loc = callContext.loc;
1844 callContext.procRef, *intrinsic, callContext.converter));
1855 callContext.stmtCtx);
1866 assert(callContext.resultType &&
1868 // if callContext.resultType is an array then this was originally an elemental
1872 mlir::Type resTy = hlfir::getFortranElementType(*callContext.resultType);
1874 builder, loc, callContext.getProcedureName(), resTy, isPresent,
1875 getArgument, loweredActuals.size(), callContext.stmtCtx);
1887 CallContext &callContext) {
1888 auto &converter = callContext.converter;
1890 callContext.procRef, *intrinsic, converter))
1891 return genCustomIntrinsicRefCore(loweredActuals, intrinsic, callContext);
1898 auto &stmtCtx = callContext.stmtCtx;
1899 fir::FirOpBuilder &builder = callContext.getBuilder();
1900 mlir::Location loc = callContext.loc;
1922 callContext.procRef.UnwrapArgExpr(arg.index())) {
1998 callContext.procRef.UnwrapArgExpr(arg.index())) {
2033 if (callContext.resultType)
2034 scalarResultType = hlfir::getFortranElementType(*callContext.resultType);
2035 const std::string intrinsicName = callContext.getProcedureName();
2073 CallContext &callContext) {
2076 if (useHlfirIntrinsicOps && callContext.resultType) {
2077 fir::FirOpBuilder &builder = callContext.getBuilder();
2078 mlir::Location loc = callContext.loc;
2079 const std::string intrinsicName = callContext.getProcedureName();
2085 *callContext.resultType);
2092 callContext);
2101 bool isImpure, CallContext &callContext) {
2102 mlir::Location loc = callContext.loc;
2103 fir::FirOpBuilder &builder = callContext.getBuilder();
2158 callContext.stmtCtx.attachCleanup(
2167 if (!callContext.resultType) {
2174 callContext.stmtCtx.pushScope();
2178 impl().genElementalKernel(loweredActuals, callContext);
2179 callContext.stmtCtx.finalizeAndPop();
2185 hlfir::getFortranElementType(*callContext.resultType);
2196 loweredActuals, callContext));
2204 callContext.stmtCtx.pushScope();
2208 auto res = *impl().genElementalKernel(loweredActuals, callContext);
2209 callContext.stmtCtx.finalizeAndPop();
2216 if (fir::isPolymorphicType(*callContext.resultType))
2218 impl().getPolymorphicResultMold(loweredActuals, callContext);
2225 bool mustFinalizeExpr = impl().resultMayRequireFinalization(callContext);
2227 callContext.stmtCtx.attachCleanup([=]() {
2247 CallContext &callContext) {
2248 return genUserCall(loweredActuals, caller, callSiteType, callContext);
2270 CallContext &callContext) {
2271 fir::FirOpBuilder &builder = callContext.getBuilder();
2272 mlir::Location loc = callContext.loc;
2273 auto &converter = callContext.converter;
2277 prepareUserCallArguments(loweredActuals, caller, callSiteType, callContext,
2280 callContext.symMap.pushScope();
2288 loc, builder, hlfir::Entity{input}, callContext.stmtCtx);
2291 callContext.symMap.addVariableDefinition(*sym, variableIface);
2297 fir::getBase(converter.genExprValue(expr, callContext.stmtCtx)));
2307 callContext.symMap.popScope();
2314 CallContext &callContext) {
2315 fir::emitFatalError(callContext.loc,
2320 bool resultMayRequireFinalization(CallContext &callContext) const {
2328 callContext.loc,
2355 CallContext &callContext) {
2357 callContext);
2369 CallContext &callContext) {
2374 callContext.loc, callContext.getBuilder());
2377 TODO(callContext.loc,
2383 CallContext &callContext) {
2394 return loweredActuals.front()->getPolymorphicMold(callContext.loc);
2401 [[maybe_unused]] CallContext &callContext) const {
2418 CallContext &callContext,
2422 fir::FirOpBuilder &builder = callContext.getBuilder();
2450 CallContext &callContext) {
2451 assert(callContext.isElementalProcWithArrayArgs() &&
2453 mlir::Location loc = callContext.loc;
2454 auto &converter = callContext.converter;
2457 callContext.procRef, *intrinsic, converter));
2462 loc, converter, expr, callContext.symMap, callContext.stmtCtx);
2464 genIsPresentIfArgMaybeAbsent(loc, actual, expr, callContext,
2474 loc, converter, expr, callContext.symMap, callContext.stmtCtx);
2480 callContext.procRef, *intrinsic, callContext.resultType,
2484 fir::lookupIntrinsicHandler(callContext.getBuilder(),
2485 callContext.getProcedureName(),
2486 callContext.resultType);
2494 .genElementalCall(operands, /*isImpure=*/false, callContext);
2500 CallContext &callContext) {
2501 assert(!callContext.isElementalProcWithArrayArgs() &&
2503 mlir::Location loc = callContext.loc;
2504 fir::FirOpBuilder &builder = callContext.getBuilder();
2505 auto &converter = callContext.converter;
2506 auto &stmtCtx = callContext.stmtCtx;
2508 callContext.procRef, *intrinsic, converter));
2514 loc, converter, expr, callContext.symMap, callContext.stmtCtx);
2516 genIsPresentIfArgMaybeAbsent(loc, actual, expr, callContext,
2530 loc, converter, expr, callContext.symMap, callContext.stmtCtx);
2558 callContext.procRef, *intrinsic, callContext.resultType,
2561 return genCustomIntrinsicRefCore(loweredActuals, intrinsic, callContext);
2573 CallContext &callContext) {
2574 mlir::Location loc = callContext.loc;
2578 for (const auto &arg : llvm::enumerate(callContext.procRef.arguments())) {
2596 callContext.symMap.lookupVariableDefinition(*assumedTypeSym);
2617 if (isBitwiseComparison(callContext.getProcedureName())) {
2618 iofBackup = callContext.getBuilder().getIntegerOverflowFlags();
2619 callContext.getBuilder().setIntegerOverflowFlags(
2623 loc, callContext.converter, *expr, callContext.symMap,
2624 callContext.stmtCtx);
2625 if (isBitwiseComparison(callContext.getProcedureName()))
2626 callContext.getBuilder().setIntegerOverflowFlags(iofBackup);
2634 genIsPresentIfArgMaybeAbsent(loc, loweredActual, *expr, callContext,
2641 if (callContext.isElementalProcWithArrayArgs()) {
2643 const bool isFunction = callContext.resultType.has_value();
2646 callContext);
2649 loweredActuals, intrinsic, intrinsicEntry, callContext);
2651 fir::FirOpBuilder *bldr = &callContext.getBuilder();
2652 callContext.stmtCtx.attachCleanup(
2660 CallContext &callContext) {
2661 mlir::Location loc = callContext.loc;
2662 auto &converter = callContext.converter;
2664 callContext.procRef, *intrinsic, converter)) {
2665 if (callContext.isElementalProcWithArrayArgs())
2666 return genCustomElementalIntrinsicRef(intrinsic, callContext);
2667 return genCustomIntrinsicRef(intrinsic, callContext);
2670 fir::lookupIntrinsicHandler(callContext.getBuilder(),
2671 callContext.getProcedureName(),
2672 callContext.resultType);
2674 fir::crashOnMissingIntrinsic(loc, callContext.getProcedureName());
2675 return genIntrinsicRef(intrinsic, *intrinsicEntry, callContext);
2680 genProcedureRef(CallContext &callContext) {
2681 mlir::Location loc = callContext.loc;
2682 fir::FirOpBuilder &builder = callContext.getBuilder();
2683 if (auto *intrinsic = callContext.procRef.proc().GetSpecificIntrinsic())
2684 return genIntrinsicRef(intrinsic, callContext);
2689 if (Fortran::lower::isIntrinsicModuleProcRef(callContext.procRef) &&
2690 !callContext.isBindcCall())
2692 fir::lookupIntrinsicHandler(builder, callContext.getProcedureName(),
2693 callContext.resultType))
2694 return genIntrinsicRef(nullptr, *intrinsicEntry, callContext);
2696 if (callContext.isStatementFunctionCall())
2697 return genStmtFunctionRef(loc, callContext.converter, callContext.symMap,
2698 callContext.stmtCtx, callContext.procRef);
2700 Fortran::lower::CallerInterface caller(callContext.procRef,
2701 callContext.converter);
2703 const bool isElemental = callContext.isElementalProcWithArrayArgs();
2719 callContext.symMap.lookupVariableDefinition(*assumedTypeSym);
2763 loc, callContext.converter, *expr, callContext.symMap,
2764 callContext.stmtCtx);
2771 loc, callContext.converter, *expr, callContext.symMap,
2772 callContext.stmtCtx);
2776 loc, loweredActual, *expr, callContext,
2789 callContext.procRef.proc().GetSymbol())
2792 loweredActuals, isImpure, callContext);
2794 return genUserCall(loweredActuals, caller, callSiteType, callContext);
2850 CallContext callContext(procRef, resultType, loc, converter, symMap,
2853 genProcedureRef(callContext);
2870 CallContext callContext(procRef, resultType, loc, converter, symMap, stmtCtx);
2871 return genProcedureRef(callContext);
2879 CallContext callContext(procRef, /*resultType=*/std::nullopt, loc, converter,
2886 genUserCall(loweredActuals, caller, callSiteType, callContext);