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

Go to the source code of this file.

Functions

static void atomize_object (gen_chunk *)
 void atomize_as_required(stat, ref_decide, call_decide, test_decide, range_decide, while_decide, new) statement stat; bool (*ref_decide)(ref r, expression e); bool (*call_decide)(call r, expression e); bool (*test_decide)(test t, expression e); bool (*range_decide)(range r, expression e), bool (*while_decide)(whileloop w, expression e), entity (*new)(entity m, basic b); More...
 
static void simple_atomize_error_handler ()
 the stack of the encoutered statements is maintained to be able to insert the needed computations just before the very last statement encountered. More...
 
static void insert_before_current_statement (statement s)
 s is inserted before the current statement. More...
 
statement atomize_this_expression (entity(*create)(entity, basic), expression e)
 returns the assignment statement is moved, or NULL if not. More...
 
static void compute_before_current_statement (expression *pe)
 
static void ref_rwt (reference r)
 
static void call_rwt (call c)
 
static void exp_range_rwt (range r, expression *pe)
 
static void range_rwt (range r)
 
static void test_rwt (test t)
 
static void whileloop_rwt (whileloop w)
 
static void cleanup_subscript (expression e)
 
static void cleanup_subscript_pre (expression exp)
 
void cleanup_subscripts (void *obj)
 
void atomize_as_required (statement stat, bool(*ref_decide)(reference, expression), bool(*call_decide)(call, expression), bool(*test_decide)(test, expression), bool(*range_decide)(range, expression), bool(*while_decide)(whileloop, expression), entity(*new)(entity, basic))
 

Variables

static bool(* ref_atomize_decision )() = NULL
 static functions used More...
 
static bool(* call_atomize_decision )() = NULL
 
static bool(* test_atomize_decision )() = NULL
 
static bool(* range_atomize_decision )() = NULL
 
static bool(* while_atomize_decision )() = NULL
 
static entity(* create_new_variable )() = NULL
 

Function Documentation

◆ atomize_as_required()

void atomize_as_required ( statement  stat,
bool(*)(reference, expression ref_decide,
bool(*)(call, expression call_decide,
bool(*)(test, expression test_decide,
bool(*)(range, expression range_decide,
bool(*)(whileloop, expression while_decide,
entity(*)(entity, basic new 
)
Parameters
stattat
call_decidereference
test_decidecall
range_decidetest
while_deciderange
newwhileloop

Definition at line 392 of file simple_atomize.c.

400 {
401  ifdebug(5) {
402  pips_debug(5,
403  "Statement at entry:\n");
404  print_statement(stat);
405  }
407  make_current_statement_stack();
408  make_current_control_stack();
409  ref_atomize_decision = ref_decide;
410  call_atomize_decision = call_decide;
411  test_atomize_decision = test_decide;
412  range_atomize_decision = range_decide;
413  while_atomize_decision = while_decide;
414  create_new_variable = new;
415 
416  atomize_object((gen_chunkp) stat);
417 
418  ref_atomize_decision = NULL;
419  call_atomize_decision = NULL;
420  test_atomize_decision = NULL;
421  range_atomize_decision = NULL;
422  while_atomize_decision = NULL;
423  create_new_variable = NULL;
424  free_current_statement_stack();
425  free_current_control_stack();
427 
428  ifdebug(5) {
429  pips_debug(5,
430  "Statement at exit:\n");
431  print_statement(stat);
432  }
433 }
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
void reset_hooks_unregister(reset_func_t)
remove registered cleanup hook.
Definition: reset_hooks.c:73
void reset_hooks_register(reset_func_t)
reset_hooks.c
Definition: reset_hooks.c:44
void print_statement(statement)
Print a statement on stderr.
Definition: statement.c:98
#define ifdebug(n)
Definition: sg.c:47
static void atomize_object(gen_chunk *)
void atomize_as_required(stat, ref_decide, call_decide, test_decide, range_decide,...
static bool(* range_atomize_decision)()
static bool(* ref_atomize_decision)()
static functions used
static entity(* create_new_variable)()
static bool(* call_atomize_decision)()
static bool(* test_atomize_decision)()
static bool(* while_atomize_decision)()
static void simple_atomize_error_handler()
the stack of the encoutered statements is maintained to be able to insert the needed computations jus...
A gen_chunk is used to store every object.
Definition: genC.h:58

References atomize_object(), call_atomize_decision, create_new_variable, ifdebug, pips_debug, print_statement(), range_atomize_decision, ref_atomize_decision, reset_hooks_register(), reset_hooks_unregister(), simple_atomize_error_handler(), test_atomize_decision, and while_atomize_decision.

Referenced by normalize_wp65_code(), and NormalizeCodeForHpfc().

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

◆ atomize_object()

static void atomize_object ( gen_chunk obj)
static

void atomize_as_required(stat, ref_decide, call_decide, test_decide, range_decide, while_decide, new) statement stat; bool (*ref_decide)(ref r, expression e); bool (*call_decide)(call r, expression e); bool (*test_decide)(test t, expression e); bool (*range_decide)(range r, expression e), bool (*while_decide)(whileloop w, expression e), entity (*new)(entity m, basic b);

atomizes the given statement as driven by the given functions. ??? does not care of any side effect and so.

  • ref_decide tells whether or not to atomize for reference r and expression indice e of this reference. If yes, expression e is computed outside.
  • call_decide tells whether or not to atomize for call c and argument expression e...
  • test_decide tells whether expression condition e of a test should be atomized or not.
  • new creates a new entity in the current module, the basic type of which should be t.

CONTROL

STATEMENT

REFERENCE

TEST

CALL

RANGE

WHILELOOP

Definition at line 375 of file simple_atomize.c.

376 {
378  (obj,
379  control_domain, current_control_filter,
380  current_control_rewrite, /* CONTROL */
381  statement_domain, current_statement_filter,
382  current_statement_rewrite, /* STATEMENT */
383  reference_domain, gen_true, ref_rwt, /* REFERENCE */
384  test_domain, gen_true, test_rwt, /* TEST */
385  call_domain, gen_true, call_rwt, /* CALL */
386  range_domain, gen_true, range_rwt, /* RANGE */
387  whileloop_domain, gen_true, whileloop_rwt,/* WHILELOOP */
388  NULL);
389  cleanup_subscripts(obj);
390 }
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
Definition: genClib.c:3428
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
#define test_domain
newgen_entity_domain_defined
Definition: ri.h:418
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define control_domain
newgen_controlmap_domain_defined
Definition: ri.h:98
#define call_domain
newgen_callees_domain_defined
Definition: ri.h:58
#define reference_domain
newgen_range_domain_defined
Definition: ri.h:338
#define whileloop_domain
newgen_variable_domain_defined
Definition: ri.h:466
#define range_domain
newgen_ram_domain_defined
Definition: ri.h:330
static void ref_rwt(reference r)
static void whileloop_rwt(whileloop w)
void cleanup_subscripts(void *obj)
static void test_rwt(test t)
static void call_rwt(call c)
static void range_rwt(range r)

References call_domain, call_rwt(), cleanup_subscripts(), control_domain, gen_multi_recurse(), gen_true(), range_domain, range_rwt(), ref_rwt(), reference_domain, statement_domain, test_domain, test_rwt(), whileloop_domain, and whileloop_rwt().

Referenced by atomize_as_required().

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

◆ atomize_this_expression()

statement atomize_this_expression ( entity(*)(entity, basic create,
expression  e 
)

returns the assignment statement is moved, or NULL if not.

simple_atomize.c

it does not make sense to atomize a range...

Definition at line 181 of file simple_atomize.c.

184 {
185  /* it does not make sense to atomize a range...
186  */
187  if (syntax_range_p(expression_syntax(e))) return NULL;
188 
189  basic bofe = basic_of_expression(e);
190  statement out = NULL;
191  if(!basic_undefined_p(bofe)) {
192  if (!basic_overloaded_p(bofe))
193  {
194  bool skip_this_expression = false;
195  if( get_bool_property("COMMON_SUBEXPRESSION_ELIMINATION_SKIP_ADDED_CONSTANT") && expression_call_p(e) )
196  {
197  call c = expression_call(e);
198  entity op = call_function(c);
200  {
202  skip_this_expression|=expression_constant_p(arg);
203  }
204 
205  }
206 
207  if(!skip_this_expression) {
208  ifdebug(1) {
209  pips_debug(1,"atomizing expression:\n");
210  print_expression(e);
211  }
212  entity newvar = (*create)(get_current_module_entity(), copy_basic(bofe));
213  AddEntityToCurrentModule(newvar);
216 
218 
220  expression_syntax(e) = ref;
221  }
222  }
223  }
224  free_basic(bofe);
225  return out;
226 }
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
basic copy_basic(basic p)
BASIC.
Definition: ri.c:104
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
syntax copy_syntax(syntax p)
SYNTAX.
Definition: ri.c:2442
void free_basic(basic p)
Definition: ri.c:107
syntax make_syntax_reference(reference _field_)
Definition: ri.c:2494
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
static FILE * out
Definition: alias_check.c:128
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#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
statement make_assign_statement(expression, expression)
Definition: statement.c:583
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
Definition: expression.c:2453
void normalize_all_expressions_of(void *obj)
Definition: normalize.c:668
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
Definition: expression.c:58
#define ENTITY_PLUS_UPDATE_P(e)
#define ENTITY_PLUS_P(e)
#define ENTITY_PLUS_C_P(e)
bool expression_call_p(expression e)
Definition: expression.c:415
call expression_call(expression e)
Definition: expression.c:445
basic basic_of_expression(expression)
basic basic_of_expression(expression exp): Makes a basic of the same basic as the expression "exp".
Definition: type.c:1383
void AddEntityToCurrentModule(entity)
Add a variable entity to the current module declarations.
Definition: variable.c:260
#define normalized_undefined
Definition: ri.h:1745
#define call_function(x)
Definition: ri.h:709
#define basic_overloaded_p(x)
Definition: ri.h:623
#define basic_undefined_p(x)
Definition: ri.h:557
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define call_arguments(x)
Definition: ri.h:711
#define syntax_range_p(x)
Definition: ri.h:2731
#define expression_syntax(x)
Definition: ri.h:1247

References AddEntityToCurrentModule(), basic_of_expression(), basic_overloaded_p, basic_undefined_p, call_arguments, call_function, copy_basic(), copy_syntax(), ENTITY_PLUS_C_P, ENTITY_PLUS_P, ENTITY_PLUS_UPDATE_P, EXPRESSION, expression_call(), expression_call_p(), expression_constant_p(), expression_syntax, FOREACH, free_basic(), get_bool_property(), get_current_module_entity(), ifdebug, make_assign_statement(), make_expression(), make_reference(), make_syntax_reference(), NIL, normalize_all_expressions_of(), normalized_undefined, out, pips_debug, print_expression(), ref, and syntax_range_p.

Referenced by atom_cse_expression(), atomize_or_associate_for_level(), compute_before_current_statement(), and do_atomize_if_different_level().

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

◆ call_rwt()

static void call_rwt ( call  c)
static

(panic mode:-)

syntax saved = expression_syntax(*pe);

atomize_object(saved);

Definition at line 252 of file simple_atomize.c.

253 {
255  return; /* (panic mode:-) */
256 
257  MAPL(ce,
258  {
259  expression *pe = (expression*) REFCAR(ce);
260 
261  if ((*call_atomize_decision)(c, *pe))
262  {
263  /* syntax saved = expression_syntax(*pe);*/
264 
266  /* atomize_object(saved); */
267  }
268  },
269  call_arguments(c));
270 }
#define REFCAR(pc)
Get the adress of the first element of a list.
Definition: newgen_list.h:119
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
#define same_string_p(s1, s2)
#define IMPLIED_DO_NAME
Definition: ri-util-local.h:75
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
static void compute_before_current_statement(expression *pe)

References call_arguments, call_atomize_decision, call_function, compute_before_current_statement(), entity_local_name(), IMPLIED_DO_NAME, MAPL, REFCAR, and same_string_p.

Referenced by atomize_object().

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

◆ cleanup_subscript()

static void cleanup_subscript ( expression  e)
static

the subscript could be a reference !

update reference with additionnal indices

prepare to free subscript

transform subscript into reference

Definition at line 326 of file simple_atomize.c.

327 {
329  {
332  /* the subscript could be a reference ! */
333  {
335 
336  /* update reference with additionnal indices */
337  reference r = syntax_reference(sa);
339  /* prepare to free subscript */
342  free_subscript(s);
343  /* transform subscript into reference */
346  }
347  }
348 }
void free_subscript(subscript p)
Definition: ri.c:2294
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
bool expression_reference_p(expression e)
Test if an expression is a reference.
Definition: expression.c:528
#define syntax_reference(x)
Definition: ri.h:2730
#define syntax_tag(x)
Definition: ri.h:2727
@ is_syntax_reference
Definition: ri.h:2691
#define subscript_indices(x)
Definition: ri.h:2563
#define reference_indices(x)
Definition: ri.h:2328
#define subscript_array(x)
Definition: ri.h:2561
#define syntax_undefined
Definition: ri.h:2676
#define syntax_subscript(x)
Definition: ri.h:2745
#define syntax_subscript_p(x)
Definition: ri.h:2743

References expression_reference_p(), expression_syntax, free_subscript(), gen_nconc(), is_syntax_reference, NIL, reference_indices, subscript_array, subscript_indices, syntax_reference, syntax_subscript, syntax_subscript_p, syntax_tag, and syntax_undefined.

Referenced by cleanup_subscripts().

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

◆ cleanup_subscript_pre()

static void cleanup_subscript_pre ( expression  exp)
static

Definition at line 350 of file simple_atomize.c.

351 {
352  if(expression_call_p(exp)) {
353  call c = expression_call(exp);
355  expression lhs = binary_call_lhs(c);
356  if(expression_call_p(lhs)) {
357  call c = expression_call(lhs);
359  expression lhs = binary_call_lhs(c);
360  syntax syn = expression_syntax(lhs);
363  }
364  }
365  }
366  }
367 }
#define ENTITY_DEREFERENCING_P(e)
#define binary_call_lhs(c)
#define ENTITY_ADDRESS_OF_P(e)
void update_expression_syntax(expression e, syntax s)
frees expression syntax of e and replace it by the new syntax s
Definition: expression.c:3564
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References binary_call_lhs, call_function, ENTITY_ADDRESS_OF_P, ENTITY_DEREFERENCING_P, exp, expression_call(), expression_call_p(), expression_syntax, syntax_undefined, and update_expression_syntax().

Referenced by cleanup_subscripts().

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

◆ cleanup_subscripts()

void cleanup_subscripts ( void *  obj)
Parameters
objbj

Definition at line 369 of file simple_atomize.c.

370 {
373 }
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
#define expression_domain
newgen_execution_domain_defined
Definition: ri.h:154
static void cleanup_subscript_pre(expression exp)
static void cleanup_subscript(expression e)

References cleanup_subscript(), cleanup_subscript_pre(), expression_domain, gen_recurse, and gen_true().

Referenced by atomize_object(), convert_pointer_to_array(), do_linearize_prepatch_subscripts(), insert_before_statement(), linearize_array_generic(), perform_ac_cse(), and split_structures().

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

◆ compute_before_current_statement()

static void compute_before_current_statement ( expression pe)
static

Definition at line 228 of file simple_atomize.c.

229 {
231  if (stat) insert_before_current_statement(stat);
232 }
static void insert_before_current_statement(statement s)
s is inserted before the current statement.
statement atomize_this_expression(entity(*create)(entity, basic), expression e)
returns the assignment statement is moved, or NULL if not.

References atomize_this_expression(), create_new_variable, and insert_before_current_statement().

Referenced by call_rwt(), exp_range_rwt(), ref_rwt(), test_rwt(), and whileloop_rwt().

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

◆ exp_range_rwt()

static void exp_range_rwt ( range  r,
expression pe 
)
static

syntax saved = expression_syntax(*pe);

atomize_object(saved);

Definition at line 273 of file simple_atomize.c.

274 {
275  if ((*range_atomize_decision)(r, *pe))
276  {
277  /* syntax saved = expression_syntax(*pe); */
279  /* atomize_object(saved);*/
280  }
281 }

References compute_before_current_statement(), and range_atomize_decision.

Referenced by range_rwt().

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

◆ insert_before_current_statement()

static void insert_before_current_statement ( statement  s)
static

s is inserted before the current statement.

if it is a block, it is added just before the last statement of the block, else a block statement is created in place of the current statement.

it is in an unstructured, and s is to be inserted properly

update the other lists

new current statement, to avoid other control insertions

of statement

insert statement before the last one

Definition at line 100 of file simple_atomize.c.

101 {
102  statement cs = current_statement_head();
104  control cc = current_control_empty_p() ?
105  control_undefined : current_control_head() ;
106 
107  if (!control_undefined_p(cc) && control_statement(cc)==cs)
108  {
109  /* it is in an unstructured, and s is to be inserted properly
110  */
111  bool seen;
112  control newc;
113 
114  pips_debug(8, "unstructured\n");
115 
116  newc = make_control(s, control_predecessors(cc),
117  CONS(CONTROL, cc, NIL));
118  control_predecessors(cc) = CONS(CONTROL, newc, NIL);
119 
120  /* update the other lists
121  */
122  MAPL(c1,
123  {
124  seen=false;
125 
126  MAPL(c2,
127  {
128  if (CONTROL(CAR(c2))==cc)
129  {
130  CONTROL_(CAR(c2))=newc;
131  seen=true;
132  }
133  },
135 
136  assert(seen);
137  },
138  control_predecessors(newc));
139 
140  /* new current statement, to avoid other control insertions
141  */
142  current_statement_replace(s);
143  gen_recurse_stop(newc);
144  }
145  else
146  {
147  pips_debug(7, "statement\n");
148 
149  if (instruction_block_p(i)) {
150  list /* of statement */ block = instruction_block(i);
151  /* insert statement before the last one */
154  block);
155  }
156  else {
159  CONS(STATEMENT, s,
160  CONS(STATEMENT,
162  statement_number(cs),
163  statement_ordering(cs),
164  statement_comments(cs),
166  NIL, NULL,
169  NIL)));
175  }
176  }
177 }
static hash_table seen
static function to store whether a module has been seen during the recursive generation of the daVinc...
Definition: graph.c:85
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
Definition: ri.c:2222
synchronization make_synchronization_none(void)
Definition: ri.c:2424
control make_control(statement a1, list a2, list a3)
Definition: ri.c:523
void gen_recurse_stop(void *obj)
Tells the recursion not to go in this object.
Definition: genClib.c:3251
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
Definition: instruction.c:106
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
list gen_last(list l)
Return the last element of a list.
Definition: list.c:578
list gen_insert_before(const void *no, const void *o, list l)
Definition: list.c:238
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
Definition: newgen-local.h:35
#define assert(ex)
Definition: newgen_assert.h:41
#define instruction_block_p(i)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define instruction_block(i)
#define empty_comments
Empty comments (i.e.
entity entity_empty_label(void)
Definition: entity.c:1105
extensions empty_extensions(void)
extension.c
Definition: extension.c:43
#define control_undefined
Definition: ri.h:916
#define CONTROL_(x)
Definition: ri.h:913
#define control_predecessors(x)
Definition: ri.h:943
#define statement_ordering(x)
Definition: ri.h:2454
#define CONTROL(x)
CONTROL.
Definition: ri.h:910
#define statement_label(x)
Definition: ri.h:2450
#define statement_extensions(x)
Definition: ri.h:2464
#define control_successors(x)
Definition: ri.h:945
#define control_undefined_p(x)
Definition: ri.h:917
#define statement_instruction(x)
Definition: ri.h:2458
#define statement_comments(x)
Definition: ri.h:2456
#define control_statement(x)
Definition: ri.h:941
#define statement_number(x)
Definition: ri.h:2452
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References assert, CAR, CONS, CONTROL, CONTROL_, control_predecessors, control_statement, control_successors, control_undefined, control_undefined_p, empty_comments, empty_extensions(), entity_empty_label(), gen_insert_before(), gen_last(), gen_recurse_stop(), instruction_block, instruction_block_p, make_control(), make_instruction_block(), make_statement(), make_synchronization_none(), MAPL, NIL, pips_debug, seen, STATEMENT, statement_comments, statement_extensions, statement_instruction, statement_label, statement_number, STATEMENT_NUMBER_UNDEFINED, statement_ordering, and STATEMENT_ORDERING_UNDEFINED.

Referenced by compute_before_current_statement().

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

◆ range_rwt()

static void range_rwt ( range  r)
static

lower

upper

increment

Definition at line 283 of file simple_atomize.c.

284 {
285  /* lower */
286  exp_range_rwt(r, &range_lower(r));
287 
288  /* upper */
289  exp_range_rwt(r, &range_upper(r));
290 
291  /* increment */
293 }
#define range_upper(x)
Definition: ri.h:2290
#define range_increment(x)
Definition: ri.h:2292
#define range_lower(x)
Definition: ri.h:2288
static void exp_range_rwt(range r, expression *pe)

References exp_range_rwt(), range_increment, range_lower, and range_upper.

Referenced by atomize_object().

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

◆ ref_rwt()

static void ref_rwt ( reference  r)
static

syntax saved = expression_syntax(*pe);

atomize_object(saved);

return(false);

Definition at line 234 of file simple_atomize.c.

235 {
236  MAPL(ce,
237  {
238  expression *pe = (expression*) REFCAR(ce);
239 
240  if ((*ref_atomize_decision)(r, *pe))
241  {
242  /* syntax saved = expression_syntax(*pe);*/
244  /* atomize_object(saved); */
245  }
246  },
247  reference_indices(r));
248 
249  /* return(false);*/
250 }

References compute_before_current_statement(), MAPL, ref_atomize_decision, REFCAR, and reference_indices.

Referenced by atomize_object().

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

◆ simple_atomize_error_handler()

static void simple_atomize_error_handler ( )
static

the stack of the encoutered statements is maintained to be able to insert the needed computations just before the very last statement encountered.

The use of a stack is not necessary, since there are no effective rewrite. but it could have been... It enables some recursive calls that would have required to save the current statement explicitely otherwise.

Definition at line 90 of file simple_atomize.c.

91 {
92  error_reset_current_statement_stack();
93  error_reset_current_control_stack();
94 }

Referenced by atomize_as_required().

+ Here is the caller graph for this function:

◆ test_rwt()

static void test_rwt ( test  t)
static

syntax saved = expression_syntax(*pe);

else I have to break the condition and to complete the recursion.

atomize_object(saved);

Definition at line 296 of file simple_atomize.c.

297 {
298  expression *pe = &test_condition(t);
299 
300  if ((*test_atomize_decision)(t, *pe))
301  {
302  /* syntax saved = expression_syntax(*pe);*/
303  /* else I have to break the condition
304  * and to complete the recursion.
305  */
307  /* atomize_object(saved); */
308  }
309 }
#define test_condition(x)
Definition: ri.h:2833

References compute_before_current_statement(), test_atomize_decision, and test_condition.

Referenced by atomize_object().

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

◆ whileloop_rwt()

static void whileloop_rwt ( whileloop  w)
static

syntax saved = expression_syntax(*pe);

else I have to break the condition and to complete the recursion.

atomize_object(saved);

Definition at line 311 of file simple_atomize.c.

312 {
314 
315  if ((*while_atomize_decision)(w, *pe))
316  {
317  /* syntax saved = expression_syntax(*pe); */
318  /* else I have to break the condition
319  * and to complete the recursion.
320  */
322  /* atomize_object(saved);*/
323  }
324 }
#define whileloop_condition(x)
Definition: ri.h:3160

References compute_before_current_statement(), while_atomize_decision, and whileloop_condition.

Referenced by atomize_object().

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

Variable Documentation

◆ call_atomize_decision

bool(* call_atomize_decision) () ( ) = NULL
static

Definition at line 71 of file simple_atomize.c.

Referenced by atomize_as_required(), and call_rwt().

◆ create_new_variable

entity(* create_new_variable) () ( ) = NULL
static

Definition at line 76 of file simple_atomize.c.

Referenced by atomize_as_required(), and compute_before_current_statement().

◆ range_atomize_decision

bool(* range_atomize_decision) () ( ) = NULL
static

Definition at line 73 of file simple_atomize.c.

Referenced by atomize_as_required(), and exp_range_rwt().

◆ ref_atomize_decision

bool(* ref_atomize_decision) () ( ) = NULL
static

static functions used

Definition at line 70 of file simple_atomize.c.

Referenced by atomize_as_required(), and ref_rwt().

◆ test_atomize_decision

bool(* test_atomize_decision) () ( ) = NULL
static

Definition at line 72 of file simple_atomize.c.

Referenced by atomize_as_required(), and test_rwt().

◆ while_atomize_decision

bool(* while_atomize_decision) () ( ) = NULL
static

Definition at line 74 of file simple_atomize.c.

Referenced by atomize_as_required(), and whileloop_rwt().