5a18e79d5a
Use std::unique_ptr<> with custom deleter for forward-referenced owned pointer. Move CopyableIndirection into common, add documentation, clean up. Remove OwningPointer and ForwardReference Use std::unique_ptr<> with custom deleter for forward-referenced owned pointer. Use CopyableIndirection clean up from merge after split Complete characterization fold conversions of arrays Clean up subscripts to constant arrays Elemental unary operations complete Support assumed type TYPE(*) in actual arguments clean up some TODOs recognize TYPE(*) arguments to intrinsics Complete folding of array operations Finish elementwise array folding, add test, debug characterize intrinsics, fix some bugs Clean up build Type compatibility and shape conformance checks on pointer assignments Original-commit: flang-compiler/f18@99d734c621 Reviewed-on: https://github.com/flang-compiler/f18/pull/442 Tree-same-pre-rewrite: false
80 lines
2.6 KiB
C++
80 lines
2.6 KiB
C++
// Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#ifndef FORTRAN_SEMANTICS_ASSIGNMENT_H_
|
|
#define FORTRAN_SEMANTICS_ASSIGNMENT_H_
|
|
|
|
#include "semantics.h"
|
|
#include "../common/indirection.h"
|
|
#include "../evaluate/expression.h"
|
|
|
|
namespace Fortran::parser {
|
|
template<typename> struct Statement;
|
|
struct AssignmentStmt;
|
|
struct ConcurrentHeader;
|
|
struct ForallStmt;
|
|
struct PointerAssignmentStmt;
|
|
struct Program;
|
|
struct WhereStmt;
|
|
struct WhereConstruct;
|
|
struct ForallStmt;
|
|
struct ForallConstruct;
|
|
}
|
|
|
|
namespace Fortran::evaluate {
|
|
class IntrinsicProcTable;
|
|
void CheckPointerAssignment(parser::ContextualMessages &,
|
|
const IntrinsicProcTable &, const Symbol &lhs,
|
|
const evaluate::Expr<evaluate::SomeType> &rhs);
|
|
}
|
|
|
|
namespace Fortran::semantics {
|
|
class AssignmentContext;
|
|
}
|
|
|
|
extern template class Fortran::common::Indirection<
|
|
Fortran::semantics::AssignmentContext>;
|
|
|
|
namespace Fortran::semantics {
|
|
class AssignmentChecker : public virtual BaseChecker {
|
|
public:
|
|
explicit AssignmentChecker(SemanticsContext &);
|
|
~AssignmentChecker();
|
|
void Enter(const parser::AssignmentStmt &);
|
|
void Enter(const parser::PointerAssignmentStmt &);
|
|
void Enter(const parser::WhereStmt &);
|
|
void Enter(const parser::WhereConstruct &);
|
|
void Enter(const parser::ForallStmt &);
|
|
void Enter(const parser::ForallConstruct &);
|
|
|
|
private:
|
|
common::Indirection<AssignmentContext> context_;
|
|
};
|
|
|
|
// Semantic analysis of an assignment statement or WHERE/FORALL construct.
|
|
void AnalyzeAssignment(
|
|
SemanticsContext &, const parser::Statement<parser::AssignmentStmt> &);
|
|
void AnalyzeAssignment(SemanticsContext &,
|
|
const parser::Statement<parser::PointerAssignmentStmt> &);
|
|
void AnalyzeAssignment(
|
|
SemanticsContext &, const parser::Statement<parser::WhereStmt> &);
|
|
void AnalyzeAssignment(
|
|
SemanticsContext &, const parser::Statement<parser::ForallStmt> &);
|
|
|
|
// R1125 concurrent-header is used in FORALL statements & constructs as
|
|
// well as in DO CONCURRENT loops.
|
|
void AnalyzeConcurrentHeader(
|
|
SemanticsContext &, const parser::ConcurrentHeader &);
|
|
}
|
|
#endif // FORTRAN_SEMANTICS_ASSIGNMENT_H_
|