Skip to content

Commit

Permalink
Partially reverted changes introduced earlier
Browse files Browse the repository at this point in the history
- arguments to eval() are now 'const&' again
  • Loading branch information
hkaiser committed May 4, 2019
1 parent e292784 commit 8349ebe
Show file tree
Hide file tree
Showing 237 changed files with 628 additions and 600 deletions.
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/access_argument.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
std::string const& name, std::string const& codename);

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context) const override;
primitive_arguments_type const& params,
eval_context) const override;

void store(primitive_arguments_type&& data,
primitive_arguments_type&& params, eval_context ctx) override;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/access_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
primitive_arguments_type&& params, eval_context ctx) override;

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context ctx) const override;
primitive_arguments_type const& params,
eval_context ctx) const override;

topology expression_topology(std::set<std::string>&& functions,
std::set<std::string>&& resolve_children) const override;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/access_variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
primitive_arguments_type&& params, eval_context ctx) override;

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context ctx) const override;
primitive_arguments_type const& params,
eval_context ctx) const override;

topology expression_topology(std::set<std::string>&& functions,
std::set<std::string>&& resolve_children) const override;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/assert_condition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ namespace phylanx { namespace execution_tree { namespace primitives

hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;
};

PHYLANX_EXPORT primitive create_assert_condition(
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/call_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
std::set<std::string>&& resolve_children) const override;

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context ctx) const override;
primitive_arguments_type const& params,
eval_context ctx) const override;

void store(primitive_arguments_type&& data,
primitive_arguments_type&& params, eval_context ctx) override;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/console_output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
private:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;
};

PHYLANX_EXPORT primitive create_console_output(hpx::id_type const& locality,
Expand Down
7 changes: 4 additions & 3 deletions phylanx/execution_tree/primitives/debug_output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
protected:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

using args_type = primitive_arguments_type;

Expand All @@ -49,8 +50,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
extern match_pattern_type const locality_match_data;

hpx::future<primitive_argument_type> locality_id(
phylanx::execution_tree::primitive_arguments_type,
phylanx::execution_tree::primitive_arguments_type,
phylanx::execution_tree::primitive_arguments_type const&,
phylanx::execution_tree::primitive_arguments_type const&,
std::string const&, std::string const&, eval_context);
}}}

Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/define_variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
// Create a new instance of the variable and initialize it with the
// value as returned by evaluating the given body.
hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

// return the topology for this variable definition
topology expression_topology(std::set<std::string>&& functions,
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/enable_tracing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ namespace phylanx { namespace execution_tree { namespace primitives

hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;
};

PHYLANX_EXPORT primitive create_enable_tracing(hpx::id_type const& locality,
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/format_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
private:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;
};

PHYLANX_EXPORT primitive create_format_string(hpx::id_type const& locality,
Expand Down
5 changes: 3 additions & 2 deletions phylanx/execution_tree/primitives/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ namespace phylanx { namespace execution_tree { namespace primitives
std::string const& name, std::string const& codename);

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context ctx) const override;
primitive_arguments_type const& params,
eval_context ctx) const override;

bool bind(primitive_arguments_type&& params,
bool bind(primitive_arguments_type const& params,
eval_context ctx) const override;

void store(primitive_argument_type&& data,
Expand Down
7 changes: 4 additions & 3 deletions phylanx/execution_tree/primitives/generic_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ namespace phylanx { namespace execution_tree { namespace primitives
{}

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& args, eval_context ctx) const override
primitive_arguments_type const& args,
eval_context ctx) const override
{
return hpx::async(Action(), hpx::find_here(), operands_,
std::move(args), name_, codename_, std::move(ctx));
return hpx::async(Action(), hpx::find_here(), operands_, args,
name_, codename_, std::move(ctx));
}
};

Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/lambda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
std::set<std::string>&& resolve_children) const override;

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context ctx) const override;
primitive_arguments_type const& params,
eval_context ctx) const override;

void store(primitive_arguments_type&& data,
primitive_arguments_type&& params, eval_context ctx) override;
Expand Down
5 changes: 3 additions & 2 deletions phylanx/execution_tree/primitives/primitive_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ namespace phylanx { namespace execution_tree { namespace primitives

// eval_action
PHYLANX_EXPORT hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context ctx) const;
primitive_arguments_type const& params,
eval_context ctx) const;

PHYLANX_EXPORT hpx::future<primitive_argument_type> eval_single(
primitive_argument_type&& param, eval_context ctx) const;
Expand All @@ -80,7 +81,7 @@ namespace phylanx { namespace execution_tree { namespace primitives

// bind an invocable object
PHYLANX_EXPORT bool bind(
primitive_arguments_type params, eval_context ctx) const;
primitive_arguments_type const& params, eval_context ctx) const;

HPX_DEFINE_COMPONENT_ACTION(
primitive_component, eval, eval_action);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ namespace phylanx { namespace execution_tree

// eval_action
virtual hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context ctx) const;
primitive_arguments_type const& params, eval_context ctx) const;

virtual hpx::future<primitive_argument_type> eval(
primitive_argument_type&& param, eval_context ctx) const;

// eval implementation
virtual hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const;
primitive_arguments_type const& args, eval_context ctx) const;

// store_action
virtual void store(primitive_arguments_type&&,
Expand All @@ -74,7 +74,7 @@ namespace phylanx { namespace execution_tree

// bind_action
virtual bool bind(
primitive_arguments_type&& params, eval_context ctx) const;
primitive_arguments_type const& params, eval_context ctx) const;

// initialize evaluation context (used by target-reference only)
virtual void set_eval_context(eval_context ctx);
Expand All @@ -84,7 +84,8 @@ namespace phylanx { namespace execution_tree

// helper functions to invoke eval functionalities
hpx::future<primitive_argument_type> do_eval(
primitive_arguments_type&& params, eval_context ctx) const;
primitive_arguments_type const& params,
eval_context ctx) const;

hpx::future<primitive_argument_type> do_eval(
primitive_argument_type&& param, eval_context ctx) const;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/primitive_name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
private:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;
};

PHYLANX_EXPORT primitive create_primitive_name(hpx::id_type const& locality,
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/primitive_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
private:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;
};

PHYLANX_EXPORT primitive create_primitive_type(hpx::id_type const& locality,
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/store_operation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace phylanx {namespace execution_tree { namespace primitives
std::string const& name, std::string const& codename);

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context) const override;

hpx::future<primitive_argument_type> eval(
primitive_argument_type&& arg, eval_context ctx) const override;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/string_output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ namespace phylanx { namespace execution_tree { namespace primitives

hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

public:
static match_pattern_type const match_data;
Expand Down
5 changes: 3 additions & 2 deletions phylanx/execution_tree/primitives/target_reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ namespace phylanx { namespace execution_tree { namespace primitives
std::string const& name, std::string const& codename);

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context) const override;
primitive_arguments_type const& params,
eval_context) const override;
hpx::future<primitive_argument_type> eval(
primitive_argument_type&& param, eval_context) const override;

bool bind(primitive_arguments_type&& args,
bool bind(primitive_arguments_type const& args,
eval_context ctx) const override;

void store(primitive_arguments_type&& data,
Expand Down
5 changes: 3 additions & 2 deletions phylanx/execution_tree/primitives/variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ namespace phylanx { namespace execution_tree { namespace primitives
std::string const& name, std::string const& codename);

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& params, eval_context ctx) const override;
primitive_arguments_type const& params,
eval_context) const override;
hpx::future<primitive_argument_type> eval(
primitive_argument_type&& arg, eval_context ctx) const override;

bool bind(primitive_arguments_type&& params,
bool bind(primitive_arguments_type const& params,
eval_context ctx) const override;

void store(primitive_arguments_type&& data,
Expand Down
3 changes: 2 additions & 1 deletion phylanx/execution_tree/primitives/variable_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
std::string const& name, std::string const& codename);

hpx::future<primitive_argument_type> eval(
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

void store(primitive_argument_type&& data,
primitive_arguments_type&& params, eval_context ctx) override;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/plugins/algorithms/als.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
protected:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

public:
static match_pattern_type const match_data;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/plugins/algorithms/lra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
protected:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

public:
static match_pattern_type const match_data;
Expand Down
2 changes: 1 addition & 1 deletion phylanx/plugins/arithmetics/add_operation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace phylanx { namespace execution_tree { namespace primitives
protected:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const;
primitive_arguments_type const& args, eval_context ctx) const;

public:
static match_pattern_type const match_data;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/plugins/arithmetics/cumulative.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
protected:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

public:
cumulative() = default;
Expand Down
7 changes: 4 additions & 3 deletions phylanx/plugins/arithmetics/cumulative_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ namespace phylanx { namespace execution_tree { namespace primitives
template <typename Op, typename Derived>
hpx::future<primitive_argument_type> cumulative<Op, Derived>::eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const
primitive_arguments_type const& args, eval_context ctx) const
{
if (operands.empty() || operands.size() > 3)
{
Expand Down Expand Up @@ -477,8 +477,9 @@ namespace phylanx { namespace execution_tree { namespace primitives
this_->generate_error_message(
"target operand has unsupported type"));
}),
detail::map_operands(operands, functional::value_operand{},
std::move(args), name_, codename_, std::move(ctx)));
detail::map_operands(
operands, functional::value_operand{}, args,
name_, codename_, std::move(ctx)));
}
}}}

Expand Down
3 changes: 2 additions & 1 deletion phylanx/plugins/arithmetics/generic_operation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
protected:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

template <typename T>
using arg_type = ir::node_data<T>;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/plugins/arithmetics/generic_operation_bool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
protected:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

template <typename T>
using arg_type = ir::node_data<T>;
Expand Down
3 changes: 2 additions & 1 deletion phylanx/plugins/arithmetics/numeric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ namespace phylanx { namespace execution_tree { namespace primitives
protected:
hpx::future<primitive_argument_type> eval(
primitive_arguments_type const& operands,
primitive_arguments_type&& args, eval_context ctx) const override;
primitive_arguments_type const& args,
eval_context ctx) const override;

template <typename T>
using arg_type = ir::node_data<T>;
Expand Down
Loading

0 comments on commit 8349ebe

Please sign in to comment.