On 04/25/2016 10:08 AM, Andres Tiraboschi wrote:
     *gcc/cp/constexpr.c (constexpr_fundef): Moved to gcc/cp/cp-tree.h.
     *gcc/cp/constexpr.c (constexpr_call): Ditto.
     *gcc/cp/constexpr.c (constexpr_ctx): Ditto.

Let's create a constexpr.h rather than expose constexpr internals to all of the front end. Really, I'd prefer to avoid exposing them at all. Why does what you want to do require all this implementation detail?

    bool non_constant_args = false;
    cxx_bind_parameters_in_call (ctx, t, &new_call,
                     non_constant_p, overflow_p, &non_constant_args);
+
+  constexpr_call_info call_info;
+  call_info.function = t;
+  call_info.lval = lval;
+  call_info.call = &new_call;
+  call_info.call_stack = call_stack;
+  call_info.non_constant_args = &non_constant_args;
+  call_info.non_const_p = non_constant_p;
+  call_info.ctx = ctx;
+  call_info.result = NULL_TREE;
+  invoke_plugin_callbacks (PLUGIN_EVAL_CALL_CONSTEXPR, &call_info);
+  if (call_info.result != NULL_TREE)
+    {
+      return call_info.result;
+    }
+
    if (*non_constant_p)
      return t;

This is a curious place to invoke the callback. Why before the *non_constant_p? More generally, why between evaluating the arguments and evaluating the function body?

Jason

Reply via email to