diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-12-19 18:11:57 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-12-19 18:11:57 +0100 |
commit | 01512446fea2a4564297db1b6ff7632370bd6728 (patch) | |
tree | 96a404bd26176e24281ab6e7f8e47df5a4bb34d1 /gcc/jit | |
parent | 3a3a8086bed05ffc8d24bb6908e4437bd9e982f7 (diff) | |
download | gcc-01512446fea2a4564297db1b6ff7632370bd6728.zip gcc-01512446fea2a4564297db1b6ff7632370bd6728.tar.gz gcc-01512446fea2a4564297db1b6ff7632370bd6728.tar.bz2 |
read-rtl.c (parse_reg_note_name): Replace Yoda conditions with typical order conditions.
* read-rtl.c (parse_reg_note_name): Replace Yoda conditions with
typical order conditions.
* sel-sched.c (extract_new_fences_from): Likewise.
* config/visium/constraints.md (J, K, L): Likewise.
* config/visium/predicates.md (const_shift_operand): Likewise.
* config/visium/visium.c (visium_legitimize_address,
visium_legitimize_reload_address): Likewise.
* config/m68k/m68k.c (output_reg_adjust, emit_reg_adjust): Likewise.
* config/arm/arm.c (arm_block_move_unaligned_straight): Likewise.
* config/avr/constraints.md (Y01, Ym1, Y02, Ym2): Likewise.
* config/avr/avr-log.c (avr_vdump, avr_log_set_avr_log,
SET_DUMP_DETAIL): Likewise.
* config/avr/predicates.md (const_8_16_24_operand): Likewise.
* config/avr/avr.c (STR_PREFIX_P, avr_popcount_each_byte,
avr_is_casesi_sequence, avr_casei_sequence_check_operands,
avr_set_core_architecture, avr_set_current_function,
avr_legitimize_reload_address, avr_asm_len, avr_print_operand,
output_movqi, output_movsisf, avr_out_plus, avr_out_bitop,
avr_out_fract, avr_adjust_insn_length, avr_encode_section_info,
avr_2word_insn_p, output_reload_in_const, avr_has_nibble_0xf,
avr_map_decompose, avr_fold_builtin): Likewise.
* config/avr/driver-avr.c (avr_devicespecs_file): Likewise.
* config/avr/gen-avr-mmcu-specs.c (str_prefix_p, print_mcu): Likewise.
* config/i386/i386.c (ix86_parse_stringop_strategy_string): Likewise.
* config/m32c/m32c-pragma.c (m32c_pragma_memregs): Likewise.
* config/m32c/m32c.c (m32c_conditional_register_usage,
m32c_address_cost): Likewise.
* config/m32c/predicates.md (shiftcount_operand,
longshiftcount_operand): Likewise.
* config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise.
* config/nios2/nios2.c (nios2_handle_custom_fpu_insn_option,
can_use_cdx_ldstw): Likewise.
* config/nios2/nios2.h (CDX_REG_P): Likewise.
* config/cr16/cr16.h (RETURN_ADDR_RTX, REGNO_MODE_OK_FOR_BASE_P):
Likewise.
* config/cr16/cr16.md (*mov<mode>_double): Likewise.
* config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise.
* config/h8300/h8300.c (h8300_rtx_costs, get_shift_alg): Likewise.
* config/vax/constraints.md (U06, U08, U16, CN6, S08, S16): Likewise.
* config/vax/vax.c (adjacent_operands_p): Likewise.
* config/ft32/constraints.md (L, b, KA): Likewise.
* config/ft32/ft32.c (ft32_load_immediate, ft32_expand_prologue):
Likewise.
* cfgexpand.c (expand_stack_alignment): Likewise.
* gcse.c (insert_expr_in_table): Likewise.
* print-rtl.c (rtx_writer::print_rtx_operand_codes_E_and_V): Likewise.
* cgraphunit.c (cgraph_node::expand): Likewise.
* ira-build.c (setup_min_max_allocno_live_range_point): Likewise.
* emit-rtl.c (add_insn): Likewise.
* input.c (dump_location_info): Likewise.
* passes.c (NEXT_PASS): Likewise.
* read-rtl-function.c (parse_note_insn_name,
function_reader::read_rtx_operand_r, function_reader::parse_mem_expr):
Likewise.
* sched-rgn.c (sched_rgn_init): Likewise.
* diagnostic-show-locus.c (layout::show_ruler): Likewise.
* combine.c (find_split_point, simplify_if_then_else, force_to_mode,
if_then_else_cond, simplify_shift_const_1, simplify_comparison): Likewise.
* explow.c (eliminate_constant_term): Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* cfgrtl.c (print_rtl_with_bb): Likewise.
* genhooks.c (emit_init_macros): Likewise.
* poly-int.h (maybe_ne, maybe_le, maybe_lt): Likewise.
* tree-data-ref.c (conflict_fn): Likewise.
* selftest.c (assert_streq): Likewise.
* expr.c (store_constructor_field, expand_expr_real_1): Likewise.
* fold-const.c (fold_range_test, extract_muldiv_1, fold_truth_andor,
fold_binary_loc, multiple_of_p): Likewise.
* reload.c (push_reload, find_equiv_reg): Likewise.
* et-forest.c (et_nca, et_below): Likewise.
* dbxout.c (dbxout_symbol_location): Likewise.
* reorg.c (relax_delay_slots): Likewise.
* dojump.c (do_compare_rtx_and_jump): Likewise.
* gengtype-parse.c (type): Likewise.
* simplify-rtx.c (simplify_gen_ternary, simplify_gen_relational,
simplify_const_relational_operation): Likewise.
* reload1.c (do_output_reload): Likewise.
* dumpfile.c (get_dump_file_info_by_switch): Likewise.
* gengtype.c (type_for_name): Likewise.
* gimple-ssa-sprintf.c (format_directive): Likewise.
ada/
* gcc-interface/trans.c (Loop_Statement_to_gnu): Replace Yoda
conditions with typical order conditions.
* gcc-interface/misc.c (gnat_get_array_descr_info,
default_pass_by_ref): Likewise.
* gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.
* adaint.c (__gnat_tmp_name): Likewise.
c-family/
* known-headers.cc (get_stdlib_header_for_name): Replace Yoda
conditions with typical order conditions.
c/
* c-typeck.c (comptypes_internal, function_types_compatible_p,
perform_integral_promotions, digest_init): Replace Yoda conditions
with typical order conditions.
* c-decl.c (check_bitfield_type_and_width): Likewise.
cp/
* name-lookup.c (get_std_name_hint): Replace Yoda conditions with
typical order conditions.
* class.c (check_bitfield_decl): Likewise.
* pt.c (convert_template_argument): Likewise.
* decl.c (duplicate_decls): Likewise.
* typeck.c (commonparms): Likewise.
fortran/
* scanner.c (preprocessor_line): Replace Yoda conditions with typical
order conditions.
* dependency.c (check_section_vs_section): Likewise.
* trans-array.c (gfc_conv_expr_descriptor): Likewise.
jit/
* jit-playback.c (get_type, playback::compile_to_file::copy_file,
playback::context::acquire_mutex): Replace Yoda conditions with
typical order conditions.
* libgccjit.c (gcc_jit_context_new_struct_type,
gcc_jit_struct_set_fields, gcc_jit_context_new_union_type,
gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise.
* jit-builtins.c (matches_builtin): Likewise.
* jit-recording.c (recording::compound_type::set_fields,
recording::fields::write_reproducer, recording::rvalue::set_scope,
recording::function::validate): Likewise.
* jit-logging.c (logger::decref): Likewise.
From-SVN: r255831
Diffstat (limited to 'gcc/jit')
-rw-r--r-- | gcc/jit/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/jit/jit-builtins.c | 14 | ||||
-rw-r--r-- | gcc/jit/jit-logging.c | 2 | ||||
-rw-r--r-- | gcc/jit/jit-playback.c | 11 | ||||
-rw-r--r-- | gcc/jit/jit-recording.c | 10 | ||||
-rw-r--r-- | gcc/jit/libgccjit.c | 12 |
6 files changed, 36 insertions, 27 deletions
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog index 7be5c47..eb2f793 100644 --- a/gcc/jit/ChangeLog +++ b/gcc/jit/ChangeLog @@ -1,3 +1,17 @@ +2017-12-19 Jakub Jelinek <jakub@redhat.com> + + * jit-playback.c (get_type, playback::compile_to_file::copy_file, + playback::context::acquire_mutex): Replace Yoda conditions with + typical order conditions. + * libgccjit.c (gcc_jit_context_new_struct_type, + gcc_jit_struct_set_fields, gcc_jit_context_new_union_type, + gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise. + * jit-builtins.c (matches_builtin): Likewise. + * jit-recording.c (recording::compound_type::set_fields, + recording::fields::write_reproducer, recording::rvalue::set_scope, + recording::function::validate): Likewise. + * jit-logging.c (logger::decref): Likewise. + 2017-11-30 Jakub Jelinek <jakub@redhat.com> * jit-recording.c diff --git a/gcc/jit/jit-builtins.c b/gcc/jit/jit-builtins.c index 35c4db0..ee37495 100644 --- a/gcc/jit/jit-builtins.c +++ b/gcc/jit/jit-builtins.c @@ -76,24 +76,20 @@ matches_builtin (const char *in_name, if (debug) fprintf (stderr, "seen builtin: %s\n", bd.name); - if (0 == strcmp (bd.name, in_name)) - { - return true; - } + if (strcmp (bd.name, in_name) == 0) + return true; if (bd.both_p) { /* Then the macros in builtins.def gave a "__builtin_" prefix to bd.name, but we should also recognize the form without the prefix. */ - gcc_assert (0 == strncmp (bd.name, prefix, prefix_len)); + gcc_assert (strncmp (bd.name, prefix, prefix_len) == 0); if (debug) fprintf (stderr, "testing without prefix as: %s\n", bd.name + prefix_len); - if (0 == strcmp (bd.name + prefix_len, in_name)) - { - return true; - } + if (strcmp (bd.name + prefix_len, in_name) == 0) + return true; } return false; diff --git a/gcc/jit/jit-logging.c b/gcc/jit/jit-logging.c index 9c39f62..779b756 100644 --- a/gcc/jit/jit-logging.c +++ b/gcc/jit/jit-logging.c @@ -79,7 +79,7 @@ logger::decref (const char *reason) if (m_log_refcount_changes) log ("%s: reason: %s refcount now %i", __PRETTY_FUNCTION__, reason, m_refcount); - if (0 == m_refcount) + if (m_refcount == 0) delete this; } diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c index fe9fb2d..43b0ec9 100644 --- a/gcc/jit/jit-playback.c +++ b/gcc/jit/jit-playback.c @@ -211,10 +211,9 @@ playback::context:: get_type (enum gcc_jit_types type_) { tree type_node = get_tree_node_for_type (type_); - if (NULL == type_node) + if (type_node == NULL) { - add_error (NULL, - "unrecognized (enum gcc_jit_types) value: %i", type_); + add_error (NULL, "unrecognized (enum gcc_jit_types) value: %i", type_); return NULL; } @@ -2049,7 +2048,7 @@ playback::compile_to_file::copy_file (const char *src_path, /* Use stat on the filedescriptor to get the mode, so that we can copy it over (in particular, the "executable" bits). */ - if (-1 == fstat (fileno (f_in), &stat_buf)) + if (fstat (fileno (f_in), &stat_buf) == -1) { add_error (NULL, "unable to fstat %s: %s", @@ -2113,7 +2112,7 @@ playback::compile_to_file::copy_file (const char *src_path, /* Set the permissions of the copy to those of the original file, in particular the "executable" bits. */ - if (-1 == fchmod (fileno (f_out), stat_buf.st_mode)) + if (fchmod (fileno (f_out), stat_buf.st_mode) == -1) add_error (NULL, "error setting mode of %s: %s", dst_path, @@ -2139,7 +2138,7 @@ playback::context::acquire_mutex () /* Acquire the big GCC mutex. */ JIT_LOG_SCOPE (get_logger ()); pthread_mutex_lock (&jit_mutex); - gcc_assert (NULL == active_playback_ctxt); + gcc_assert (active_playback_ctxt == NULL); active_playback_ctxt = this; } diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c index fb492c0..f2cfcfd 100644 --- a/gcc/jit/jit-recording.c +++ b/gcc/jit/jit-recording.c @@ -2987,7 +2987,7 @@ recording::compound_type::set_fields (location *loc, field **field_array) { m_loc = loc; - gcc_assert (NULL == m_fields); + gcc_assert (m_fields == NULL); m_fields = new fields (this, num_fields, field_array); m_ctxt->record (m_fields); @@ -3182,7 +3182,7 @@ void recording::fields::write_reproducer (reproducer &r) { if (m_struct_or_union) - if (NULL == m_struct_or_union->dyn_cast_struct ()) + if (m_struct_or_union->dyn_cast_struct () == NULL) /* We have a union; the fields have already been written by union::write_reproducer. */ return; @@ -3370,7 +3370,7 @@ void recording::rvalue::set_scope (function *scope) { gcc_assert (scope); - gcc_assert (NULL == m_scope); + gcc_assert (m_scope == NULL); m_scope = scope; } @@ -3750,7 +3750,7 @@ recording::function::validate () /* Complain about empty functions with non-void return type. */ if (m_kind != GCC_JIT_FUNCTION_IMPORTED && m_return_type != m_ctxt->get_type (GCC_JIT_TYPE_VOID)) - if (0 == m_blocks.length ()) + if (m_blocks.length () == 0) m_ctxt->add_error (m_loc, "function %s returns non-void (type: %s)" " but has no blocks", @@ -3771,7 +3771,7 @@ recording::function::validate () /* Check that all blocks are reachable. */ if (!m_ctxt->get_inner_bool_option (INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS) - && m_blocks.length () > 0 && 0 == num_invalid_blocks) + && m_blocks.length () > 0 && num_invalid_blocks == 0) { /* Iteratively walk the graph of blocks, marking their "m_is_reachable" flag, starting at the initial block. */ diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c index 8bad4f6..fa8ef35 100644 --- a/gcc/jit/libgccjit.c +++ b/gcc/jit/libgccjit.c @@ -592,7 +592,7 @@ gcc_jit_context_new_struct_type (gcc_jit_context *ctxt, { RETURN_NULL_IF_FAIL (fields[i], ctxt, loc, "NULL field ptr"); RETURN_NULL_IF_FAIL_PRINTF2 ( - NULL == fields[i]->get_container (), + fields[i]->get_container () == NULL, ctxt, loc, "%s is already a field of %s", fields[i]->get_debug_string (), @@ -657,7 +657,7 @@ gcc_jit_struct_set_fields (gcc_jit_struct *struct_type, JIT_LOG_FUNC (ctxt->get_logger ()); /* LOC can be NULL. */ RETURN_IF_FAIL_PRINTF1 ( - NULL == struct_type->get_fields (), ctxt, loc, + struct_type->get_fields () == NULL, ctxt, loc, "%s already has had fields set", struct_type->get_debug_string ()); if (num_fields) @@ -671,7 +671,7 @@ gcc_jit_struct_set_fields (gcc_jit_struct *struct_type, struct_type->get_debug_string (), i); RETURN_IF_FAIL_PRINTF2 ( - NULL == fields[i]->get_container (), + fields[i]->get_container () == NULL, ctxt, loc, "%s is already a field of %s", fields[i]->get_debug_string (), @@ -706,7 +706,7 @@ gcc_jit_context_new_union_type (gcc_jit_context *ctxt, { RETURN_NULL_IF_FAIL (fields[i], ctxt, loc, "NULL field ptr"); RETURN_NULL_IF_FAIL_PRINTF2 ( - NULL == fields[i]->get_container (), + fields[i]->get_container () == NULL, ctxt, loc, "%s is already a field of %s", fields[i]->get_debug_string (), @@ -880,7 +880,7 @@ gcc_jit_context_new_function (gcc_jit_context *ctxt, ctxt, loc, "NULL parameter %i creating function %s", i, name); RETURN_NULL_IF_FAIL_PRINTF5 ( - (NULL == params[i]->get_scope ()), + params[i]->get_scope () == NULL, ctxt, loc, "parameter %i \"%s\"" " (type: %s)" @@ -2925,7 +2925,7 @@ gcc_jit_timer_pop (gcc_jit_timer *timer, item_name); RETURN_IF_FAIL_PRINTF2 - (0 == strcmp (item_name, top_item_name), NULL, NULL, + (strcmp (item_name, top_item_name) == 0, NULL, NULL, "mismatching item_name:" " top of timing stack: \"%s\"," " attempting to pop: \"%s\"", |