FreeBSD/contrib/gcc/cp/decl.c
/* Create the predefined scalar types of C,
   and some nodes representing standard constants (0, 1, (void *)0).
   Initialize the global binding level.
   Make definitions for built-in primitive functions.  */
Create the predefined scalar types of C,
and some nodes representing standard constants (0, 1, (void *)0).
Initialize the global binding level.
Make definitions for built-in primitive functions.
Create the predefined scalar types of C and some nodes representing standard constants ( 0 1 ( void * ) 0 ) . Initialize the global binding level . Make definitions for built - in primitive functions .
void
cxx_init_decl_processing (void)
{
  tree void_ftype;
  tree void_ftype_ptr;
  build_common_tree_nodes (flag_signed_char, false);
  initialize_predefined_identifiers ();
  push_to_top_level ();
  current_function_decl = NULL_TREE;
  current_binding_level = NULL;
  gcc_assert (global_namespace == NULL_TREE);
  global_namespace = build_lang_decl (NAMESPACE_DECL, global_scope_name,
				      void_type_node);
  TREE_PUBLIC (global_namespace) = 1;
  begin_scope (sk_namespace, global_namespace);
  current_lang_name = NULL_TREE;
  if (!flag_permissive)
    flag_pedantic_errors = 1;
  if (!flag_no_inline)
    {
      flag_inline_trees = 1;
      flag_no_inline = 1;
    }
  if (flag_inline_functions)
    flag_inline_trees = 2;
  if (flag_visibility_ms_compat)
   default_visibility = VISIBILITY_HIDDEN;
  current_lang_name = lang_name_c;
  push_namespace (std_identifier);
  std_node = current_namespace;
  pop_namespace ();
  c_common_nodes_and_builtins ();
  java_byte_type_node = record_builtin_java_type ("__java_byte", 8);
  java_short_type_node = record_builtin_java_type ("__java_short", 16);
  java_int_type_node = record_builtin_java_type ("__java_int", 32);
  java_long_type_node = record_builtin_java_type ("__java_long", 64);
  java_float_type_node = record_builtin_java_type ("__java_float", -32);
  java_double_type_node = record_builtin_java_type ("__java_double", -64);
  java_char_type_node = record_builtin_java_type ("__java_char", -16);
  java_boolean_type_node = record_builtin_java_type ("__java_boolean", -1);
  integer_two_node = build_int_cst (NULL_TREE, 2);
  integer_three_node = build_int_cst (NULL_TREE, 3);
  record_builtin_type (RID_BOOL, "bool", boolean_type_node);
  truthvalue_type_node = boolean_type_node;
  truthvalue_false_node = boolean_false_node;
  truthvalue_true_node = boolean_true_node;
  empty_except_spec = build_tree_list (NULL_TREE, NULL_TREE);
#if 0
  record_builtin_type (RID_MAX, NULL, string_type_node);
#endif
  delta_type_node = ptrdiff_type_node;
  vtable_index_type = ptrdiff_type_node;
  vtt_parm_type = build_pointer_type (const_ptr_type_node);
  void_ftype = build_function_type (void_type_node, void_list_node);
  void_ftype_ptr = build_function_type (void_type_node,
					tree_cons (NULL_TREE,
						   ptr_type_node,
						   void_list_node));
  void_ftype_ptr
    = build_exception_variant (void_ftype_ptr, empty_except_spec);
  unknown_type_node = make_node (UNKNOWN_TYPE);
  record_unknown_type (unknown_type_node, "unknown type");
  TREE_TYPE (unknown_type_node) = unknown_type_node;
  TYPE_POINTER_TO (unknown_type_node) = unknown_type_node;
  TYPE_REFERENCE_TO (unknown_type_node) = unknown_type_node;
  {
    tree vfunc_type = make_node (FUNCTION_TYPE);
    TREE_TYPE (vfunc_type) = integer_type_node;
    TYPE_ARG_TYPES (vfunc_type) = NULL_TREE;
    layout_type (vfunc_type);
    vtable_entry_type = build_pointer_type (vfunc_type);
  }
  record_builtin_type (RID_MAX, VTBL_PTR_TYPE, vtable_entry_type);
  vtbl_type_node
    = build_cplus_array_type (vtable_entry_type, NULL_TREE);
  layout_type (vtbl_type_node);
  vtbl_type_node = build_qualified_type (vtbl_type_node, TYPE_QUAL_CONST);
  record_builtin_type (RID_MAX, NULL, vtbl_type_node);
  vtbl_ptr_type_node = build_pointer_type (vtable_entry_type);
  layout_type (vtbl_ptr_type_node);
  record_builtin_type (RID_MAX, NULL, vtbl_ptr_type_node);
  push_namespace (get_identifier ("__cxxabiv1"));
  abi_node = current_namespace;
  pop_namespace ();
  global_type_node = make_node (LANG_TYPE);
  record_unknown_type (global_type_node, "global type");
  current_lang_name = lang_name_cplusplus;
  {
    tree bad_alloc_id;
    tree bad_alloc_type_node;
    tree bad_alloc_decl;
    tree newtype, deltype;
    tree ptr_ftype_sizetype;
    push_namespace (std_identifier);
    bad_alloc_id = get_identifier ("bad_alloc");
    bad_alloc_type_node = make_aggr_type (RECORD_TYPE);
    TYPE_CONTEXT (bad_alloc_type_node) = current_namespace;
    bad_alloc_decl
      = create_implicit_typedef (bad_alloc_id, bad_alloc_type_node);
    DECL_CONTEXT (bad_alloc_decl) = current_namespace;
    TYPE_STUB_DECL (bad_alloc_type_node) = bad_alloc_decl;
    pop_namespace ();
    ptr_ftype_sizetype
      = build_function_type (ptr_type_node,
			     tree_cons (NULL_TREE,
					size_type_node,
					void_list_node));
    newtype = build_exception_variant
      (ptr_ftype_sizetype, add_exception_specifier
       (NULL_TREE, bad_alloc_type_node, -1));
    deltype = build_exception_variant (void_ftype_ptr, empty_except_spec);
    push_cp_library_fn (NEW_EXPR, newtype);
    push_cp_library_fn (VEC_NEW_EXPR, newtype);
    global_delete_fndecl = push_cp_library_fn (DELETE_EXPR, deltype);
    push_cp_library_fn (VEC_DELETE_EXPR, deltype);
  }
  abort_fndecl
    = build_library_fn_ptr ("__cxa_pure_virtual", void_ftype);
  init_class_processing ();
  init_rtti_processing ();
  if (flag_exceptions)
    init_exception_processing ();
  if (! supports_one_only ())
    flag_weak = 0;
  make_fname_decl = cp_make_fname_decl;
  start_fname_decls ();
  if (flag_exceptions)
    using_eh_for_cleanups ();
}
void cxx_init_decl_processing ( void ) { tree void_ftype ; tree void_ftype_ptr ; build_common_tree_nodes ( flag_signed_char , false ) ; initialize_predefined_identifiers ( ) ; push_to_top_level ( ) ; current_function_decl = NULL_TREE ; current_binding_level = NULL ; gcc_assert ( global_namespace == NULL_TREE ) ; global_namespace = build_lang_decl ( NAMESPACE_DECL , global_scope_name , void_type_node ) ; TREE_PUBLIC ( global_namespace ) = 1 ; begin_scope ( sk_namespace , global_namespace ) ; current_lang_name = NULL_TREE ; if ( ! flag_permissive ) flag_pedantic_errors = 1 ; if ( ! flag_no_inline ) { flag_inline_trees = 1 ; flag_no_inline = 1 ; } if ( flag_inline_functions ) flag_inline_trees = 2 ; if ( flag_visibility_ms_compat ) default_visibility = VISIBILITY_HIDDEN ; current_lang_name = lang_name_c ; push_namespace ( std_identifier ) ; std_node = current_namespace ; pop_namespace ( ) ; c_common_nodes_and_builtins ( ) ; java_byte_type_node = record_builtin_java_type ( " " , 8 ) ; java_short_type_node = record_builtin_java_type ( " " , 16 ) ; java_int_type_node = record_builtin_java_type ( " " , 32 ) ; java_long_type_node = record_builtin_java_type ( " " , 64 ) ; java_float_type_node = record_builtin_java_type ( " " , -32 ) ; java_double_type_node = record_builtin_java_type ( " " , -64 ) ; java_char_type_node = record_builtin_java_type ( " " , -16 ) ; java_boolean_type_node = record_builtin_java_type ( " " , -1 ) ; integer_two_node = build_int_cst ( NULL_TREE , 2 ) ; integer_three_node = build_int_cst ( NULL_TREE , 3 ) ; record_builtin_type ( RID_BOOL , " " , boolean_type_node ) ; truthvalue_type_node = boolean_type_node ; truthvalue_false_node = boolean_false_node ; truthvalue_true_node = boolean_true_node ; empty_except_spec = build_tree_list ( NULL_TREE , NULL_TREE ) ; #if 0 record_builtin_type ( RID_MAX , NULL , string_type_node ) ; #endif delta_type_node = ptrdiff_type_node ; vtable_index_type = ptrdiff_type_node ; vtt_parm_type = build_pointer_type ( const_ptr_type_node ) ; void_ftype = build_function_type ( void_type_node , void_list_node ) ; void_ftype_ptr = build_function_type ( void_type_node , tree_cons ( NULL_TREE , ptr_type_node , void_list_node ) ) ; void_ftype_ptr = build_exception_variant ( void_ftype_ptr , empty_except_spec ) ; unknown_type_node = make_node ( UNKNOWN_TYPE ) ; record_unknown_type ( unknown_type_node , " " ) ; TREE_TYPE ( unknown_type_node ) = unknown_type_node ; TYPE_POINTER_TO ( unknown_type_node ) = unknown_type_node ; TYPE_REFERENCE_TO ( unknown_type_node ) = unknown_type_node ; { tree vfunc_type = make_node ( FUNCTION_TYPE ) ; TREE_TYPE ( vfunc_type ) = integer_type_node ; TYPE_ARG_TYPES ( vfunc_type ) = NULL_TREE ; layout_type ( vfunc_type ) ; vtable_entry_type = build_pointer_type ( vfunc_type ) ; } record_builtin_type ( RID_MAX , VTBL_PTR_TYPE , vtable_entry_type ) ; vtbl_type_node = build_cplus_array_type ( vtable_entry_type , NULL_TREE ) ; layout_type ( vtbl_type_node ) ; vtbl_type_node = build_qualified_type ( vtbl_type_node , TYPE_QUAL_CONST ) ; record_builtin_type ( RID_MAX , NULL , vtbl_type_node ) ; vtbl_ptr_type_node = build_pointer_type ( vtable_entry_type ) ; layout_type ( vtbl_ptr_type_node ) ; record_builtin_type ( RID_MAX , NULL , vtbl_ptr_type_node ) ; push_namespace ( get_identifier ( " " ) ) ; abi_node = current_namespace ; pop_namespace ( ) ; global_type_node = make_node ( LANG_TYPE ) ; record_unknown_type ( global_type_node , " " ) ; current_lang_name = lang_name_cplusplus ; { tree bad_alloc_id ; tree bad_alloc_type_node ; tree bad_alloc_decl ; tree newtype , deltype ; tree ptr_ftype_sizetype ; push_namespace ( std_identifier ) ; bad_alloc_id = get_identifier ( " " ) ; bad_alloc_type_node = make_aggr_type ( RECORD_TYPE ) ; TYPE_CONTEXT ( bad_alloc_type_node ) = current_namespace ; bad_alloc_decl = create_implicit_typedef ( bad_alloc_id , bad_alloc_type_node ) ; DECL_CONTEXT ( bad_alloc_decl ) = current_namespace ; TYPE_STUB_DECL ( bad_alloc_type_node ) = bad_alloc_decl ; pop_namespace ( ) ; ptr_ftype_sizetype = build_function_type ( ptr_type_node , tree_cons ( NULL_TREE , size_type_node , void_list_node ) ) ; newtype = build_exception_variant ( ptr_ftype_sizetype , add_exception_specifier ( NULL_TREE , bad_alloc_type_node , -1 ) ) ; deltype = build_exception_variant ( void_ftype_ptr , empty_except_spec ) ; push_cp_library_fn ( NEW_EXPR , newtype ) ; push_cp_library_fn ( VEC_NEW_EXPR , newtype ) ; global_delete_fndecl = push_cp_library_fn ( DELETE_EXPR , deltype ) ; push_cp_library_fn ( VEC_DELETE_EXPR , deltype ) ; } abort_fndecl = build_library_fn_ptr ( " " , void_ftype ) ; init_class_processing ( ) ; init_rtti_processing ( ) ; if ( flag_exceptions ) init_exception_processing ( ) ; if ( ! supports_one_only ( ) ) flag_weak = 0 ; make_fname_decl = cp_make_fname_decl ; start_fname_decls ( ) ; if ( flag_exceptions ) using_eh_for_cleanups ( ) ; }
Create the predefined scalar types of C,
and some nodes representing standard constants (0, 1, (void *)0).
Create the predefined scalar types of C and some nodes representing standard constants ( 0 1 ( void * ) 0 ) .
/* Create all the identifiers we need.  */ /* Create the global variables.  */ /* Enter the global namespace.  */ /* Adjust various flags based on command-line settings.  */ /* Initially, C.  */ /* Create the `std' namespace.  */ /* C++ extensions */ /* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node.  */ /* Looking up TYPE_POINTER_TO and TYPE_REFERENCE_TO yield the same
     result.  */ /* Make sure we get a unique function type, so we can give
       its pointer type a name.  (This wins for gdb.) */ /* Now, C++.  */ /* Perform other language dependent initializations.  */ /* Show we use EH for cleanups.  */