mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-26 17:57:07 +00:00
1f8790050b
Original-commit: flang-compiler/f18@9fe84f45d7 Reviewed-on: https://github.com/flang-compiler/f18/pull/1094
28 lines
981 B
C++
28 lines
981 B
C++
//===-- lib/Semantics/check-if-stmt.cpp -----------------------------------===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "check-if-stmt.h"
|
|
#include "flang/Parser/message.h"
|
|
#include "flang/Parser/parse-tree.h"
|
|
#include "flang/Semantics/tools.h"
|
|
|
|
namespace Fortran::semantics {
|
|
|
|
void IfStmtChecker::Leave(const parser::IfStmt &ifStmt) {
|
|
// C1143 Check that the action stmt is not an if stmt
|
|
const auto &body{
|
|
std::get<parser::UnlabeledStatement<parser::ActionStmt>>(ifStmt.t)};
|
|
if (std::holds_alternative<common::Indirection<parser::IfStmt>>(
|
|
body.statement.u)) {
|
|
context_.Say(
|
|
body.source, "IF statement is not allowed in IF statement"_err_en_US);
|
|
}
|
|
}
|
|
|
|
} // namespace Fortran::semantics
|