FLANG
check-call.h
1//===-- lib/Semantics/check-call.h ------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// Constraint checking for procedure references
10
11#ifndef FORTRAN_SEMANTICS_CHECK_CALL_H_
12#define FORTRAN_SEMANTICS_CHECK_CALL_H_
13
14#include "flang/Evaluate/call.h"
15#include "flang/Parser/message.h"
16
17namespace Fortran::evaluate::characteristics {
18struct Procedure;
19}
20namespace Fortran::evaluate {
21class FoldingContext;
22}
23
24namespace Fortran::semantics {
25class Scope;
27
28// Check keyword constraints on actual arguments for procedures with implicit
29// interfaces.
30void CheckImplicitInterfaceArgKeywords(
31 const evaluate::ActualArgument &, parser::ContextualMessages &);
32
33// Check constraints on actual arguments for procedures with implicit
34// interfaces.
35void CheckImplicitInterfaceArg(evaluate::ActualArgument &,
36 parser::ContextualMessages &, SemanticsContext &);
37
38// Argument treatingExternalAsImplicit should be true when the called procedure
39// does not actually have an explicit interface at the call site, but
40// its characteristics are known because it is a subroutine or function
41// defined at the top level in the same source file. Returns false if
42// messages were created, true if all is well.
43bool CheckArguments(const evaluate::characteristics::Procedure &,
44 evaluate::ActualArguments &, SemanticsContext &, const Scope &,
45 bool treatingExternalAsImplicit, bool ignoreImplicitVsExplicit,
46 const evaluate::SpecificIntrinsic *intrinsic);
47
48bool CheckPPCIntrinsic(const Symbol &generic, const Symbol &specific,
49 const evaluate::ActualArguments &actuals,
50 evaluate::FoldingContext &context);
51bool CheckWindowsIntrinsic(
52 const Symbol &intrinsic, evaluate::FoldingContext &context);
53bool CheckArgumentIsConstantExprInRange(
54 const evaluate::ActualArguments &actuals, int index, int lowerBound,
55 int upperBound, parser::ContextualMessages &messages);
56
57parser::Messages CheckExplicitInterface(
58 const evaluate::characteristics::Procedure &, evaluate::ActualArguments &,
59 SemanticsContext &, const Scope *, const evaluate::SpecificIntrinsic *,
60 bool allowActualArgumentConversions, bool extentErrors,
61 bool ignoreImplicitVsExplicit);
62
63// Checks actual arguments for the purpose of resolving a generic interface.
64bool CheckInterfaceForGeneric(const evaluate::characteristics::Procedure &,
65 evaluate::ActualArguments &, SemanticsContext &,
66 bool allowActualArgumentConversions = false);
67} // namespace Fortran::semantics
68#endif
Definition common.h:217
Definition scope.h:68
Definition semantics.h:68
Definition symbol.h:881
Definition call.h:34
Definition characteristics.h:367