summaryrefslogtreecommitdiff
path: root/gcc/gensupport.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-10 20:21:23 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-10 20:21:23 +0000
commit960ebfe702d97f43ba95d96859528624bc81069e (patch)
tree4a0361cb6d566c6fbfc6ab0e87114c356330d3d5 /gcc/gensupport.c
parentc7b9531f46e66bed46a7359b43980ff59134a0c7 (diff)
downloadgcc-960ebfe702d97f43ba95d96859528624bc81069e.tar.gz
gcc/
* Makefile.in (READ_MD_H): New variable. (BUILD_RTL): Add build/read-md.o. (lto-wrapper.o): Depend on coretypes.h instead of defaults.h. (build/gensupport.o, build/read-rtl.o, build/genattr.o) (build/genattrtab.o, build/genconditions.o build/genemit.o) (build/genextract.o, build/genflags.o, build/genoutput.o) (build/genpreds.o, build/genrecog.o): Depend on $(READ_MD_H). (build/read-md.o): New rule. * defaults.h (obstack_chunk_alloc, obstack_chunk_free) (OBSTACK_CHUNK_SIZE, gcc_obstack_init): Move to... * coretypes.h: ...here. * lto-wrapper.c: Include coretypes.h instead of defaults.h. * pretty-print.c (obstack_chunk_alloc, obstack_chunk_free): Delete. * genattr.c: Include read-md.h. * genattrtab.c: Likewise. * genconditions.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * genoutput.c: Likewise. * genpreds.c: Likewise. * genrecog.c: Likewise. * rtl.h (read_skip_spaces, copy_rtx_ptr_loc, print_rtx_ptr_loc) (join_c_conditions, print_c_condition, read_rtx_filename) (read_rtx_lineno): Move to read-md.h. * read-rtl.c: Include read-md.h. (ptr_loc, string_obstack, ptr_locs, ptr_loc_obstack) (joined_conditions, joined_conditions_obstack, read_rtx_lineno) (read_rtx_filename, fatal_with_file_and_line, fatal_expected_char) (leading_ptr_hash, leading_ptr_eq_p, set_rtx_ptr_loc, get_rtx_ptr_loc) (copy_rtx_ptr_loc, print_rtx_ptr_loc, join_c_conditions) (print_c_condition, read_skip_spaces, read_escape, read_quoted_string) (read_braced_string, read_string): Move to read-md.c. (read_rtx): Move some initialization to init_md_reader and call init_md_reader here. * gensupport.h (message_with_line, n_comma_elts, scan_comma_elt): Move to read-md.h. * gensupport.c: Include read-md.h. (message_with_line, n_comma_elts, scan_comma_elt): Move to read-md.c. * read-md.h, read-md.c: New files. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160570 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gensupport.c')
-rw-r--r--gcc/gensupport.c62
1 files changed, 1 insertions, 61 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 74b1d256ba2..4332772444d 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -26,6 +26,7 @@
#include "obstack.h"
#include "errors.h"
#include "hashtab.h"
+#include "read-md.h"
#include "gensupport.h"
@@ -119,20 +120,6 @@ static char *save_string (const char *, int);
static void init_predicate_table (void);
static void record_insn_name (int, const char *);
-void
-message_with_line (int lineno, const char *msg, ...)
-{
- va_list ap;
-
- va_start (ap, msg);
-
- fprintf (stderr, "%s:%d: ", read_rtx_filename, lineno);
- vfprintf (stderr, msg, ap);
- fputc ('\n', stderr);
-
- va_end (ap);
-}
-
/* Make a version of gen_rtx_CONST_INT so that GEN_INT can be used in
the gensupport programs. */
@@ -1227,53 +1214,6 @@ traverse_c_tests (htab_trav callback, void *info)
htab_traverse (condition_table, callback, info);
}
-
-/* Given a string, return the number of comma-separated elements in it.
- Return 0 for the null string. */
-int
-n_comma_elts (const char *s)
-{
- int n;
-
- if (*s == '\0')
- return 0;
-
- for (n = 1; *s; s++)
- if (*s == ',')
- n++;
-
- return n;
-}
-
-/* Given a pointer to a (char *), return a pointer to the beginning of the
- next comma-separated element in the string. Advance the pointer given
- to the end of that element. Return NULL if at end of string. Caller
- is responsible for copying the string if necessary. White space between
- a comma and an element is ignored. */
-
-const char *
-scan_comma_elt (const char **pstr)
-{
- const char *start;
- const char *p = *pstr;
-
- if (*p == ',')
- p++;
- while (ISSPACE(*p))
- p++;
-
- if (*p == '\0')
- return NULL;
-
- start = p;
-
- while (*p != ',' && *p != '\0')
- p++;
-
- *pstr = p;
- return start;
-}
-
/* Helper functions for define_predicate and define_special_predicate
processing. Shared between genrecog.c and genpreds.c. */