aboutsummaryrefslogtreecommitdiff
path: root/gdb/expop.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:29 -0700
commite447908052f54164eec481d15a5274ddf385569d (patch)
tree869b45f3dba350e9a6097bac187c6ae9a77c46dc /gdb/expop.h
parent95d49dfbba00253382d0f7ad0ea2052b2b7bc445 (diff)
downloadbinutils-e447908052f54164eec481d15a5274ddf385569d.zip
binutils-e447908052f54164eec481d15a5274ddf385569d.tar.gz
binutils-e447908052f54164eec481d15a5274ddf385569d.tar.bz2
Introduce class adl_func_operation
This adds class adl_func_operation, which implements argument-dependent lookup function calls. Other function calls will be handled in a different way. However, because ADL calls were created in a single spot in the C++ parser, and because they had different semantics from the other cases, it was convenient to treat them specially. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * expop.h (class adl_func_operation): New. * eval.c (adl_func_operation::evaluate): New method.
Diffstat (limited to 'gdb/expop.h')
-rw-r--r--gdb/expop.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/expop.h b/gdb/expop.h
index 7850c45..0785df9 100644
--- a/gdb/expop.h
+++ b/gdb/expop.h
@@ -2030,6 +2030,25 @@ protected:
override;
};
+/* This class implements ADL (aka Koenig) function calls for C++. It
+ holds the name of the function to call, the block in which the
+ lookup should be done, and a vector of arguments. */
+class adl_func_operation
+ : public tuple_holding_operation<std::string, const block *,
+ std::vector<operation_up>>
+{
+public:
+
+ using tuple_holding_operation::tuple_holding_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override;
+
+ enum exp_opcode opcode () const override
+ { return OP_ADL_FUNC; }
+};
+
} /* namespace expr */
#endif /* EXPOP_H */