llvm/flang/lib/semantics/canonicalize-do.h
Tim Keith 251e0196e4 [flang] Simplify Semantics::Perform
`Semantics::Perform` is mostly a series of calls followed by a check
for fatal errors. There is more error checking logic than real code.

To make it clearer, change each of the phases it calls to return true
on success so that `Perform` can just call them one after the other.

Original-commit: flang-compiler/f18@a218cac788
Reviewed-on: https://github.com/flang-compiler/f18/pull/317
2019-03-06 17:07:25 -08:00

26 lines
1,010 B
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_CANONICALIZE_DO_H_
#define FORTRAN_SEMANTICS_CANONICALIZE_DO_H_
// Converts a LabelDo followed by a sequence of ExecutableConstructs (perhaps
// logically nested) into the more structured DoConstruct (explicitly nested)
namespace Fortran::parser {
struct Program;
bool CanonicalizeDo(Program &program);
}
#endif // FORTRAN_SEMANTICS_CANONICALIZE_DO_H_