summaryrefslogtreecommitdiff
path: root/gcc/genmatch.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-17 18:49:10 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-17 18:49:10 +0000
commitff690865f1bd81b60e0479701db3ac0303d2fef2 (patch)
treef6a69b77920259ec90eb2b68484d7e14ca6135ff /gcc/genmatch.c
parent9bac11b75df2ea37ee667b39bef3015aef857332 (diff)
downloadgcc-ff690865f1bd81b60e0479701db3ac0303d2fef2.tar.gz
Replace match.pd DEFINE_MATH_FNs with auto-generated lists
This patch autogenerates the operator lists for maths functions like SQRT, adding an additional entry for internal functions. E.g.: (define_operator_list SQRT BUILT_IN_SQRTF BUILT_IN_SQRT BUILT_IN_SQRTL IFN_SQRT) and: (define_operator_list CABS BUILT_IN_CABSF BUILT_IN_CABS BUILT_IN_CABSL null) (since there's no internal function for CABS). Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. gcc/ * Makefile.in (MOSTLYCLEANFILES): Add cfn-operators.pd. (generated_files): Likewise. (s-cfn-operators, cfn-operators.pd): New rules. (s-match): Depend on cfn-operators.pd. * gencfn-macros.c: Expand comment to describe -o behavior. (print_define_operator_list): New function. (main): Accept -o. Call print_define_operator_list. * genmatch.c (main): Add the current directory to the include path. * match.pd (DEFINE_MATH_FN): Delete. Include cfn-operators.pd instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230486 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r--gcc/genmatch.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 4df5689c860..3a20a48b497 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -4638,6 +4638,13 @@ main (int argc, char **argv)
cpp_callbacks *cb = cpp_get_callbacks (r);
cb->error = error_cb;
+ /* Add the build directory to the #include "" search path. */
+ cpp_dir *dir = XCNEW (cpp_dir);
+ dir->name = getpwd ();
+ if (!dir->name)
+ dir->name = ASTRDUP (".");
+ cpp_set_include_chains (r, dir, NULL, false);
+
if (!cpp_read_main_file (r, input))
return 1;
cpp_define (r, gimple ? "GIMPLE=1": "GENERIC=1");