From f16d3f392e1b5a317ac75dbed2b9cb81d79bc50f Mon Sep 17 00:00:00 2001
From: Jan Hubicka <jh@suse.cz>
Date: Tue, 23 Nov 2010 17:06:37 +0100
Subject: tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro.

	* tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro.
	(tree_decl_with_vis): Add implicit_section_name_p.
	* targhooks.h (default_function_section): Declare.
	* target.def (function_section): New hook.
	* defaults.h (HOT_TEXT_SECTION_NAME,
	UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
	* predict.c (choose_function_section): Remove.
	(estimate_bb_frequencies): Do not use choose_function_section.
	* coretypes.h (enum node_frequency): Move here from cgraph.h
	* cgraph.h (enum node_frequency): Remove.
	* varasm.c (initialize_cold_section_name, unlikely_text_section,
	unlikely_text_section_p): Remove.
	(named_subsection_entry): New structure.
	(get_text_section): New function.
	(default_function_section): New function.
	(function_section_1): Break out from ...; handle profile info.
	(function_section): ... here.
	(unlikely_text_section): Remove.
	(unlikely_text_section_p): Use function_section_1.
	(assemble_start_function): Do not initialize cold section.
	(default_section_type_flags): Do not special case cold subsection.
	(switch_to_section): Likewise.
	* output.h (get_text_section): Define.
	* config/i386/winnt.c: Do not special case cold section.
	* config/darwin-protos.h (darwin_function_section): Declare.
	* config/microblaze/microblaze.h (HOT_TEXT_SECTION_NAME,
	UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
	* config/ia64/hpux.h (HOT_TEXT_SECTION_NAME,
	UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
	(TARGET_ASM_FUNCTION_SECTION): Define to ia64_hpux_function_section.
	* config/ia64/ia64.c (ia64_hpux_function_section): New function.
	* config/darwin.c (machopic_select_section): Use
	darwin_function_section.
	(darwin_function_section): New function.
	* config/darwin.h (HOT_TEXT_SECTION_NAME,
	UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove.
	(TARGET_ASM_FUNCTION_SECTION): Define.
	* system.h (HOT_TEXT_SECTION_NAME,
	UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Poison.

From-SVN: r167085
---
 gcc/target.def | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'gcc/target.def')

diff --git a/gcc/target.def b/gcc/target.def
index 199b58c..22d5660 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -281,6 +281,19 @@ DEFHOOK
  void, (const char *name, unsigned int flags, tree decl),
  default_no_named_section)
 
+/* Return preferred text (sub)section for function DECL.
+   Main purpose of this function is to separate cold, normal and hot
+   functions. STARTUP is true when function is known to be used only 
+   at startup (from static constructors or it is main()).
+   EXIT is true when function is known to be used only at exit
+   (from static destructors).
+   Return NULL if function should go to default text section.  */
+DEFHOOK
+(function_section,
+ "",
+ section *, (tree decl, enum node_frequency freq, bool startup, bool exit),
+ default_function_section)
+
 /* Return a mask describing how relocations should be treated when
    selecting sections.  Bit 1 should be set if global relocations
    should be placed in a read-write section; bit 0 should be set if
-- 
cgit v1.1

