<commit_before>/*
 * Project:     libFIRM
 * File name:   ir/tr/type.c
 * Purpose:     Representation of types.
 * Author:      <NAME>
 * Modified by: <NAME>
 * Created:
 * CVS-ID:      $Id$
 * Copyright:   (c) 2001-2003 Universitt Karlsruhe
 * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
 */

/**
 *
 *  @file type.c
 *
 *  Implementation of the datastructure to hold
 *  type information.
 *
 *  (C) 2001-2005 by Universitaet Karlsruhe
 *  <NAME>
 *
 *  This module supplies a datastructure to represent all types
 *  known in the compiled program.  This includes types specified
 *  in the program as well as types defined by the language.  In the
 *  view of the intermediate representation there is no difference
 *  between these types.
 *
 *  There exist several kinds of types, arranged by the structure of
 *  the type.  A type is described by a set of attributes.  Some of
 *  these attributes are common to all types, others depend on the
 *  kind of the type.
 *
 *  Types are different from the modes defined in irmode:  Types are
 *  on the level of the programming language, modes at the level of
 *  the target processor.
 *
 * @see  type_t.h type tpop
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif

# include <stddef.h>

# include "type_t.h"

# include "xmalloc.h"
# include "irprog_t.h"
# include "ircons.h"
# include "tpop_t.h"
# include "typegmod.h"
# include "mangle.h"
# include "tv_t.h"
# include "irhooks.h"

# include "array.h"

/*-----------------------------------------------------------------*/
/** TYPE                                                          **/
/*-----------------------------------------------------------------*/

type *firm_none_type;    type *get_none_type(void)    { return firm_none_type;    }
type *firm_unknown_type; type *get_unknown_type(void) { return firm_unknown_type; }


#ifdef DEBUG_libfirm
/* Returns a new, unique number to number nodes or the like. */
int get_irp_new_node_nr(void);
#endif

/* Suffixes added to types used for pass-by-value representations. */
static ident *value_params_suffix = NULL;
static ident *value_ress_suffix = NULL;

/** The default calling convention for method types. */
static unsigned default_cc_mask;

/* Initialize the type module. */
void firm_init_type(dbg_info *builtin_db, unsigned def_cc_mask)
{
  default_cc_mask     = def_cc_mask;
  value_params_suffix = new_id_from_str(VALUE_PARAMS_SUFFIX);
  value_ress_suffix   = new_id_from_str(VALUE_RESS_SUFFIX);

  /* construct none and unknown type. */
  firm_none_type    = new_type(tpop_none,    mode_BAD, new_id_from_str("type_none"), builtin_db);
  set_type_size_bits(firm_none_type, 0);
  set_type_state (firm_none_type, layout_fixed);
  remove_irp_type(firm_none_type);

  firm_unknown_type = new_type(tpop_unknown, mode_ANY, new_id_from_str("type_unknown"), builtin_db);
  set_type_size_bits(firm_unknown_type, 0);
  set_type_state (firm_unknown_type, layout_fixed);
  remove_irp_type(firm_unknown_type);
}

/** the global type visited flag */<commit_msg>get_default_cc_mask() added<commit_after>/*
 * Project:     libFIRM
 * File name:   ir/tr/type.c
 * Purpose:     Representation of types.
 * Author:      <NAME>
 * Modified by: <NAME>
 * Created:
 * CVS-ID:      $Id$
 * Copyright:   (c) 2001-2003 Universitt Karlsruhe
 * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
 */

/**
 *
 *  @file type.c
 *
 *  Implementation of the datastructure to hold
 *  type information.
 *
 *  (C) 2001-2005 by Universitaet Karlsruhe
 *  <NAME>
 *
 *  This module supplies a datastructure to represent all types
 *  known in the compiled program.  This includes types specified
 *  in the program as well as types defined by the language.  In the
 *  view of the intermediate representation there is no difference
 *  between these types.
 *
 *  There exist several kinds of types, arranged by the structure of
 *  the type.  A type is described by a set of attributes.  Some of
 *  these attributes are common to all types, others depend on the
 *  kind of the type.
 *
 *  Types are different from the modes defined in irmode:  Types are
 *  on the level of the programming language, modes at the level of
 *  the target processor.
 *
 * @see  type_t.h type tpop
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif

# include <stddef.h>

# include "type_t.h"

# include "xmalloc.h"
# include "irprog_t.h"
# include "ircons.h"
# include "tpop_t.h"
# include "typegmod.h"
# include "mangle.h"
# include "tv_t.h"
# include "irhooks.h"

# include "array.h"

/*-----------------------------------------------------------------*/
/** TYPE                                                          **/
/*-----------------------------------------------------------------*/

type *firm_none_type;    type *get_none_type(void)    { return firm_none_type;    }
type *firm_unknown_type; type *get_unknown_type(void) { return firm_unknown_type; }


#ifdef DEBUG_libfirm
/* Returns a new, unique number to number nodes or the like. */
int get_irp_new_node_nr(void);
#endif

/* Suffixes added to types used for pass-by-value representations. */
static ident *value_params_suffix = NULL;
static ident *value_ress_suffix = NULL;

/** The default calling convention for method types. */
static unsigned default_cc_mask;

/* return the default calling convention for method types */
unsigned get_default_cc_mask(void) {
  return default_cc_mask;
}

/* Initialize the type module. */
void firm_init_type(dbg_info *builtin_db, unsigned def_cc_mask)
{
  default_cc_mask     = def_cc_mask;
  value_params_suffix = new_id_from_str(VALUE_PARAMS_SUFFIX);
  value_ress_suffix   = new_id_from_str(VALUE_RESS_SUFFIX);

  /* construct none and unknown type. */
  firm_none_type    = new_type(tpop_none,    mode_BAD, new_id_from_str("type_none"), builtin_db);
  set_type_size_bits(firm_none_type, 0);
  set_type_state (firm_none_type, layout_fixed);
  remove_irp_type(firm_none_type);

  firm_unknown_type = new_type(tpop_unknown, mode_ANY, new_id_from_str("type_unknown"), builtin_db);
  set_type_size_bits(firm_unknown_type, 0);
  set_type_state (firm_unknown_type, layout_fixed);
  remove_irp_type(firm_unknown_type);
}

/** the global type visited flag */
{'fraction_non_alphanumeric': 0.1320754716981132, 'fraction_numerical': 0.005433962264150944, 'mean_word_length': 3.1386633354153655, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1488051', 'n_tokens_mistral': 2217, 'n_tokens_neox': 2142, 'n_words': 633}