FreeBSD/contrib/gcc/varasm.c
/* Output assembler code for the constant pool of a function and associated
   with defining the name of the function.  DECL describes the function.
   NAME is the function's name.  For the constant pool, we use the current
   constant pool data.  */
Output assembler code for the constant pool of a function and associated
with defining the name of the function.  DECL describes the function.
NAME is the function's name.  For the constant pool, we use the current
constant pool data.
Output assembler code for the constant pool of a function and associated with defining the name of the function . DECL describes the function . NAME is the function ' s name . For the constant pool we use the current constant pool data .
void
assemble_start_function (tree decl, const char *fnname)
{
  int align;
  char tmp_label[100];
  bool hot_label_written = false;
  cfun->unlikely_text_section_name = NULL;
  first_function_block_is_cold = false;
  if (flag_reorder_blocks_and_partition)
    {
      ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTB", const_labelno);
      cfun->hot_section_label = ggc_strdup (tmp_label);
      ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LCOLDB", const_labelno);
      cfun->cold_section_label = ggc_strdup (tmp_label);
      ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTE", const_labelno);
      cfun->hot_section_end_label = ggc_strdup (tmp_label);
      ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LCOLDE", const_labelno);
      cfun->cold_section_end_label = ggc_strdup (tmp_label);
      const_labelno++;
    }
  else
    {
      cfun->hot_section_label = NULL;
      cfun->cold_section_label = NULL;
      cfun->hot_section_end_label = NULL;
      cfun->cold_section_end_label = NULL;
    }
  app_disable ();
  if (CONSTANT_POOL_BEFORE_FUNCTION)
    output_constant_pool (fnname, decl);
  resolve_unique_section (decl, 0, flag_function_sections);
  if (flag_reorder_blocks_and_partition)
    {
      switch_to_section (unlikely_text_section ());
      assemble_align (DECL_ALIGN (decl));
      ASM_OUTPUT_LABEL (asm_out_file, cfun->cold_section_label);
      if (!current_function_is_thunk
	  && BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION)
	{
	  switch_to_section (text_section);
	  assemble_align (DECL_ALIGN (decl));
	  ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
	  hot_label_written = true;
	  first_function_block_is_cold = true;
	}
    }
  else if (DECL_SECTION_NAME (decl))
    {
      initialize_cold_section_name ();
      if (cfun->unlikely_text_section_name
	  && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
		     cfun->unlikely_text_section_name) == 0)
	first_function_block_is_cold = true;
    }
  in_cold_section_p = first_function_block_is_cold;
  switch_to_section (function_section (decl));
  if (flag_reorder_blocks_and_partition
      && !hot_label_written)
    ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
  align = floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT);
  if (align > 0)
    {
      ASM_OUTPUT_ALIGN (asm_out_file, align);
    }
  if (! DECL_USER_ALIGN (decl)
      && align_functions_log > align
      && cfun->function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED)
    {
#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
      ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file,
				 align_functions_log, align_functions - 1);
#else
      ASM_OUTPUT_ALIGN (asm_out_file, align_functions_log);
#endif
    }
#ifdef ASM_OUTPUT_FUNCTION_PREFIX
  ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname);
#endif
  (*debug_hooks->begin_function) (decl);
  if (TREE_PUBLIC (decl))
    {
      notice_global_symbol (decl);
      globalize_decl (decl);
      maybe_assemble_visibility (decl);
    }
  if (DECL_PRESERVE_P (decl))
    targetm.asm_out.mark_decl_preserved (fnname);
#ifdef ASM_DECLARE_FUNCTION_NAME
  ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl);
#else
  ASM_OUTPUT_LABEL (asm_out_file, fnname);
#endif 
}
void assemble_start_function ( tree decl , const char * fnname ) { int align ; char tmp_label [ 100 ] ; bool hot_label_written = false ; cfun -> unlikely_text_section_name = NULL ; first_function_block_is_cold = false ; if ( flag_reorder_blocks_and_partition ) { ASM_GENERATE_INTERNAL_LABEL ( tmp_label , " " , const_labelno ) ; cfun -> hot_section_label = ggc_strdup ( tmp_label ) ; ASM_GENERATE_INTERNAL_LABEL ( tmp_label , " " , const_labelno ) ; cfun -> cold_section_label = ggc_strdup ( tmp_label ) ; ASM_GENERATE_INTERNAL_LABEL ( tmp_label , " " , const_labelno ) ; cfun -> hot_section_end_label = ggc_strdup ( tmp_label ) ; ASM_GENERATE_INTERNAL_LABEL ( tmp_label , " " , const_labelno ) ; cfun -> cold_section_end_label = ggc_strdup ( tmp_label ) ; const_labelno ++ ; } else { cfun -> hot_section_label = NULL ; cfun -> cold_section_label = NULL ; cfun -> hot_section_end_label = NULL ; cfun -> cold_section_end_label = NULL ; } app_disable ( ) ; if ( CONSTANT_POOL_BEFORE_FUNCTION ) output_constant_pool ( fnname , decl ) ; resolve_unique_section ( decl , 0 , flag_function_sections ) ; if ( flag_reorder_blocks_and_partition ) { switch_to_section ( unlikely_text_section ( ) ) ; assemble_align ( DECL_ALIGN ( decl ) ) ; ASM_OUTPUT_LABEL ( asm_out_file , cfun -> cold_section_label ) ; if ( ! current_function_is_thunk && BB_PARTITION ( ENTRY_BLOCK_PTR -> next_bb ) == BB_COLD_PARTITION ) { switch_to_section ( text_section ) ; assemble_align ( DECL_ALIGN ( decl ) ) ; ASM_OUTPUT_LABEL ( asm_out_file , cfun -> hot_section_label ) ; hot_label_written = true ; first_function_block_is_cold = true ; } } else if ( DECL_SECTION_NAME ( decl ) ) { initialize_cold_section_name ( ) ; if ( cfun -> unlikely_text_section_name && strcmp ( TREE_STRING_POINTER ( DECL_SECTION_NAME ( decl ) ) , cfun -> unlikely_text_section_name ) == 0 ) first_function_block_is_cold = true ; } in_cold_section_p = first_function_block_is_cold ; switch_to_section ( function_section ( decl ) ) ; if ( flag_reorder_blocks_and_partition && ! hot_label_written ) ASM_OUTPUT_LABEL ( asm_out_file , cfun -> hot_section_label ) ; align = floor_log2 ( DECL_ALIGN ( decl ) / BITS_PER_UNIT ) ; if ( align > 0 ) { ASM_OUTPUT_ALIGN ( asm_out_file , align ) ; } if ( ! DECL_USER_ALIGN ( decl ) && align_functions_log > align && cfun -> function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED ) { #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN ASM_OUTPUT_MAX_SKIP_ALIGN ( asm_out_file , align_functions_log , align_functions - 1 ) ; #else ASM_OUTPUT_ALIGN ( asm_out_file , align_functions_log ) ; #endif } #ifdef ASM_OUTPUT_FUNCTION_PREFIX ASM_OUTPUT_FUNCTION_PREFIX ( asm_out_file , fnname ) ; #endif ( * debug_hooks -> begin_function ) ( decl ) ; if ( TREE_PUBLIC ( decl ) ) { notice_global_symbol ( decl ) ; globalize_decl ( decl ) ; maybe_assemble_visibility ( decl ) ; } if ( DECL_PRESERVE_P ( decl ) ) targetm . asm_out . mark_decl_preserved ( fnname ) ; #ifdef ASM_DECLARE_FUNCTION_NAME ASM_DECLARE_FUNCTION_NAME ( asm_out_file , fnname , current_function_decl ) ; #else ASM_OUTPUT_LABEL ( asm_out_file , fnname ) ; #endif }
Output assembler code for the constant pool of a function and associated
with defining the name of the function.
Output assembler code for the constant pool of a function and associated with defining the name of the function .
/* The following code does not need preprocessing in the assembler.  */ /* Make sure the not and cold text (code) sections are properly
     aligned.  This is necessary here in the case where the function
     has both hot and cold sections, because we don't want to re-set
     the alignment when the section switch happens mid-function.  */ /* When the function starts with a cold section, we need to explicitly
	 align the hot section and write out the hot section label.
	 But if the current function is a thunk, we do not have a CFG.  */ /* Calls to function_section rely on first_function_block_is_cold
	 being accurate.  The first block may be cold even if we aren't
	 doing partitioning, if the entire function was decided by
	 choose_function_section (predict.c) to be cold.  */ /* Switch to the correct text section for the start of the function.  */ /* Tell assembler to move to target machine's alignment for functions.  */ /* Handle a user-specified function alignment.
     Note that we still need to align to DECL_ALIGN, as above,
     because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all.  */ /* Make function name accessible from other files, if appropriate.  */ /* Do any machine/system dependent processing of the function name.  */ /* Standard thing is just output label for the function.  */ /* ASM_DECLARE_FUNCTION_NAME */