From: Jakub Jelinek <jakub@redhat.com>
To: Richard Henderson <rth@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [gomp] Add langhook, so that Fortran can privatize variables by reference
Date: Tue, 18 Oct 2005 10:28:00 -0000 [thread overview]
Message-ID: <20051018102849.GD16034@devserv.devel.redhat.com> (raw)
In-Reply-To: <20051018095434.GA11589@redhat.com>
On Tue, Oct 18, 2005 at 02:54:34AM -0700, Richard Henderson wrote:
> On Tue, Oct 18, 2005 at 05:48:52AM -0400, Jakub Jelinek wrote:
> > lhd_bool_tree_false or hook_bool_tree_false?
>
> hook_bool_tree_false, which already exists.
>
> > Also, shouldn't e.g.
> > bool
> > lhd_decl_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED)
> > {
> > return true;
> > }
> > be changed to lhd_bool_tree_true too?
>
> I hadn't noticed that one. It should be hook_bool_tree_true,
> which also already exists.
There are actually many more lhd_* hooks which have corresponding
hook_* in hooks.c.
Now, would this be ok for HEAD (of course except the
LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE), or should I commit this
just to gomp and let 4.2 clean up during gomp->HEAD merge after
4.1 branches, or should I just change LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE
and create a PR with the patch, so that it is cleaned up later?
2005-10-18 Jakub Jelinek <jakub@redhat.com>
* langhooks.c (lhd_do_nothing, lhd_do_nothing_t,
lhd_can_use_bit_fields_p, lhd_expand_decl,
lhd_tree_inlining_anon_aggr_type_p, lhd_decl_ok_for_sibcall,
lhd_tree_inlining_end_inlining, lhd_omp_privatize_by_reference):
Removed.
* langhooks-def.h (lhd_do_nothing, lhd_do_nothing_t,
lhd_can_use_bit_fields_p, lhd_expand_decl,
lhd_tree_inlining_anon_aggr_type_p, lhd_decl_ok_for_sibcall,
lhd_tree_inlining_end_inlining, lhd_omp_privatize_by_reference):
Remove prototypes.
(LANG_HOOKS_FINISH, LANG_HOOKS_CLEAR_BINDING_STACK,
LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_FINISH_INCOMPLETE_DECL,
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_CAN_USE_BIT_FIELDS_P,
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_INIT_TS,
LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
LANG_HOOKS_TREE_INLINING_END_INLINING, LANG_HOOKS_DECL_OK_FOR_SIBCALL,
LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Use hooks.c hooks rather than
lhd_* specific ones.
--- gcc/langhooks.c.jj 2005-10-18 08:50:13.000000000 +0200
+++ gcc/langhooks.c 2005-10-18 12:13:24.000000000 +0200
@@ -37,20 +37,6 @@ Boston, MA 02110-1301, USA. */
#include "ggc.h"
#include "diagnostic.h"
-/* Do nothing; in many cases the default hook. */
-
-void
-lhd_do_nothing (void)
-{
-}
-
-/* Do nothing (tree). */
-
-void
-lhd_do_nothing_t (tree ARG_UNUSED (t))
-{
-}
-
/* Do nothing (int). */
void
@@ -185,13 +171,6 @@ lhd_set_decl_assembler_name (tree decl)
}
}
-/* By default we always allow bit-field based optimizations. */
-bool
-lhd_can_use_bit_fields_p (void)
-{
- return true;
-}
-
/* Type promotion for variable arguments. */
tree
lhd_type_promotes_to (tree ARG_UNUSED (type))
@@ -243,18 +222,6 @@ lhd_expand_expr (tree ARG_UNUSED (t), rt
gcc_unreachable ();
}
-/* The default language-specific function for expanding a decl. After
- the language-independent cases are handled, this function will be
- called. If this function is not defined, it is assumed that
- declarations other than those for variables and labels do not require
- any RTL generation. */
-
-int
-lhd_expand_decl (tree ARG_UNUSED (t))
-{
- return 0;
-}
-
/* This is the default decl_printable_name function. */
const char *
@@ -348,16 +315,6 @@ lhd_tree_inlining_auto_var_in_fn_p (tree
|| TREE_CODE (var) == RESULT_DECL));
}
-/* lang_hooks.tree_inlining.anon_aggr_type_p determines whether T is a
- type node representing an anonymous aggregate (union, struct, etc),
- i.e., one whose members are in the same scope as the union itself. */
-
-int
-lhd_tree_inlining_anon_aggr_type_p (tree t ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
/* lang_hooks.tree_inlining.start_inlining and end_inlining perform any
language-specific bookkeeping necessary for processing
FN. start_inlining returns nonzero if inlining should proceed, zero if
@@ -372,11 +329,6 @@ lhd_tree_inlining_start_inlining (tree f
return 1;
}
-void
-lhd_tree_inlining_end_inlining (tree fn ATTRIBUTE_UNUSED)
-{
-}
-
/* lang_hooks.tree_inlining.convert_parm_for_inlining performs any
language-specific conversion before assigning VALUE to PARM. */
@@ -439,15 +391,6 @@ lhd_tree_size (enum tree_code c ATTRIBUT
gcc_unreachable ();
}
-/* Return true if decl, which is a function decl, may be called by a
- sibcall. */
-
-bool
-lhd_decl_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED)
-{
- return true;
-}
-
/* Return the COMDAT group into which DECL should be placed. */
const char *
@@ -456,15 +399,6 @@ lhd_comdat_group (tree decl)
return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
}
-/* True if OpenMP should privatize what this DECL points to rather
- than the DECL itself. */
-
-bool
-lhd_omp_privatize_by_reference (tree decl ATTRIBUTE_UNUSED)
-{
- return false;
-}
-
/* lang_hooks.decls.final_write_globals: perform final processing on
global variables. */
void
--- gcc/cp/cp-objcp-common.h.jj 2005-09-13 15:16:03.000000000 +0200
+++ gcc/cp/cp-objcp-common.h 2005-10-18 12:10:08.000000000 +0200
@@ -82,7 +82,7 @@ extern tree objcp_tsubst_copy_and_build
#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL cxx_warn_unused_global_decl
#undef LANG_HOOKS_WRITE_GLOBALS
-#define LANG_HOOKS_WRITE_GLOBALS lhd_do_nothing
+#define LANG_HOOKS_WRITE_GLOBALS hook_void_void
#undef LANG_HOOKS_COMDAT_GROUP
#define LANG_HOOKS_COMDAT_GROUP cxx_comdat_group
--- gcc/langhooks-def.h.jj 2005-10-18 08:46:23.000000000 +0200
+++ gcc/langhooks-def.h 2005-10-18 12:13:45.000000000 +0200
@@ -39,8 +39,6 @@ extern HOST_WIDE_INT hook_get_alias_set_
/* See langhooks.h for the definition and documentation of each hook. */
-extern void lhd_do_nothing (void);
-extern void lhd_do_nothing_t (tree);
extern void lhd_do_nothing_i (int);
extern void lhd_do_nothing_f (struct function *);
extern bool lhd_post_options (const char **);
@@ -55,22 +53,18 @@ extern void lhd_print_tree_nothing (FILE
extern const char *lhd_decl_printable_name (tree, int);
extern int lhd_types_compatible_p (tree, tree);
extern rtx lhd_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
-extern int lhd_expand_decl (tree);
extern void lhd_print_error_function (struct diagnostic_context *,
const char *);
extern void lhd_set_decl_assembler_name (tree);
-extern bool lhd_can_use_bit_fields_p (void);
extern bool lhd_warn_unused_global_decl (tree);
extern void lhd_incomplete_type_error (tree, tree);
extern tree lhd_type_promotes_to (tree);
extern void lhd_register_builtin_type (tree, const char *);
-extern bool lhd_decl_ok_for_sibcall (tree);
extern const char *lhd_comdat_group (tree);
extern tree lhd_expr_size (tree);
extern size_t lhd_tree_size (enum tree_code);
extern HOST_WIDE_INT lhd_to_target_charset (HOST_WIDE_INT);
extern tree lhd_expr_to_decl (tree, bool *, bool *, bool *);
-extern bool lhd_omp_privatize_by_reference (tree);
/* Declarations of default tree inlining hooks. */
extern tree lhd_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
@@ -79,9 +73,7 @@ extern int lhd_tree_inlining_cannot_inli
extern int lhd_tree_inlining_disregard_inline_limits (tree);
extern tree lhd_tree_inlining_add_pending_fn_decls (void *, tree);
extern int lhd_tree_inlining_auto_var_in_fn_p (tree, tree);
-extern int lhd_tree_inlining_anon_aggr_type_p (tree);
extern int lhd_tree_inlining_start_inlining (tree);
-extern void lhd_tree_inlining_end_inlining (tree);
extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree, int);
extern void lhd_initialize_diagnostics (struct diagnostic_context *);
extern tree lhd_callgraph_analyze_expr (tree *, int *, tree);
@@ -93,9 +85,9 @@ extern int lhd_gimplify_expr (tree *, tr
#define LANG_HOOKS_NAME "GNU unknown"
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
#define LANG_HOOKS_INIT hook_bool_void_false
-#define LANG_HOOKS_FINISH lhd_do_nothing
+#define LANG_HOOKS_FINISH hook_void_void
#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
-#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_do_nothing
+#define LANG_HOOKS_CLEAR_BINDING_STACK hook_void_void
#define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0
#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS lhd_initialize_diagnostics
#define LANG_HOOKS_HANDLE_OPTION hook_int_size_t_constcharptr_int_0
@@ -104,16 +96,16 @@ extern int lhd_gimplify_expr (tree *, tr
#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
#define LANG_HOOKS_EXPAND_CONSTANT lhd_return_tree
#define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
-#define LANG_HOOKS_EXPAND_DECL lhd_expand_decl
+#define LANG_HOOKS_EXPAND_DECL hook_int_tree_0
#define LANG_HOOKS_SAFE_FROM_P lhd_safe_from_p
-#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
+#define LANG_HOOKS_FINISH_INCOMPLETE_DECL hook_void_tree
#define LANG_HOOKS_STATICP lhd_staticp
-#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
+#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL hook_void_tree
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name
-#define LANG_HOOKS_CAN_USE_BIT_FIELDS_P lhd_can_use_bit_fields_p
+#define LANG_HOOKS_CAN_USE_BIT_FIELDS_P hook_bool_void_true
#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS false
#define LANG_HOOKS_NO_BODY_BLOCKS false
-#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing
+#define LANG_HOOKS_PRINT_STATISTICS hook_void_void
#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing
#define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing
#define LANG_HOOKS_PRINT_TYPE lhd_print_tree_nothing
@@ -127,7 +119,7 @@ extern int lhd_gimplify_expr (tree *, tr
#define LANG_HOOKS_BUILTIN_FUNCTION builtin_function
#define LANG_HOOKS_EXPR_TO_DECL lhd_expr_to_decl
#define LANG_HOOKS_TO_TARGET_CHARSET lhd_to_target_charset
-#define LANG_HOOKS_INIT_TS lhd_do_nothing
+#define LANG_HOOKS_INIT_TS hook_void_void
#define LANG_HOOKS_FUNCTION_INIT lhd_do_nothing_f
#define LANG_HOOKS_FUNCTION_FINAL lhd_do_nothing_f
@@ -151,13 +143,13 @@ extern int lhd_gimplify_expr (tree *, tr
#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
lhd_tree_inlining_auto_var_in_fn_p
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
- lhd_tree_inlining_anon_aggr_type_p
+ hook_int_tree_0
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P \
hook_bool_tree_tree_false
#define LANG_HOOKS_TREE_INLINING_START_INLINING \
lhd_tree_inlining_start_inlining
#define LANG_HOOKS_TREE_INLINING_END_INLINING \
- lhd_tree_inlining_end_inlining
+ hook_void_tree
#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
lhd_tree_inlining_convert_parm_for_inlining
@@ -238,9 +230,9 @@ extern tree lhd_make_node (enum tree_cod
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL lhd_warn_unused_global_decl
#define LANG_HOOKS_WRITE_GLOBALS write_global_declarations
#define LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE NULL
-#define LANG_HOOKS_DECL_OK_FOR_SIBCALL lhd_decl_ok_for_sibcall
+#define LANG_HOOKS_DECL_OK_FOR_SIBCALL hook_bool_tree_true
#define LANG_HOOKS_COMDAT_GROUP lhd_comdat_group
-#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE lhd_omp_privatize_by_reference
+#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE hook_bool_tree_false
#define LANG_HOOKS_DECLS { \
LANG_HOOKS_GLOBAL_BINDINGS_P, \
Jakub
next prev parent reply other threads:[~2005-10-18 10:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-18 7:01 Jakub Jelinek
2005-10-18 9:10 ` Richard Henderson
2005-10-18 9:49 ` Jakub Jelinek
2005-10-18 9:54 ` Richard Henderson
2005-10-18 10:28 ` Jakub Jelinek [this message]
2005-10-18 10:46 ` Richard Henderson
2019-05-26 17:46 ` Thomas Schwinge
2019-05-27 16:51 ` Jakub Jelinek
2019-05-29 17:12 ` Thomas Schwinge
2021-08-31 14:28 ` Thomas Schwinge
2021-08-31 14:45 ` Jakub Jelinek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051018102849.GD16034@devserv.devel.redhat.com \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=rth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).