2020-02-25 23:11:52 +08:00
|
|
|
//===-- lib/Semantics/pointer-assignment.h --------------------------------===//
|
2020-01-07 01:16:18 +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
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef FORTRAN_SEMANTICS_POINTER_ASSIGNMENT_H_
|
|
|
|
#define FORTRAN_SEMANTICS_POINTER_ASSIGNMENT_H_
|
|
|
|
|
2020-02-25 23:11:52 +08:00
|
|
|
#include "flang/Evaluate/expression.h"
|
|
|
|
#include "flang/Parser/char-block.h"
|
|
|
|
#include "flang/Semantics/type.h"
|
2020-01-07 01:16:18 +08:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace Fortran::evaluate::characteristics {
|
|
|
|
struct DummyDataObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Fortran::evaluate {
|
|
|
|
class FoldingContext;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Fortran::semantics {
|
|
|
|
|
|
|
|
class Symbol;
|
|
|
|
|
2020-06-19 08:17:04 +08:00
|
|
|
bool CheckPointerAssignment(
|
2020-02-19 07:20:28 +08:00
|
|
|
evaluate::FoldingContext &, const evaluate::Assignment &);
|
2020-06-19 08:17:04 +08:00
|
|
|
bool CheckPointerAssignment(evaluate::FoldingContext &, const SomeExpr &lhs,
|
|
|
|
const SomeExpr &rhs, bool isBoundsRemapping = false);
|
|
|
|
bool CheckPointerAssignment(
|
2020-01-07 01:16:18 +08:00
|
|
|
evaluate::FoldingContext &, const Symbol &lhs, const SomeExpr &rhs);
|
2020-06-19 08:17:04 +08:00
|
|
|
bool CheckPointerAssignment(evaluate::FoldingContext &,
|
2020-01-07 01:16:18 +08:00
|
|
|
parser::CharBlock source, const std::string &description,
|
|
|
|
const evaluate::characteristics::DummyDataObject &, const SomeExpr &rhs);
|
|
|
|
|
2020-06-19 08:17:04 +08:00
|
|
|
// Checks whether an expression is a valid static initializer for a
|
|
|
|
// particular pointer designator.
|
|
|
|
bool CheckInitialTarget(
|
|
|
|
evaluate::FoldingContext &, const SomeExpr &pointer, const SomeExpr &init);
|
|
|
|
|
2020-03-29 12:00:16 +08:00
|
|
|
} // namespace Fortran::semantics
|
2020-01-07 01:16:18 +08:00
|
|
|
|
2020-03-29 12:00:16 +08:00
|
|
|
#endif // FORTRAN_SEMANTICS_POINTER_ASSIGNMENT_H_
|