2020-02-25 23:11:52 +08:00
|
|
|
//===-- lib/Semantics/check-call.h ------------------------------*- C++ -*-===//
|
2019-09-17 07:58:13 +08:00
|
|
|
//
|
2019-12-21 04:52:07 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2019-09-17 07:58:13 +08:00
|
|
|
//
|
2020-01-11 04:12:03 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2019-09-17 07:58:13 +08:00
|
|
|
|
|
|
|
// Constraint checking for procedure references
|
|
|
|
|
2019-10-10 07:30:34 +08:00
|
|
|
#ifndef FORTRAN_SEMANTICS_CHECK_CALL_H_
|
|
|
|
#define FORTRAN_SEMANTICS_CHECK_CALL_H_
|
2019-09-17 07:58:13 +08:00
|
|
|
|
2020-02-25 23:11:52 +08:00
|
|
|
#include "flang/Evaluate/call.h"
|
2019-09-17 07:58:13 +08:00
|
|
|
|
|
|
|
namespace Fortran::parser {
|
2019-10-12 06:41:11 +08:00
|
|
|
class Messages;
|
2019-09-17 07:58:13 +08:00
|
|
|
class ContextualMessages;
|
2020-03-29 12:00:16 +08:00
|
|
|
} // namespace Fortran::parser
|
2019-09-17 07:58:13 +08:00
|
|
|
namespace Fortran::evaluate::characteristics {
|
|
|
|
struct Procedure;
|
|
|
|
}
|
|
|
|
namespace Fortran::evaluate {
|
|
|
|
class FoldingContext;
|
2019-10-10 07:30:34 +08:00
|
|
|
}
|
2019-09-17 07:58:13 +08:00
|
|
|
|
2019-10-10 07:30:34 +08:00
|
|
|
namespace Fortran::semantics {
|
2019-10-11 04:09:35 +08:00
|
|
|
class Scope;
|
|
|
|
|
2019-09-17 07:58:13 +08:00
|
|
|
// The Boolean flag argument should be true when the called procedure
|
|
|
|
// does not actually have an explicit interface at the call site, but
|
|
|
|
// its characteristics are known because it is a subroutine or function
|
|
|
|
// defined at the top level in the same source file.
|
2019-10-10 07:30:34 +08:00
|
|
|
void CheckArguments(const evaluate::characteristics::Procedure &,
|
2019-10-11 04:09:35 +08:00
|
|
|
evaluate::ActualArguments &, evaluate::FoldingContext &, const Scope &,
|
2019-10-10 07:30:34 +08:00
|
|
|
bool treatingExternalAsImplicit = false);
|
2019-10-10 07:08:13 +08:00
|
|
|
|
2019-11-13 07:43:09 +08:00
|
|
|
// Checks actual arguments against a procedure with an explicit interface.
|
2019-10-12 06:41:11 +08:00
|
|
|
// Reports a buffer of errors when not compatible.
|
|
|
|
parser::Messages CheckExplicitInterface(
|
|
|
|
const evaluate::characteristics::Procedure &, evaluate::ActualArguments &,
|
|
|
|
const evaluate::FoldingContext &, const Scope &);
|
2019-11-13 07:43:09 +08:00
|
|
|
|
|
|
|
// Checks actual arguments for the purpose of resolving a generic interface.
|
2019-10-23 00:31:33 +08:00
|
|
|
bool CheckInterfaceForGeneric(const evaluate::characteristics::Procedure &,
|
|
|
|
evaluate::ActualArguments &, const evaluate::FoldingContext &);
|
2020-03-29 12:00:16 +08:00
|
|
|
} // namespace Fortran::semantics
|
2019-09-17 07:58:13 +08:00
|
|
|
#endif
|