PIPS
type.c File Reference
#include <stdio.h>
#include "linear.h"
#include "genC.h"
#include "ri.h"
#include "misc.h"
#include "ri-util.h"
#include "text-util.h"
#include "prettyprint.h"
+ Include dependency graph for type.c:

Go to the source code of this file.

Functions

string type_to_full_string_definition (type t)
 Provide a full ASCII description of type "t". More...
 
string string_of_type (const type t)
 
bool same_type_name_p (const type t0, const type t1)
 For naming homogeneity: expression_to_string(), reference_to_string()... More...
 
string basic_to_string (basic b)
 RI-UTIL Library: Functions dealing with and constants related to PIPS intermediate representation ri.newgen, that are NOT generated by NewGen. More...
 
void print_types (list tl)
 Very basic and crude debugging function. More...
 
void print_type (type t)
 For debugging. More...
 
void print_qualifiers (list ql)
 
void print_qualifier (qualifier q)
 

Function Documentation

◆ basic_to_string()

string basic_to_string ( basic  b)

RI-UTIL Library: Functions dealing with and constants related to PIPS intermediate representation ri.newgen, that are NOT generated by NewGen.

Warning! Do not modify this file that is automatically generated!

Pvecteur is an external type for NewGen and the ri data structure and is not included in ri.h

It is included here to avoid changes in many PIPS modules which use ri-util

Idem for type Ppolynome (PB 25/07/90); FI: polynomials are not used in ri.newgen; they should not be mentionned here

Idem for type Psysteme (FI 3 November 1990)

New function call need to be defined to handle omp pragma as a standard PIPS expression. To be easily recognized, all the defined values are prefixed by "OMP_". FC 2015-07-20 yuk, temporary fix to avoid an include cycle ri-util <-> prettyprint

#include "prettyprint.h"

Nga Nguyen, 19/09/2003: To not rewrite the same thing, I use the words_basic() function

Definition at line 87 of file type.c.

88 {
89  /* Nga Nguyen, 19/09/2003: To not rewrite the same thing, I use the words_basic() function*/
90  list pdl = NIL;
91  return list_to_string(words_basic(b, &pdl));
92  gen_free_list(pdl);
93 }
string list_to_string(list l)
Return the malloc()ed version of the concatenation of all the strings in the list.
Definition: args.c:74
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
list words_basic(basic obj, list *ppdl)
what about simple DOUBLE PRECISION, REAL, INTEGER...
Definition: declarations.c:323
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References gen_free_list(), list_to_string(), NIL, and words_basic().

Referenced by add_formal_to_actual_bindings(), any_expression_to_transformer(), any_user_call_site_to_transformer(), arguments_are_something(), can_terapixify_expression_p(), check_call_basic(), DeclareVariable(), dprint(), dump_common_layout(), dump_functional(), effect_indices_first_pointer_dimension_rank(), entities_type_and_name(), fortran_user_call_to_transformer(), fprint_any_environment(), fprint_functional(), get_symbol_table(), is_varibale_array_element_specifier(), mpi_recv_ctx(), mpi_send_ctx(), print_entity_variable(), r_cell_reference_to_type(), register_scalar_communications(), relation_to_transformer(), rename_op(), sac_commenter(), sentence_basic_declaration(), string_expression_to_transformer(), stub_head(), stub_var_decl(), this_entity_cdeclaration(), type_and_size_of_var(), type_this_call(), type_this_entity_if_needed(), type_this_expression(), type_this_instruction(), TypeFunctionalEntity(), typing_arguments_of_user_function(), typing_function_argument_type_to_return_type(), variable_to_string(), xml_Full_Type(), and xml_TaskReturnParameter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_qualifier()

void print_qualifier ( qualifier  q)

Definition at line 138 of file type.c.

139 {
140  list ql = CONS(QUALIFIER, q, NIL);
141  print_qualifiers(ql);
142  gen_free_list(ql);
143 }
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
void print_qualifiers(list ql)
Definition: type.c:131
#define QUALIFIER(x)
QUALIFIER.
Definition: ri.h:2106

References CONS, gen_free_list(), NIL, print_qualifiers(), and QUALIFIER.

Referenced by dprint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_qualifiers()

void print_qualifiers ( list  ql)
Parameters
qll

Definition at line 131 of file type.c.

132 {
133  list wl = words_qualifiers(ql);
134  dump_words(wl);
135  gen_full_free_list(wl);
136 }
void gen_full_free_list(list l)
Definition: genClib.c:1023
list words_qualifiers(list obj)
Definition: declarations.c:795
void dump_words(list lw)
Definition: print.c:251

References dump_words(), gen_full_free_list(), and words_qualifiers().

Referenced by dprint(), and print_qualifier().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_type()

void print_type ( type  t)

For debugging.

Definition at line 111 of file type.c.

112 {
113  debug_on("RI-UTIL_DEBUG_LEVEL");
114  if(t==NULL)
115  fprintf(stderr, "type is NULL.\n");
116  else if(type_undefined_p(t))
117  fprintf(stderr, "type is undefined.\n");
118  else if(type_domain_number(t)!=type_domain)
119  fprintf(stderr, "The argument is not a type.\n");
120  else {
121  // Might be better to pass true, or even more information, to see
122  // what happens with the unknown type
123  list pdl = NIL;
124  list wl = words_type(t, &pdl, false);
125  gen_free_list(pdl);
126  dump_words(wl);
127  }
128  debug_off();
129 }
#define debug_on(env)
Definition: misc-local.h:157
#define debug_off()
Definition: misc-local.h:160
list words_type(type obj, list *ppdl, bool argument_p)
obj is the type to describe
Definition: declarations.c:821
#define type_undefined_p(x)
Definition: ri.h:2884
#define type_domain_number(x)
Definition: ri.h:2939
#define type_domain
newgen_transformer_domain_defined
Definition: ri.h:434
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References debug_off, debug_on, dump_words(), fprintf(), gen_free_list(), NIL, type_domain, type_domain_number, type_undefined_p, and words_type().

Referenced by build_view_file(), create_scalar_stub_sink_cell(), dprint(), entity_all_xxx_locations_typed(), expression_to_points_to_sources(), generic_stub_source_to_sinks(), get_dont_build_view_file(), get_view_file(), gpips_display_plain_file(), points_to_cell_types_compatibility(), print_parameter(), type_dereferencement_depth(), wpips_display_plain_file(), and wpips_display_WP65_file().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_types()

void print_types ( list  tl)

Very basic and crude debugging function.

Parameters
tll

Definition at line 96 of file type.c.

97 {
98  bool first_p = true;
99 
100  fprintf(stderr, "Type list: ");
101 
102  FOREACH(TYPE, t, tl) {
103  fprintf(stderr, first_p? "%p" : ", %p", t);
104  first_p = false;
105  }
106 
107  fprintf(stderr, "\n");
108 }
#define TYPE(bp)
non user domain must be taken care from outside?
Definition: genC.c:50
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179

References FOREACH, fprintf(), and TYPE.

Referenced by dprint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ same_type_name_p()

bool same_type_name_p ( const type  t0,
const type  t1 
)

For naming homogeneity: expression_to_string(), reference_to_string()...

but type_to_string() is already implemented in ri-util in a less useful form string type_to_string(cons type t) { return string_of_type(t); } This function cannot be in ri-util because of string_of_type()

Parameters
t00
t11

Definition at line 74 of file type.c.

74  {
75  string s0 = string_of_type(t0),
76  s1 =string_of_type(t1);
77  bool same = same_string_p(s0,s1);
78  free(s0); free(s1);
79  return same;
80 }
void free(void *)
#define same_string_p(s1, s2)
string string_of_type(const type t)
Definition: type.c:56
s1
Definition: set.c:247

References free(), s1, same_string_p, and string_of_type().

Referenced by comparable_entity_in_list_p(), same_cast_name_p(), and same_sizeofexpression_name_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ string_of_type()

string string_of_type ( const type  t)

Definition at line 56 of file type.c.

57 {
58  list pdl = NIL;
59  list wl = words_type(t, &pdl, false);
60  gen_free_list(pdl);
61  string s = words_to_string(wl);
62  FOREACH(STRING,s,wl) free(s);
63  gen_free_list(wl);
64  return s;
65 }
#define STRING(x)
Definition: genC.h:87
string words_to_string(cons *lw)
Definition: print.c:211

References FOREACH, free(), gen_free_list(), NIL, STRING, words_to_string(), and words_type().

Referenced by basic_concrete_types_compatible_for_effects_interprocedural_translation_p(), binary_arithmetic_operator_to_post_pv(), check_type_of_points_to_cells(), declaration_to_post_pv(), FILE_star_effect_reference_p(), malloc_arg_to_type(), malloc_to_abstract_location(), malloc_type_to_abstract_location(), module_initial_parameter_pv(), same_type_name_p(), and xml_print_parameter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ type_to_full_string_definition()

string type_to_full_string_definition ( type  t)

Provide a full ASCII description of type "t".

type.c

FI: I am not sure about the language used.

Definition at line 45 of file type.c.

46 {
47  debug_on("PRETTYPRINT_DEBUG_LEVEL");
48  list pdl = NIL;
49  string s = words_to_string(words_type(t, &pdl, false));
50  gen_free_list(pdl);
51  debug_off();
52  return s;
53 }

References debug_off, debug_on, gen_free_list(), NIL, words_to_string(), and words_type().

Referenced by adapt_reference_to_type(), add_sizeof_value(), filter_formal_context_according_to_actual_context(), find_kth_points_to_node_in_points_to_path(), intrinsic_call_to_points_to(), new_filter_formal_context_according_to_actual_context(), pips_user_value_name(), print_value_mappings(), type_compatible_super_cell(), type_compatible_with_points_to_cell_p(), and type_to_sizeof_value().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: