aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-02-19 14:39:55 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-02-19 14:39:55 -0800
commit4221057e8f2e0e6425b61952bc06b1904681bf69 (patch)
tree94df3d1c9f4ce657fd99d4dcc5822e2ca9695645 /gcc/tree.h
parente5b792193379be3beab505f1a72fb4fedaf62e6b (diff)
downloadgcc-4221057e8f2e0e6425b61952bc06b1904681bf69.zip
gcc-4221057e8f2e0e6425b61952bc06b1904681bf69.tar.gz
gcc-4221057e8f2e0e6425b61952bc06b1904681bf69.tar.bz2
Makefile.in (STRICT2_WARN): Add -Wno-variadic-macros.
* Makefile.in (STRICT2_WARN): Add -Wno-variadic-macros. * tree.c (build0, build1, build2, build3, build4): Split out from... (build): ... here. Call them. * tree.h (build, _buildN1, _buildN2, _buildC1, _buildC2): New. * convert.c (convert_to_integer): Remove extra build argument. * tree-inline.c (expand_call_inline): Likewise. ada/ * misc.c (record_code_position): Add third build arg for RTL_EXPR. java/ * parse.y (switch_label): Use make_node for DEFAULT_EXPR. From-SVN: r78126
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index ee1f50c..25ba23a 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2112,13 +2112,30 @@ extern tree maybe_get_identifier (const char *);
extern tree build (enum tree_code, tree, ...);
extern tree build_nt (enum tree_code, ...);
+#if GCC_VERSION >= 3000 || __STDC_VERSION__ >= 199901L
+/* Use preprocessor trickery to map "build" to "buildN" where N is the
+ expected number of arguments. This is used for both efficiency (no
+ varargs), and checking (verifying number of passed arguments). */
+#define build(code, ...) \
+ _buildN1(build, _buildC1(__VA_ARGS__))(code, __VA_ARGS__)
+#define _buildN1(BASE, X) _buildN2(BASE, X)
+#define _buildN2(BASE, X) BASE##X
+#define _buildC1(...) _buildC2(__VA_ARGS__,9,8,7,6,5,4,3,2,1,0,0)
+#define _buildC2(x,a1,a2,a3,a4,a5,a6,a7,a8,a9,c,...) c
+#endif
+
+extern tree build0 (enum tree_code, tree);
+extern tree build1 (enum tree_code, tree, tree);
+extern tree build2 (enum tree_code, tree, tree, tree);
+extern tree build3 (enum tree_code, tree, tree, tree, tree);
+extern tree build4 (enum tree_code, tree, tree, tree, tree, tree);
+
extern tree build_int_2_wide (unsigned HOST_WIDE_INT, HOST_WIDE_INT);
extern tree build_vector (tree, tree);
extern tree build_constructor (tree, tree);
extern tree build_real_from_int_cst (tree, tree);
extern tree build_complex (tree, tree, tree);
extern tree build_string (int, const char *);
-extern tree build1 (enum tree_code, tree, tree);
extern tree build_tree_list (tree, tree);
extern tree build_decl (enum tree_code, tree, tree);
extern tree build_block (tree, tree, tree, tree, tree);