Skip to content

Commit

Permalink
VM: Adapt coding style in recent changes.
Browse files Browse the repository at this point in the history
* libinterp/parse-tree/pt-bytcode-vm-internal.h: Break some very long lines.
* libinterp/parse-tree/pt-bytcode-vm.h: Simplify preprocessor condition using
short-circuit && operator.
* libinterp/parse-tree/pt-bytcode-walk.cc: Use space after logical negation
operator.
  • Loading branch information
mmuetzel committed Aug 17, 2023
1 parent 2dc34a4 commit ce11cec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 4 additions & 2 deletions libinterp/parse-tree/pt-bytecode-vm-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ if (m_output_ignore_data)
if (n_args_on_callee_stack > n_args_callee) \
{ \
std::string fn_name = unwind_data->m_name; \
(*sp++).pee = new execution_exception {"error", "Octave:invalid-fun-call", fn_name + ": function called with too many inputs"};\
(*sp++).pee = new execution_exception {"error", "Octave:invalid-fun-call", \
fn_name + ": function called with too many inputs"}; \
(*sp++).i = static_cast<int> (error_type::EXECUTION_EXC); \
goto unwind; \
} \
Expand All @@ -409,7 +410,8 @@ int n_returns = N_RETURNS () - 1; /* %nargout in N_RETURNS */
if (n_returns >= 0 && nargout > n_returns) \
{ \
std::string fn_name = unwind_data->m_name; \
(*sp++).pee = new execution_exception {"error", "Octave:invalid-fun-call", fn_name + ": function called with too many outputs"};\
(*sp++).pee = new execution_exception {"error", "Octave:invalid-fun-call", \
fn_name + ": function called with too many outputs"}; \
(*sp++).i = static_cast<int> (error_type::EXECUTION_EXC); \
goto unwind; \
} \
Expand Down
9 changes: 3 additions & 6 deletions libinterp/parse-tree/pt-bytecode-vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,9 @@ class vm
loc_entry find_loc (int ip, std::vector<octave::loc_entry> &loc_entries);

// Disable some optimizations in GCC that are not suitable for dynamic label dispatch
#if defined __has_attribute
# if __has_attribute (optimize)
# define OCTAVE_VM_EXECUTE_ATTR __attribute__ ((optimize("no-gcse","no-crossjumping")))
# endif
#endif
#if !defined OCTAVE_VM_EXECUTE_ATTR
#if defined (__has_attribute) && __has_attribute (optimize)
# define OCTAVE_VM_EXECUTE_ATTR __attribute__ ((optimize("no-gcse","no-crossjumping")))
#else
# define OCTAVE_VM_EXECUTE_ATTR
#endif

Expand Down
2 changes: 1 addition & 1 deletion libinterp/parse-tree/pt-bytecode-walk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,7 @@ visit_octave_user_function (octave_user_function& fcn)
}

// TODO: The return_list is a nullptr for anonymous functions.
if (!returns)
if (! returns)
error ("Compiling anonymous functions is not supported by the VM yet");

// Does the function output varargout?
Expand Down

0 comments on commit ce11cec

Please sign in to comment.