Skip to content

Commit aab7380

Browse files
committed
Add overload for Relational<SomeType>
1 parent 9d032d4 commit aab7380

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

flang/include/flang/Evaluate/tools.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,8 @@ template <int Kind> Operator OperationCode(const LogicalOperation<Kind> &op) {
14181418
return Operator::Unknown;
14191419
}
14201420

1421+
Operator OperationCode(const Relational<SomeType> &op);
1422+
14211423
template <typename T> Operator OperationCode(const Relational<T> &op) {
14221424
switch (op.opr) {
14231425
case common::RelationalOperator::LT:

flang/lib/Evaluate/tools.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,10 @@ std::string operation::ToString(operation::Operator op) {
17931793
llvm_unreachable("Unhandler operator");
17941794
}
17951795

1796+
operation::Operator operation::OperationCode(const Relational<SomeType> &op) {
1797+
return common::visit([](auto &&s) { return OperationCode(s); }, op.u);
1798+
}
1799+
17961800
operation::Operator operation::OperationCode(const ProcedureDesignator &proc) {
17971801
Operator code{llvm::StringSwitch<Operator>(proc.GetName())
17981802
.Case("associated", Operator::Associated)

0 commit comments

Comments
 (0)