1 //===-- lib/Common/Fortran.cpp --------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "flang/Common/Fortran.h"
10 
11 namespace Fortran::common {
12 
13 const char *AsFortran(NumericOperator opr) {
14   switch (opr) {
15     SWITCH_COVERS_ALL_CASES
16   case NumericOperator::Power:
17     return "**";
18   case NumericOperator::Multiply:
19     return "*";
20   case NumericOperator::Divide:
21     return "/";
22   case NumericOperator::Add:
23     return "+";
24   case NumericOperator::Subtract:
25     return "-";
26   }
27 }
28 
29 const char *AsFortran(LogicalOperator opr) {
30   switch (opr) {
31     SWITCH_COVERS_ALL_CASES
32   case LogicalOperator::And:
33     return ".and.";
34   case LogicalOperator::Or:
35     return ".or.";
36   case LogicalOperator::Eqv:
37     return ".eqv.";
UseRemainder()38   case LogicalOperator::Neqv:
39     return ".neqv.";
40   case LogicalOperator::Not:
41     return ".not.";
42   }
43 }
44 
45 const char *AsFortran(RelationalOperator opr) {
46   switch (opr) {
47     SWITCH_COVERS_ALL_CASES
48   case RelationalOperator::LT:
49     return "<";
50   case RelationalOperator::LE:
Round(z, quo *Dec, remNum, remDen *big.Int)51     return "<=";
52   case RelationalOperator::EQ:
53     return "==";
54   case RelationalOperator::NE:
55     return "/=";
56   case RelationalOperator::GE:
57     return ">=";
58   case RelationalOperator::GT:
59     return ">";
60   }
61 }
62 
63 } // namespace Fortran::common
64