aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Evaluate/tools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Evaluate/tools.cpp')
-rw-r--r--flang/lib/Evaluate/tools.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/flang/lib/Evaluate/tools.cpp b/flang/lib/Evaluate/tools.cpp
index 171dd91..9c059b0 100644
--- a/flang/lib/Evaluate/tools.cpp
+++ b/flang/lib/Evaluate/tools.cpp
@@ -1693,17 +1693,17 @@ struct ArgumentExtractor
// to int(kind=4) for example.
return (*this)(x.template operand<0>());
} else {
- return std::make_pair(operation::OperationCode(x),
+ return std::make_pair(operation::OperationCode(x.derived()),
OperationArgs(x, std::index_sequence_for<Os...>{}));
}
}
template <typename T> Result operator()(const Designator<T> &x) const {
- return {operation::Operator::Identity, {AsSomeExpr(x)}};
+ return {operation::OperationCode(x), {AsSomeExpr(x)}};
}
template <typename T> Result operator()(const Constant<T> &x) const {
- return {operation::Operator::Identity, {AsSomeExpr(x)}};
+ return {operation::OperationCode(x), {AsSomeExpr(x)}};
}
template <typename... Rs>
@@ -1793,6 +1793,10 @@ std::string operation::ToString(operation::Operator op) {
llvm_unreachable("Unhandler operator");
}
+operation::Operator operation::OperationCode(const Relational<SomeType> &op) {
+ return common::visit([](auto &&s) { return OperationCode(s); }, op.u);
+}
+
operation::Operator operation::OperationCode(const ProcedureDesignator &proc) {
Operator code{llvm::StringSwitch<Operator>(proc.GetName())
.Case("associated", Operator::Associated)