On 4/22/20 12:39 PM, Giuliano Belinassi via Gcc-patches wrote:
This patch refactors tree-ssa-operands.c by wrapping the global variables into a class, and also removes unused code.
Just a few comments on this nice cleanup: It looks to me like class build_virtual_operands isn't safe to copy or assign due its vec member. If that's correct, can you please either disable copying and assignments for such classes or make sure they can be? (The macro DISABLE_COPY_AND_ASSIGN will do the former.) I would also suggest to avoid declaring member functions inline. It serves no purpose if the function is also defined inline later on and causes problems when it isn't (e.g., when the definition is moved to a .cc file). Finally, as a purely cosmetic improvement, although it's benign the void parameter in a parameter list can be omitted in C++. Martin
Just sending this for when Stage1 is back again. I ran the testsuite and bootstraped in a x86_64 linux machine and found no issues. gcc/ChangeLog: 2020-04-22 Giuliano Belinassi <giuliano.belina...@usp.br> * tree-ssa-operands.c (build_virtual_operands): New class. (operands_bitmap_obstack): Remove. (n_initialized): Remove. (build_uses): Move to build_virtual_operands class. (build_vuse): Same as above. (build_vdef): Same as above. (verify_ssa_operands): Same as above. (finalize_ssa_uses): Same as above. (cleanup_build_arrays): Same as above. (finalize_ssa_stmt_operands): Same as above. (start_ssa_stmt_operands): Same as above. (append_use): Same as above. (append_vdef): Same as above. (add_virtual_operand): Same as above. (add_stmt_operand): Same as above. (get_mem_ref_operands): Same as above. (get_tmr_operands): Same as above. (maybe_add_call_vops): Same as above. (get_asm_stmt_operands): Same as above. (get_expr_operands): Same as above. (parse_ssa_operands): Same as above. (finalize_ssa_defs): Same as above. (build_ssa_operands): Same as above, plus create a C-like wrapper. (update_stmt_operands): Create an instance of build_virtual_operands.