diff options
| author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-04 22:49:20 +0000 | 
|---|---|---|
| committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-04 22:49:20 +0000 | 
| commit | f1833f1bf639955df2ff48caa738ed0cffb0af8d (patch) | |
| tree | 23a8878b902f5ac60f9c00bc63521603f68218d4 /gcc | |
| parent | 258d3911fa8cdf1bedf60e66226a1ad2122f440b (diff) | |
| download | ppe42-gcc-f1833f1bf639955df2ff48caa738ed0cffb0af8d.tar.gz ppe42-gcc-f1833f1bf639955df2ff48caa738ed0cffb0af8d.zip  | |
	* langhooks.h (struct lang_hooks): Add staticp.
	* langhooks-def.h (lhd_staticp, LANG_HOOKS_STATICP): New.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_STATICP.
	* langhooks.c (lhd_staticp): New function.
	* tree.c (staticp): Call lang_hooks.staticp for language-specific
	tree codes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47628 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 9 | ||||
| -rw-r--r-- | gcc/langhooks-def.h | 3 | ||||
| -rw-r--r-- | gcc/langhooks.c | 9 | ||||
| -rw-r--r-- | gcc/langhooks.h | 3 | ||||
| -rw-r--r-- | gcc/tree.c | 6 | 
5 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b968b3bce1a..22242e2274d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2001-12-04  Joseph S. Myers  <jsm28@cam.ac.uk> + +	* langhooks.h (struct lang_hooks): Add staticp. +	* langhooks-def.h (lhd_staticp, LANG_HOOKS_STATICP): New. +	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_STATICP. +	* langhooks.c (lhd_staticp): New function. +	* tree.c (staticp): Call lang_hooks.staticp for language-specific +	tree codes. +  2001-12-04  Neil Booth  <neil@daikokuya.demon.co.uk>  	* cppspec.c (lang_specific_driver): Set is_cpp_driver. diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 1ee631b1e75..910d1f54359 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -42,6 +42,7 @@ extern int lhd_decode_option PARAMS ((int, char **));  extern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree));  extern tree lhd_return_tree PARAMS ((tree));  extern int lhd_safe_from_p PARAMS ((rtx, tree)); +extern int lhd_staticp PARAMS ((tree));  extern void lhd_clear_binding_stack PARAMS ((void));  extern void lhd_print_tree_nothing PARAMS ((FILE *, tree, int));  extern void lhd_set_yydebug PARAMS ((int)); @@ -71,6 +72,7 @@ int lhd_tree_inlining_anon_aggr_type_p		PARAMS ((tree));  #define LANG_HOOKS_GET_ALIAS_SET	lhd_get_alias_set  #define LANG_HOOKS_EXPAND_CONSTANT	lhd_return_tree  #define LANG_HOOKS_SAFE_FROM_P		lhd_safe_from_p +#define LANG_HOOKS_STATICP		lhd_staticp  #define LANG_HOOKS_HONOR_READONLY	false  #define LANG_HOOKS_PRINT_STATISTICS	lhd_do_nothing  #define LANG_HOOKS_PRINT_XNODE		lhd_print_tree_nothing @@ -132,6 +134,7 @@ int lhd_tree_dump_type_quals			PARAMS ((tree));    LANG_HOOKS_GET_ALIAS_SET, \    LANG_HOOKS_EXPAND_CONSTANT, \    LANG_HOOKS_SAFE_FROM_P, \ +  LANG_HOOKS_STATICP, \    LANG_HOOKS_HONOR_READONLY, \    LANG_HOOKS_PRINT_STATISTICS, \    LANG_HOOKS_PRINT_XNODE, \ diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 8ae3055d268..5e0098680e3 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -77,6 +77,15 @@ lhd_safe_from_p (x, exp)    return 1;  } +/* Called from staticp.  */ + +int +lhd_staticp (exp) +     tree exp; +{ +  return 0; +} +  /* Called when -dy is given on the command line.  */  void diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 0519d21bbfe..8ce5674ebe9 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -123,6 +123,9 @@ struct lang_hooks       parameter.  */    int (*safe_from_p) PARAMS ((rtx, tree)); +  /* Hook called by staticp for language-specific tree codes.  */ +  int (*staticp) PARAMS ((tree)); +    /* Nonzero if TYPE_READONLY and TREE_READONLY should always be honored.  */    bool honor_readonly; diff --git a/gcc/tree.c b/gcc/tree.c index 5cbf59c5cba..c21f9132211 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1518,7 +1518,11 @@ staticp (arg)  	return staticp (TREE_OPERAND (arg, 0));      default: -      return 0; +      if ((unsigned int) TREE_CODE (arg) +	  >= (unsigned int) LAST_AND_UNUSED_TREE_CODE) +	return (*lang_hooks.staticp) (arg); +      else +	return 0;      }  }  | 

