GCC modified for the FreeChainXenon project
Find a file
Aldy Hernandez cf5bea76f9 Convert range-op.* to vrange.
This patch provides the infrastructure to make range-ops type agnostic.

First, the range_op_handler function has been replaced with an object
of the same name.  It's coded in such a way to minimize changes to the
code base, and to encapsulate the dispatch code.

Instead of:

	range_operator *op = range_op_handler (code, type);
	if (op)
	  op->fold_range (...);

We now do:
	range_op_handler op (code, type);
	if (op)
	  op->fold_range (...);

I've folded gimple_range_handler into the range_op_handler class,
since it's also a query into the range operators.

Instead of:

	range_operator *handler = gimple_range_handler (stmt);

We now do:

	range_op_handler handler (stmt);

This all has the added benefit of moving all the dispatch code into an
independent class and avoid polluting range_operator (which we'll
further split later when frange and prange come live).

There's this annoying "using" keyword that's been added to each
operator due to hiding rules in C++.  The issue is that we will have
different virtual versions of fold_range() for each combination of
operands.  For example:

	// Traditional binary op on irange's.
	fold_range (irange &lhs, const irange &op1, const irange &op2);
	// For POINTER_DIFF_EXPR:
	fold_range (irange &lhs, const prange &op1, const prange &op2);
	// Cast from irange to prange.
	fold_range (prange &lhs, const irange &op1, const irange &op2);

Overloading virtuals when there are multiple same named methods causes
hidden virtuals warnings from -Woverloaded-virtual, thus the using
keyword.  An alternative would be to have different names:
fold_range_III, fold_range_IPP, fold_range_PII, but that's uglier
still.

Tested on x86-64 & ppc64le Linux.

gcc/ChangeLog:

	* gimple-range-edge.cc (gimple_outgoing_range_stmt_p): Adjust for
	vrange and convert range_op_handler function calls to use the
	identically named object.
	* gimple-range-fold.cc (gimple_range_operand1): Same.
	(gimple_range_operand2): Same.
	(fold_using_range::fold_stmt): Same.
	(fold_using_range::range_of_range_op): Same.
	(fold_using_range::range_of_builtin_ubsan_call): Same.
	(fold_using_range::relation_fold_and_or): Same.
	(fur_source::register_outgoing_edges): Same.
	* gimple-range-fold.h (gimple_range_handler): Remove.
	* gimple-range-gori.cc (gimple_range_calc_op1): Adjust for vrange.
	(gimple_range_calc_op2): Same.
	(range_def_chain::get_def_chain): Same.
	(gori_compute::compute_operand_range): Same.
	(gori_compute::condexpr_adjust): Same.
	* gimple-range.cc (gimple_ranger::prefill_name): Same.
	(gimple_ranger::prefill_stmt_dependencies): Same.
	* range-op.cc (get_bool_state): Same.
	(class operator_equal): Add using clause.
	(class operator_not_equal): Same.
	(class operator_lt): Same.
	(class operator_le): Same.
	(class operator_gt): Same.
	(class operator_ge): Same.
	(class operator_plus): Same.
	(class operator_minus): Same.
	(class operator_mult): Same.
	(class operator_exact_divide): Same.
	(class operator_lshift): Same.
	(class operator_rshift): Same.
	(class operator_cast): Same.
	(class operator_logical_and): Same.
	(class operator_bitwise_and): Same.
	(class operator_logical_or): Same.
	(class operator_bitwise_or): Same.
	(class operator_bitwise_xor): Same.
	(class operator_trunc_mod): Same.
	(class operator_logical_not): Same.
	(class operator_bitwise_not): Same.
	(class operator_cst): Same.
	(class operator_identity): Same.
	(class operator_unknown): Same.
	(class operator_abs): Same.
	(class operator_negate): Same.
	(class operator_addr_expr): Same.
	(class pointer_or_operator): Same.
	(operator_plus::op1_range): Adjust for vrange.
	(operator_minus::op1_range): Same.
	(operator_mult::op1_range): Same.
	(operator_cast::op1_range): Same.
	(operator_bitwise_not::fold_range): Same.
	(operator_negate::fold_range): Same.
	(range_op_handler): Rename to...
	(get_handler): ...this.
	(range_op_handler::range_op_handler): New.
	(range_op_handler::fold_range): New.
	(range_op_handler::op1_range): New.
	(range_op_handler::op2_range): New.
	(range_op_handler::lhs_op1_relation): New.
	(range_op_handler::lhs_op2_relation): New.
	(range_op_handler::op1_op2_relation): New.
	(range_cast): Adjust for vrange.
	* range-op.h (range_op_handler): Remove function.
	(range_cast): Adjust for vrange.
	(class range_op_handler): New.
	(get_bool_state): Adjust for vrange.
	(empty_range_varying): Same.
	(relop_early_resolve): Same.
	* tree-data-ref.cc (compute_distributive_range): Same.
	* tree-vrp.cc (get_range_op_handler): Remove.
	(range_fold_binary_symbolics_p): Use range_op_handler class
	instead of get_range_op_handler.
	(range_fold_unary_symbolics_p): Same.
	(range_fold_binary_expr): Same.
	(range_fold_unary_expr): Same.
	* value-query.cc (range_query::get_tree_range): Adjust for vrange.
2022-06-01 10:55:45 +02:00
c++tools Daily bump. 2022-03-19 00:16:22 +00:00
config Daily bump. 2022-05-21 00:16:32 +00:00
contrib Daily bump. 2022-05-28 00:16:40 +00:00
fixincludes Daily bump. 2022-02-28 00:16:17 +00:00
gcc Convert range-op.* to vrange. 2022-06-01 10:55:45 +02:00
gnattools Daily bump. 2021-10-23 00:16:26 +00:00
gotools Daily bump. 2022-02-14 00:16:23 +00:00
include Daily bump. 2022-06-01 00:16:34 +00:00
INSTALL
intl Daily bump. 2021-11-30 00:16:44 +00:00
libada Update copyright years. 2022-01-03 10:42:10 +01:00
libatomic Daily bump. 2022-03-25 00:17:18 +00:00
libbacktrace Daily bump. 2022-05-29 00:16:31 +00:00
libcc1 Update copyright years. 2022-01-03 10:42:10 +01:00
libcody Daily bump. 2022-03-19 00:16:22 +00:00
libcpp Daily bump. 2022-05-30 00:16:21 +00:00
libdecnumber Daily bump. 2022-05-21 00:16:32 +00:00
libffi Daily bump. 2021-11-16 00:16:31 +00:00
libgcc Daily bump. 2022-05-26 00:16:30 +00:00
libgfortran Daily bump. 2022-01-27 00:16:29 +00:00
libgo runtime: use correct field name for PPC32 GLIBC registers 2022-04-20 17:49:44 -07:00
libgomp Daily bump. 2022-06-01 00:16:34 +00:00
libiberty Daily bump. 2022-05-24 00:17:03 +00:00
libitm Daily bump. 2022-02-04 00:16:24 +00:00
libobjc Update copyright years. 2022-01-03 10:42:10 +01:00
liboffloadmic Daily bump. 2021-10-20 00:16:43 +00:00
libphobos Daily bump. 2022-05-28 00:16:40 +00:00
libquadmath Daily bump. 2022-01-12 00:16:39 +00:00
libsanitizer Daily bump. 2022-05-06 00:16:26 +00:00
libssp Update copyright years. 2022-01-03 10:42:10 +01:00
libstdc++-v3 Daily bump. 2022-05-28 00:16:40 +00:00
libvtv Update copyright years. 2022-01-03 10:42:10 +01:00
lto-plugin Daily bump. 2022-05-05 00:16:29 +00:00
maintainer-scripts Daily bump. 2022-05-21 00:16:32 +00:00
zlib Daily bump. 2021-12-17 00:16:20 +00:00
.dir-locals.el dir-locals: Use https for bug references 2021-07-20 11:40:34 +01:00
.gitattributes
.gitignore Vim swap files not ignored 2022-05-28 09:38:29 -06:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2022-05-29 00:16:31 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess config.sub, config.guess : Import upstream 2021-01-25. 2021-02-23 17:21:10 +08:00
config.rpath
config.sub config.sub: change mode to 755. 2021-12-21 09:10:57 +01:00
configure LoongArch Port: Regenerate configure 2022-03-29 17:43:32 +08:00
configure.ac LoongArch Port: Regenerate configure 2022-03-29 17:43:32 +08:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 Revert "Sync with binutils: GCC: Pass --plugin to AR and RANLIB" 2021-12-15 20:45:58 -08:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS MAINTAINERS: Add myself to write after approval 2022-05-13 09:30:38 -05:00
Makefile.def toplevel: Makefile.def: Make configure-sim depend on all-readline 2022-03-09 20:54:37 +01:00
Makefile.in toplevel: Makefile.def: Make configure-sim depend on all-readline 2022-03-09 20:54:37 +01:00
Makefile.tpl Revert "Sync with binutils: GCC: Pass --plugin to AR and RANLIB" 2021-12-15 20:45:58 -08:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.