PIPS
parser.c
Go to the documentation of this file.
1 #ifdef HAVE_CONFIG_H
2  #include "pips_config.h"
3 #endif
4 #include "defines-local.h"
5 #include <ctype.h> // for toupper
6 #include "workspace-util.h" // for compilation_unit_of_module()
7 #include "prettyprint.h" // for print_statement()
8 extern void step_bison_parse(pragma pgm, statement stmt);
10 
13 static int current_transform = -1;
14 
15 static void print_step_blocks();
16 static step_directive new_step_directive(statement directive_stmt, int type, string s);
17 static void reset_step_transform();
19 
20 
21 /*
22  Stack of blocks/sequences used during parsing to construct sequences
23  of statements associated to a directive.
24  Fundamental for Fortran programs.
25 */
26 
28 
29 /*
30  *
31  *
32  *
33  *
34  * Functions called from the BISON parser
35  *
36  *
37  *
38  *
39  */
40 
41 void set_current_transform(int transform)
42 {
43  current_transform = transform;
44 }
45 
47 {
49 
50  switch (type)
51  {
52  case STEP_DO:
53  add_pragma_str_to_statement(new_stmt, "ompenddo\n", true);
54  break;
55  case STEP_PARALLEL_DO:
56  add_pragma_str_to_statement(new_stmt, "ompendparalleldo\n", true);
57  break;
58  default:
59  pips_user_error("Unexpected pragma type %d\n", type);
60  }
62  pips_assert("parent", parent_stmt != NULL);
63  pips_assert("block", statement_block_p(parent_stmt));
64  gen_insert_after(new_stmt, current_statement, statement_block(parent_stmt));
65 }
66 
68 {
70 
71  pips_debug(1, "begin\n");
72 
74  {
75  /* passage de name a NAME */
76  size_t i;
77  for (i=0; i<strlen(name); i++)
78  name[i]=toupper(name[i]);
79 
82  if (entity_undefined_p(e))
83  pips_user_error("\nFortran entity \"%s\" not found\n", full_name);
84  free(full_name);
85  }
87  {
88  /* determiner le nom avec le bon scope... */
89  statement stmt_declaration = current_statement;
90  pips_debug(4,"##### ENTITY DECL #####\n");
91  while (entity_undefined_p(e) && stmt_declaration)
92  {
93  FOREACH(entity, ee, statement_declarations(stmt_declaration))
94  {
95  pips_debug(4, "entity decl : \"%s\"\n", entity_name(ee));
96  if (strcmp(name, entity_user_name(ee)) == 0)
97  {
98  e = ee;
99  break;
100  }
101  }
102  stmt_declaration = (statement)gen_get_ancestor(statement_domain, stmt_declaration);
103  }
104 
105  if (entity_undefined_p(e))
106  {
108  {
109  pips_debug(4, "entity decl : \"%s\"\n", entity_name(ee));
110  if (strcmp(name, entity_user_name(ee)) == 0)
111  {
112  e = ee;
113  break;
114  }
115  }
116  }
117  if (entity_undefined_p(e))
118  {
120  string full_name = strdup(concatenate(cu, MODULE_SEP_STRING, name, NULL));
122  free(full_name);
123  }
124  if (entity_undefined_p(e))
125  {
128  free(full_name);
129  }
130 
131  if (entity_undefined_p(e))
132  pips_user_error("\nC Entity \"%s\" not found\n", name);
133  }
134 
135  pips_debug(1, "end\n");;
136  return e;
137 }
138 
140 {
141  pips_assert("statement defined", !statement_undefined_p(current_statement));
142  pips_assert("pragma defined", !pragma_undefined_p(current_pragma));
143 
145 
146  list el = extensions_extension(es);
147 
149  FOREACH(EXTENSION, e, el)
150  {
152  if (p != current_pragma)
154  }
155 
157 }
158 
160 {
161  statement directive_stmt;
162 
163  pips_debug(1,"begin type = %d, str = %s\n", type, s);
164 
165  directive_stmt = current_statement;
166 
168  {
169  switch(type)
170  {
171  case STEP_DO:
172  case STEP_PARALLEL_DO:
173  pips_assert("loop statement", statement_loop_p(directive_stmt)||statement_forloop_p(directive_stmt));
175  _FALLTHROUGH_; // is that so?
176  case STEP_PARALLEL:
177  case STEP_MASTER:
178  case STEP_SINGLE:
179  case STEP_BARRIER:
180  directive_stmt = make_empty_block_statement();
181  break;
182  case STEP_THREADPRIVATE:
183  directive_stmt = make_empty_block_statement();
184  break;
185  default:
186  pips_user_error("unknown directive type %d\n", type);
187  break;
188  }
189  }
191  {
192  switch(type)
193  {
194  case STEP_DO:
195  case STEP_PARALLEL_DO:
196  {
197  statement new_stmt;
198  pips_assert("loop statement", statement_loop_p(directive_stmt)||statement_forloop_p(directive_stmt));
199  pips_debug(2,"Block conversion (C)\n");
200 
201  new_stmt = instruction_to_statement(statement_instruction(directive_stmt));
202 
203  move_statement_attributes(directive_stmt, new_stmt);
204  statement_label(directive_stmt) = entity_empty_label();
205  statement_comments(directive_stmt) = empty_comments;
206  statement_declarations(directive_stmt) = NIL;
207  statement_decls_text(directive_stmt) = NULL;
208  statement_extensions(directive_stmt) = empty_extensions();
209  statement_instruction(directive_stmt) = make_instruction_block(CONS(STATEMENT, new_stmt, NIL));
210  }
211  case STEP_PARALLEL:
212  case STEP_MASTER:
213  case STEP_SINGLE:
214  /* In C, these OpenMP pragmas are already supported by blocks: no block conversion needed */
215  break;
216  case STEP_BARRIER:
217  directive_stmt = make_empty_block_statement();
218  break;
219  case STEP_THREADPRIVATE:
220  directive_stmt = make_empty_block_statement();
221  break;
222  default:
223  pips_user_error("unknown directive type %d\n", type);
224  break;
225  }
226  }
227  else
228  pips_user_error("language not supported");
229 
230  step_directive drt = new_step_directive(directive_stmt, type, s);
231 
233  {
234  step_blocks_push(statement_sequence(directive_stmt));
235  }
236 
237  pips_debug(1,"end drt = %p\n", drt);
238  return drt;
239 }
240 
241 /*
242  * Function used for Fortran programs
243  *
244  *
245  -> substitution dans une sequence : I1,...,Ii+OMPpragma,... , Ij-1, Ij+OMPpragma, ..., In en :
246  I1,..., Block(Ii, ..., Ij-1 )+STEPpragma, Ij..., In
247 */
249 {
250  step_directive drt;
251 
252  pips_debug(1,"begin type = %d\n", type);
253 
256  {
257  switch(type)
258  {
259  case STEP_DO:
260  case STEP_PARALLEL_DO:
261  {
262  sequence current_block;
263  statement last_stmt;
264 
265 
266  current_block = step_blocks_head();
267  last_stmt = STATEMENT(CAR(sequence_statements(current_block)));
268  /* suppression du CONTINUE portant le pragma optionnel dans le futur block */
269  while (empty_statement_or_labelless_continue_p(last_stmt))
270  {
271  pips_debug(2,"POP current_block");
272  POP(sequence_statements(current_block));
273  last_stmt = STATEMENT(CAR(sequence_statements(current_block)));
274  }
275  if(step_directives_bound_p(last_stmt))
276  {
277  drt = step_directives_load(last_stmt);
278  if (step_directive_type(drt) != type)
279  pips_user_error("\nDirective end-loop not well formed\n");
280  else
281  pips_debug(2,"loop directive already closed\n");
282  }
283  else if (!statement_loop_p(last_stmt))
284  pips_user_error("\nDirective end-loop after a no-loop statement\n");
285  }
286  default:
287  break;
288  }
289 
291  {
292  drt = get_current_step_directive(true);
293 
295  pips_user_error("\nDirective not well formed\n");
296 
297  int size = step_blocks_size();
298  sequence new_seq = step_blocks_pop();
299  pips_debug(2,"pop block directive\n");
300  pips_debug(2, "block_stack size :%d\t new_seq_length=%d\n", size, (int)gen_length(sequence_statements(new_seq)));
301 
302  statement directive_stmt = step_directive_block(drt);
303  sequence_statements(statement_sequence(directive_stmt)) = gen_nreverse(statement_block(directive_stmt));
304  }
305  }
306 
307  pips_debug(1, "end drt = %p\n", drt);
308  return drt;
309 }
310 
311 /*
312  *
313  *
314  *
315  *
316  * Functions used for gen_multi_recurse
317  *
318  *
319  *
320  *
321  */
322 static step_directive new_step_directive(statement directive_stmt, int type, string s)
323 {
324  step_directive drt;
325  sequence current_block;
326 
327  pips_debug(1,"begin directive_stmt = %p, type = %d, str = %s\n", directive_stmt, type, s);
328 
329  if(!statement_block_p(directive_stmt))
330  {
331  pips_debug(0,"Directive type : %s\n", s);
332  STEP_DEBUG_STATEMENT(0, "on statement", directive_stmt);
333  pips_assert("block statement", false);
334  }
335 
336 
337  pips_debug(2, "make_step_directive\n");
339  step_directives_store(directive_stmt, drt);
340  add_pragma_str_to_statement(directive_stmt, strdup(concatenate(STEP_SENTINELLE, s, NULL)), false);
341 
342  current_block = step_blocks_head();
343  sequence_statements(current_block) = CONS(STATEMENT, directive_stmt, sequence_statements(current_block));
344 
346 
347  pips_debug(1,"end drt = %p\n", drt);
348  return drt;
349 }
350 
351 
352 static void print_step_blocks()
353 {
354  int size;
355  int head_len;
356 
357  size = step_blocks_size();
358  head_len = size?gen_length(sequence_statements(step_blocks_head())):0;
359  pips_debug(4, "size = %d, head_length = %d\n", size, head_len);
360 }
361 
362 static void reset_step_transform()
363 {
364  const char* transformation = get_string_property("STEP_DEFAULT_TRANSFORMATION");
365 
372  else
374 
375  pips_debug(2, "step transform type : %d\n", current_transform);
376 }
377 
378 /*
379  Le statement correspondant a la directive courante est en debut de sequence
380  (l'ordre des statements dans les séquences est inversé dans la pile step_blocks)
381 */
383 {
385  {
386  pips_assert("stack size", step_blocks_size() > 1);
387 
388  sequence parent_block = step_blocks_nth(2);
389 
390  statement last_stmt = STATEMENT(CAR(sequence_statements(parent_block)));
391  STEP_DEBUG_STATEMENT(1, "last_stmt 1", last_stmt);
392 
393  pips_assert("directive", step_directives_bound_p(last_stmt));
394  pips_assert("sequence", statement_sequence_p(last_stmt));
395  pips_assert("same sequence", statement_sequence(last_stmt)==step_blocks_head());
396 
397  return step_directives_load(last_stmt);
398  }
399  else if(!step_blocks_empty_p())
400  {
401  sequence current_block = step_blocks_head();
402 
403  if (!ENDP(sequence_statements(current_block)))
404  {
405  statement last_stmt = STATEMENT(CAR(sequence_statements(current_block)));
406  STEP_DEBUG_STATEMENT(1,"last_stmt 2",last_stmt);
407 
408  if(step_directives_bound_p(last_stmt))
409  return step_directives_load(last_stmt);
410  }
411  }
412 
414 }
415 
416 /*
417  * pragma analysis
418  */
419 
421 {
422  pips_debug(1,"begin\n");
423 
424  pips_assert("statement undefined", statement_undefined_p(current_statement));
425  pips_assert("pragma undefined", pragma_undefined_p(current_pragma));
426 
428 
430 
431  STEP_DEBUG_STATEMENT(1, "begin stmt", current_statement);
432  pips_debug(1,"end stmt\n");
433 
435  {
436  pips_debug(2,"for each extension\n");
439  {
441  }
442  }
445  pips_debug(1,"end\n");
446 }
447 
449 {
450  pips_debug(1,"begin\n");
451  STEP_DEBUG_STATEMENT(2,"begin in stmt",stmt);
452  pips_debug(2,"end in stmt\n");
453 
455 
456  /* For fortran programs, converting comments into pragmas */
459 
460  if (step_blocks_empty_p())
461  {
462  pips_debug(2,"empty step_blocks: nothing to do in the module body\n");
463  }
464  else
465  {
466  statement parent_stmt;
467 
468  pips_debug(2,"Analysing and handling pragmas\n");
469 
471  pips_assert("parent", parent_stmt != NULL);
472 
474  !statement_block_p(parent_stmt))
475  {
476  /*
477  On transforme un statement portant un pragma en block s'il ne l'etait pas deja.
478  L'analyse aura lieu lors du parcours du block nouvellement cree
479  */
480  pips_debug(2,"Block conversion (Fortran)\n");
481 
483  move_statement_attributes(stmt, new_stmt);
484 
488  statement_decls_text(stmt) = NULL;
490 
492  }
493  else
494  {
496 
497  /*
498  Si dans une sequence (== block), on met a jour le block courant
499  Si c'est une directive, elle a ete ajoute a son identification
500  */
501  if(!step_directives_bound_p(stmt) && statement_block_p(parent_stmt))
502  {
503  sequence current_block = step_blocks_head();
504  pips_debug(2,"ADD stmt to the current block\n");
505  sequence_statements(current_block)=CONS(STATEMENT, stmt,
506  sequence_statements(current_block));
507  }
508  else
509  {
510  pips_debug(2,"NOT added to current step_blocks\n");
511  }
512  }
513  }
514 
515  STEP_DEBUG_STATEMENT(2,"begin out stmt",stmt);
516  pips_debug(2,"end out stmt\n");
517  pips_debug(1,"end\n");
518  return true;
519 }
520 
522 {
523  pips_debug(1,"begin\n");
524  STEP_DEBUG_STATEMENT(5, "begin in stmt", stmt);
525  pips_debug(5, "end in stmt");
526 
528 
529  STEP_DEBUG_STATEMENT(5, "begin out stmt", stmt);
530  pips_debug(5, "end out stmt");
531 
532  pips_debug(1,"end\n");
533  return;
534 }
535 
536 static bool sequence_filter(sequence __attribute__ ((unused)) seq)
537 {
538  pips_debug(1,"begin\n");
539  pips_debug(2,"PUSH empty sequence on step_blocks\n");
540  step_blocks_push(make_sequence(NIL));
541 
543  pips_debug(1,"end\n");
544  return true;
545 }
546 
547 static void sequence_rewrite(sequence seq)
548 {
549  int size;
550  sequence previous_block;
551 
552  pips_debug(1,"begin\n");
553 
554  size = step_blocks_size();
555  previous_block = step_blocks_nth(2);
556 
557  if(previous_block && !sequence_undefined_p(previous_block))
558  {
559  statement last_stmt = STATEMENT(CAR(sequence_statements(previous_block)));
561  pips_user_error("\nDirective not well formed\n");
562  }
563 
564  sequence new_seq = step_blocks_pop();
565  pips_debug(2, "POP step_blocks\n");
566  pips_debug(2, "block_stack size :%d\t new_seq_length=%d\n", size, (int)gen_length(sequence_statements(new_seq)));
567 
570  sequence_statements(new_seq) = NIL;
571  free_sequence(new_seq);
572 
573  pips_debug(1,"end\n");
574  return;
575 }
576 
578 {
579  /* For fortran programs, converting comments into pragmas into declaration txt */
582 
583  make_step_blocks_stack();
584 
585  // where the OpenMP constructs are identified
586  gen_multi_recurse(body,
589  NULL);
590 
591  free_step_blocks_stack();
592 }
593 
594 bool step_parser(const char* module_name)
595 {
596  debug_on("STEP_PARSER_DEBUG_LEVEL");
597  pips_debug(1, "%d module_name = %s\n", __LINE__, module_name);
598 
601 
603 
605 
607 
608  ifdebug(1)
609  {
611  }
612 
615 
616 
620 
622 
623  pips_debug(1, "End step_parser\n");
624  debug_off();
625 
626  return true;
627 }
628 
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
Definition: 3dnow.h:3
list gen_extension_cons(extension p, list l)
Definition: ri.c:908
sequence make_sequence(list a)
Definition: ri.c:2125
void free_sequence(sequence p)
Definition: ri.c:2092
step_directive make_step_directive(intptr_t a1, statement a2, list a3)
Definition: step_private.c:405
step_clause make_step_clause_transformation(intptr_t _field_)
Definition: step_private.c:249
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
string compilation_unit_of_module(const char *)
The output is undefined if the module is referenced but not defined in the workspace,...
Definition: module.c:350
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
char * get_string_property(const char *)
void free(void *)
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
Definition: statement.c:625
void move_statement_attributes(statement, statement)
Move all the attributes from one statement to another one.
Definition: statement.c:657
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
const char * get_current_module_name(void)
Get the name of the current module.
Definition: static.c:121
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
Definition: genClib.c:3428
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
Definition: genClib.c:3560
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
Definition: instruction.c:106
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#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
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#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
void gen_insert_after(const void *no, const void *o, list l)
Definition: list.c:223
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
sequence statement_sequence(statement)
Get the sequence of a statement sequence.
Definition: statement.c:1328
list statement_block(statement)
Get the list of block statements of a statement sequence.
Definition: statement.c:1338
bool empty_statement_or_labelless_continue_p(statement)
Return true if the statement is an empty instruction block without label or a continue without label ...
Definition: statement.c:446
bool statement_forloop_p(statement)
Definition: statement.c:374
bool statement_loop_p(statement)
Definition: statement.c:349
bool statement_sequence_p(statement)
Statement classes induced from instruction type.
Definition: statement.c:335
statement make_plain_continue_statement(void)
Make a simple continue statement to be used as a NOP or ";" in C.
Definition: statement.c:964
#define full_name(dir, name)
Definition: compile.c:414
#define debug_on(env)
Definition: misc-local.h:157
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define debug_off()
Definition: misc-local.h:160
#define _FALLTHROUGH_
Definition: misc-local.h:238
#define pips_user_error
Definition: misc-local.h:147
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
#define MODULE_SEP_STRING
Definition: naming-local.h:30
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
Definition: ordering.c:185
bool ordering_to_statement_initialized_p()
Test if the ordering to statement is initialized.
Definition: ordering.c:63
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
Definition: reorder.c:244
#define statement_block_p(stat)
#define empty_comments
Empty comments (i.e.
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
Definition: entity.c:487
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
bool c_module_p(entity m)
Test if a module "m" is written in C.
Definition: entity.c:2777
code entity_code(entity e)
Definition: entity.c:1098
entity entity_empty_label(void)
Definition: entity.c:1105
bool fortran_module_p(entity m)
Test if a module is in Fortran.
Definition: entity.c:2799
extensions empty_extensions(void)
extension.c
Definition: extension.c:43
void add_pragma_str_to_statement(statement st, const char *s, bool copy_flag)
Add a string as a pragma to a statement.
Definition: pragma.c:425
#define pragma_undefined
Definition: ri.h:1997
#define pragma_string_p(x)
Definition: ri.h:2031
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define code_declarations(x)
Definition: ri.h:784
#define statement_label(x)
Definition: ri.h:2450
#define extension_pragma(x)
Definition: ri.h:1295
#define EXTENSION(x)
EXTENSION.
Definition: ri.h:1253
#define entity_undefined_p(x)
Definition: ri.h:2762
#define entity_undefined
Definition: ri.h:2761
#define entity_name(x)
Definition: ri.h:2790
#define sequence_statements(x)
Definition: ri.h:2360
#define statement_extensions(x)
Definition: ri.h:2464
#define statement_declarations(x)
Definition: ri.h:2460
#define statement_instruction(x)
Definition: ri.h:2458
#define statement_comments(x)
Definition: ri.h:2456
#define statement_decls_text(x)
Definition: ri.h:2462
#define extensions_extension(x)
Definition: ri.h:1330
#define statement_undefined_p(x)
Definition: ri.h:2420
#define sequence_domain
newgen_reference_domain_defined
Definition: ri.h:346
#define pragma_undefined_p(x)
Definition: ri.h:1998
#define sequence_undefined_p(x)
Definition: ri.h:2339
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
#define statement_undefined
Definition: ri.h:2419
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
char * strdup()
#define ifdebug(n)
Definition: sg.c:47
#define STEP_TRANSFORMATION_HYBRID
Definition: defines-local.h:57
#define STEP_TRANSFORMATION_SEQ
Definition: defines-local.h:58
#define STEP_DEBUG_STATEMENT(D, W, S)
Definition: defines-local.h:42
#define STEP_TRANSFORMATION_OMP
Definition: defines-local.h:55
#define STEP_DEFAULT_TRANSFORMATION_HYBRID_TXT
Definition: defines-local.h:52
#define STEP_TRANSFORMATION_MPI
Definition: defines-local.h:56
#define STEP_DEFAULT_TRANSFORMATION_MPI_TXT
Definition: defines-local.h:53
#define STEP_DEFAULT_TRANSFORMATION_OMP_TXT
Definition: defines-local.h:51
#define STEP_SENTINELLE
STEP sentinelle.
Definition: defines-local.h:48
void step_directives_save()
Definition: directives.c:108
bool step_directives_bound_p(statement stmt)
Definition: directives.c:121
void step_directives_store(statement stmt, step_directive d)
Definition: directives.c:126
void step_directives_print()
Definition: directives.c:79
step_directive step_directives_load(statement stmt)
Definition: directives.c:116
void step_directives_init(bool first_p)
Definition: directives.c:88
static bool statement_filter(statement stmt)
Definition: parser.c:448
static int current_transform
Definition: parser.c:13
static void print_step_blocks()
Definition: parser.c:352
DEFINE_LOCAL_STACK(step_blocks, sequence)
static bool sequence_filter(sequence __attribute__((unused)) seq)
Definition: parser.c:536
static pragma current_pragma
Definition: parser.c:12
void remove_old_pragma(void)
Definition: parser.c:139
static step_directive get_current_step_directive(bool open)
Definition: parser.c:382
void step_bison_parse(pragma pgm, statement stmt)
static step_directive new_step_directive(statement directive_stmt, int type, string s)
Functions used for gen_multi_recurse.
Definition: parser.c:322
static void step_pragma_handle(statement stmt)
Definition: parser.c:420
static void statement_rewrite(statement stmt)
Definition: parser.c:521
void set_current_transform(int transform)
Functions called from the BISON parser.
Definition: parser.c:41
static void step_directive_parser(statement body)
Definition: parser.c:577
static void reset_step_transform()
Definition: parser.c:362
static statement current_statement
Definition: parser.c:11
static void sequence_rewrite(sequence seq)
Definition: parser.c:547
entity entity_from_user_name(string name)
Definition: parser.c:67
void step_comment2pragma_handle(statement stmt)
step_directive begin_omp_construct(int type, string s)
Definition: parser.c:159
bool step_parser(const char *module_name)
Definition: parser.c:594
void insert_optional_pragma(int type)
Definition: parser.c:46
step_directive end_omp_construct(int type)
Definition: parser.c:248
#define STEP_THREADPRIVATE
Definition: step_common.h:50
#define STEP_SINGLE
Definition: step_common.h:49
#define STEP_PARALLEL
Handled construction.
Definition: step_common.h:43
#define STEP_PARALLEL_DO
Definition: step_common.h:45
#define STEP_MASTER
Definition: step_common.h:46
#define STEP_DO
Definition: step_common.h:44
#define STEP_BARRIER
Definition: step_common.h:48
#define step_directive_undefined
Definition: step_private.h:404
#define step_directive_type(x)
Definition: step_private.h:429
#define step_directive_block(x)
Definition: step_private.h:431
#define STEP_CLAUSE(x)
STEP_CLAUSE.
Definition: step_private.h:227
#define step_directive_undefined_p(x)
Definition: step_private.h:405
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: statement.c:54