PIPS
pragma.c File Reference
#include "linear.h"
#include "genC.h"
#include "misc.h"
#include "ri.h"
#include "naming.h"
#include "ri-util.h"
#include "properties.h"
+ Include dependency graph for pragma.c:

Go to the source code of this file.

Functions

static bool is_expression_omp_private_p (expression exp)
 
static bool is_expression_omp_if_p (expression exp)
 
static bool is_expression_omp_reduction_p (expression exp)
 
static bool is_expression_omp_omp_p (expression exp)
 
static bool is_expression_omp_for_p (expression exp)
 
static bool is_expression_omp_parallel_p (expression exp)
 
static if_clause_policy get_if_clause_policy (void)
 
static expression merge_conditions (list l_cond, if_clause_policy policy, language l)
 
expression pragma_build_if_condition (expression cond, language l)
 build the expression to be put in the if clause. More...
 
expression pragma_if_as_expr (expression arg)
 
expression pragma_private_as_expr_with_args (list args_expr)
 
expression pragma_private_as_expr (list args_ent)
 
list pragma_omp_parallel_as_exprs (void)
 
list pragma_omp_parallel_for_as_exprs (void)
 
list filter_variables_in_pragma_expr (list l_expr, list to_filter)
 filter out a pragma (expression list) removing all requested variables @params l_expr is the list of expressions to filter @params to_filter is the list of entities to remove from l_pragma More...
 
list pragma_omp_merge_expr (list outer_extensions, list l_pragma, language l)
 merge omp pragma. More...
 
void add_pragma_str_to_statement (statement st, const char *s, bool copy_flag)
 Add a string as a pragma to a statement. More...
 
void add_pragma_strings_to_statement (statement st, list l, bool copy_flag)
 Add a list of strings as as many pragmas to a statement. More...
 
void add_pragma_expr_to_statement (statement st, list l)
 Add a pragma as a list of expression to a statement. More...
 

Variables

const string FORTRAN_PRAGMA_HEADER = FORTRAN_PRAGMA_HEADER_STRING
 pragma.c More...
 
const string FORTRAN_OMP_CONTINUATION = FORTRAN_OMP_CONTINUATION_STRING
 

Function Documentation

◆ add_pragma_expr_to_statement()

void add_pragma_expr_to_statement ( statement  st,
list  l 
)

Add a pragma as a list of expression to a statement.

Returns
void
Parameters
st,thestatement on which we want to add a pragma
l,thelist of expression.

Make a new pragma:

Add the new pragma to the extension list:

extern string pragma_to_string(pragma);

string str = pragma_to_string (p);

if (str != string_undefined)

pips_debug (5, "pragma : %s added\n", str);

Parameters
stt

Definition at line 460 of file pragma.c.

460  {
462  /* Make a new pragma: */
464  p = make_pragma_expression(l);
466  /* Add the new pragma to the extension list: */
467  list el = extensions_extension(es);
468  el = gen_extension_cons(e, el);
469  extensions_extension(es) = el;
470  ifdebug (5) {
471  // This is debugging code. It creates a cycle between ri-util and prettyprint
472  /* extern string pragma_to_string(pragma); */
473  /* string str = pragma_to_string (p); */
474  /* if (str != string_undefined) */
475  /* pips_debug (5, "pragma : %s added\n", str); */
476  ;
477  }
478 }
list gen_extension_cons(extension p, list l)
Definition: ri.c:908
pragma make_pragma_expression(list _field_)
Definition: ri.c:1778
extension make_extension_pragma(pragma _field_)
Definition: ri.c:938
#define pragma_undefined
Definition: ri.h:1997
#define statement_extensions(x)
Definition: ri.h:2464
#define extensions_extension(x)
Definition: ri.h:1330
#define ifdebug(n)
Definition: sg.c:47
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References extensions_extension, gen_extension_cons(), ifdebug, make_extension_pragma(), make_pragma_expression(), pragma_undefined, and statement_extensions.

Referenced by merge_on_outer(), omp_pragma_expr_for(), and omp_pragma_expr_for_reduction().

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

◆ add_pragma_str_to_statement()

void add_pragma_str_to_statement ( statement  st,
const char *  s,
bool  copy_flag 
)

Add a string as a pragma to a statement.

Returns
void
Parameters
st,thestatement on which we want to add a pragma
s,thepragma string.
copy_flag,tobe set to true to duplicate the string

Duplicate string if requested

dangerous !

Make a new pragma

Will be save as an extension attached to the statement's extension list

Parameters
stt
copy_flagopy_flag

Definition at line 425 of file pragma.c.

425  {
426  /* Duplicate string if requested */
427  string ps = copy_flag ? strdup(s) : (char*)s /* dangerous !*/;
428 
429  /* Make a new pragma */
430  pragma p = make_pragma_string(ps);
431 
432  /* Will be save as an extension attached to
433  * the statement's extension list
434  */
437  list el = extensions_extension(es);
438  el = gen_extension_cons(e, el);
439  extensions_extension(es) = el;
440 }
pragma make_pragma_string(string _field_)
Definition: ri.c:1775
char * strdup()

References extensions_extension, gen_extension_cons(), make_extension_pragma(), make_pragma_string(), statement_extensions, and strdup().

Referenced by add_pragma(), add_pragma_strings_to_statement(), add_pragma_to_sequence(), add_shutdown_pragma_to_return(), add_to_stmt(), compile_omp(), do_computation_intensity(), do_loop_expansion_init(), gen_omp_parallel(), gen_omp_taskwait(), gen_synchronization(), get_statement_pragma_init(), get_statement_pragma_register(), get_statement_pragma_shutdown(), insert_endscop_after_stmt(), insert_endscop_before_stmt(), insert_endscop_in_sequence(), insert_optional_pragma(), new_step_directive(), and normalize_microcode_anotate().

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

◆ add_pragma_strings_to_statement()

void add_pragma_strings_to_statement ( statement  st,
list  l,
bool  copy_flag 
)

Add a list of strings as as many pragmas to a statement.

Parameters
st,thestatement on which we want to add a pragma
l,alist of pragma string(s)
copy_flag,tobe set to true to duplicate the string
Parameters
stt
copy_flagopy_flag

Definition at line 448 of file pragma.c.

448  {
449  FOREACH(STRING, p, l)
450  add_pragma_str_to_statement(st, p, copy_flag);
451 }
#define STRING(x)
Definition: genC.h:87
#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 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

References add_pragma_str_to_statement(), FOREACH, and STRING.

+ Here is the call graph for this function:

◆ filter_variables_in_pragma_expr()

list filter_variables_in_pragma_expr ( list  l_expr,
list  to_filter 
)

filter out a pragma (expression list) removing all requested variables @params l_expr is the list of expressions to filter @params to_filter is the list of entities to remove from l_pragma

ifdebug(5) {

pips_debug(5,"Handling expression : ");

print_expression(expr);

}

Parameters
l_exprof expr
to_filterof entities

Definition at line 256 of file pragma.c.

257  {
258 
259  // If all variable in exp are removed, we remove the expr from the list
260  list expr_to_remove = NIL;
261 
262  FOREACH (EXPRESSION, expr, l_expr) {
263  // Get the list of arguments, to filter out
264  call c = expression_call(expr);
265  list args = call_arguments (c);
266 
267  // The list where we will record arg to remove from args
268  list entity_to_remove = NIL;
269 
270  // FI: to avoid cycles between librairies ri-util and prettyprint
271  /* ifdebug(5) { */
272  /* pips_debug(5,"Handling expression : "); */
273  /* print_expression(expr); */
274  /* } */
275  if(is_expression_omp_private_p(expr)) {
276  // Handle private omp clause
277  // Lookup each requested entities
278  FOREACH(ENTITY, e, to_filter)
279  {
280  FOREACH (EXPRESSION, exp, args)
281  {
282  pips_debug(6,"Matching %s against %s\n",entity_name(e),
284  if(expression_to_entity(exp) == e) {
285  entity_to_remove = gen_expression_cons(exp, entity_to_remove);
286  break;
287  }
288  }
289  }
290  FOREACH(EXPRESSION,exp,entity_to_remove)
291  {
293  }
294  if(ENDP(call_arguments(c))) {
295  expr_to_remove = gen_expression_cons(expr, expr_to_remove);
296  }
297  } else if(is_expression_omp_if_p(expr)) {
298  // FIXME : todo, merge with previous case ?
299  } else if(is_expression_omp_reduction_p(expr)) {
300  // FIXME : shouldn't be a problem ! (handled before)
301  } else if(is_expression_omp_omp_p(expr) || is_expression_omp_for_p(expr)
302  || is_expression_omp_parallel_p(expr)) {
303  // FIXME : is there anything to do here ?
304  } else {
305  pips_debug(0,"Unsupported case : ");
306  // FI: to avoid cycles between librairies ri-util and prettyprint
307  // print_expression(expr);
308  pips_internal_error("We don't know how to handle this omp clause !");
309  }
310  }
311  //Remove expression that are now empty
312  FOREACH(EXPRESSION,expr,expr_to_remove) {
313  gen_remove(&l_expr, expr);
314  }
315 
316  return l_expr;
317 }
list gen_expression_cons(expression p, list l)
Definition: ri.c:866
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
Definition: list.c:685
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#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_internal_error
Definition: misc-local.h:149
call expression_call(expression e)
Definition: expression.c:445
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
Definition: expression.c:3140
static bool is_expression_omp_omp_p(expression exp)
Definition: pragma.c:73
static bool is_expression_omp_parallel_p(expression exp)
Definition: pragma.c:83
static bool is_expression_omp_reduction_p(expression exp)
Definition: pragma.c:68
static bool is_expression_omp_for_p(expression exp)
Definition: pragma.c:78
static bool is_expression_omp_private_p(expression exp)
Definition: pragma.c:58
static bool is_expression_omp_if_p(expression exp)
Definition: pragma.c:63
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define entity_name(x)
Definition: ri.h:2790
#define call_arguments(x)
Definition: ri.h:711
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References call_arguments, ENDP, ENTITY, entity_name, exp, EXPRESSION, expression_call(), expression_to_entity(), FOREACH, gen_expression_cons(), gen_remove(), is_expression_omp_for_p(), is_expression_omp_if_p(), is_expression_omp_omp_p(), is_expression_omp_parallel_p(), is_expression_omp_private_p(), is_expression_omp_reduction_p(), NIL, pips_debug, and pips_internal_error.

Referenced by merge_on_outer().

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

◆ get_if_clause_policy()

static if_clause_policy get_if_clause_policy ( void  )
static

Definition at line 88 of file pragma.c.

88  {
90  const char* prop = get_string_property ("OMP_IF_MERGE_POLICY");
91  if (strcmp (prop, "ignore") == 0) {
92  result = IGNORE_IF_POLICY;
93  }
94  else if (strcmp (prop, "or") == 0) {
95  result = OR_IF_POLICY;
96  }
97  else if (strcmp (prop, "and") == 0) {
98  result = AND_IF_POLICY;
99  }
100  return result;
101 }
char * get_string_property(const char *)
if_clause_policy
that is all for ri-util-local.h
@ AND_IF_POLICY
@ OR_IF_POLICY
@ IGNORE_IF_POLICY

References AND_IF_POLICY, get_string_property(), IGNORE_IF_POLICY, and OR_IF_POLICY.

Referenced by pragma_omp_merge_expr().

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

◆ is_expression_omp_for_p()

static bool is_expression_omp_for_p ( expression  exp)
static

Definition at line 78 of file pragma.c.

78  {
80  return ENTITY_OMP_FOR_P(ent);
81 }
#define ENTITY_OMP_FOR_P(e)

References ENTITY_OMP_FOR_P, exp, and expression_to_entity().

Referenced by filter_variables_in_pragma_expr(), and pragma_omp_merge_expr().

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

◆ is_expression_omp_if_p()

static bool is_expression_omp_if_p ( expression  exp)
static

Definition at line 63 of file pragma.c.

63  {
65  return (ENTITY_OMP_IF_P (ent));
66 }
#define ENTITY_OMP_IF_P(e)
OMP entity test.

References ENTITY_OMP_IF_P, exp, and expression_to_entity().

Referenced by filter_variables_in_pragma_expr(), and pragma_omp_merge_expr().

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

◆ is_expression_omp_omp_p()

static bool is_expression_omp_omp_p ( expression  exp)
static

Definition at line 73 of file pragma.c.

73  {
75  return ENTITY_OMP_OMP_P(ent);
76 }
#define ENTITY_OMP_OMP_P(e)

References ENTITY_OMP_OMP_P, exp, and expression_to_entity().

Referenced by filter_variables_in_pragma_expr(), and pragma_omp_merge_expr().

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

◆ is_expression_omp_parallel_p()

static bool is_expression_omp_parallel_p ( expression  exp)
static

Definition at line 83 of file pragma.c.

83  {
85  return ENTITY_OMP_PARALLEL_P(ent);
86 }
#define ENTITY_OMP_PARALLEL_P(e)

References ENTITY_OMP_PARALLEL_P, exp, and expression_to_entity().

Referenced by filter_variables_in_pragma_expr(), and pragma_omp_merge_expr().

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

◆ is_expression_omp_private_p()

static bool is_expression_omp_private_p ( expression  exp)
static

Definition at line 58 of file pragma.c.

58  {
60  return (ENTITY_OMP_PRIVATE_P (ent));
61 }
#define ENTITY_OMP_PRIVATE_P(e)

References ENTITY_OMP_PRIVATE_P, exp, and expression_to_entity().

Referenced by filter_variables_in_pragma_expr(), and pragma_omp_merge_expr().

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

◆ is_expression_omp_reduction_p()

static bool is_expression_omp_reduction_p ( expression  exp)
static

Definition at line 68 of file pragma.c.

68  {
70  return (ENTITY_OMP_REDUCTION_P (ent));
71 }
#define ENTITY_OMP_REDUCTION_P(e)

References ENTITY_OMP_REDUCTION_P, exp, and expression_to_entity().

Referenced by filter_variables_in_pragma_expr(), and pragma_omp_merge_expr().

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

◆ merge_conditions()

static expression merge_conditions ( list  l_cond,
if_clause_policy  policy,
language  l 
)
static

Definition at line 104 of file pragma.c.

104  {
107  switch(policy) {
108  case IGNORE_IF_POLICY:
109  break;
110  case AND_IF_POLICY:
111  // switch(get_prettyprint_language_tag()) {
112  switch(language_tag(l)) {
113  case is_language_fortran:
116  break;
117  case is_language_c:
119  break;
120  default:
121  pips_internal_error ("This case should have been handled before");
122  break;
123  }
124  break;
125  case OR_IF_POLICY:
126  //switch(get_prettyprint_language_tag()) {
127  switch(language_tag(l)) {
128  case is_language_fortran:
131  break;
132  case is_language_c:
134  break;
135  default:
136  pips_internal_error ("This case should have been handled before");
137  break;
138  }
139  break;
140  default:
141  pips_internal_error ("update switch case");
142  break;
143  }
144  // now we have a list of condition and an operator -> merge them
145  result = expressions_to_operation(l_cond, op);
146  return result;
147 }
#define C_AND_OPERATOR_NAME
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define C_OR_OPERATOR_NAME
#define OR_OPERATOR_NAME
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
Definition: entity.c:1311
expression expressions_to_operation(const list l_exprs, entity op)
take a list of expression and apply a binary operator between all of them and return it as an express...
Definition: expression.c:3544
#define entity_undefined
Definition: ri.h:2761
#define expression_undefined
Definition: ri.h:1223
#define language_tag(x)
Definition: ri.h:1590
@ is_language_fortran
Definition: ri.h:1566
@ is_language_fortran95
Definition: ri.h:1568
@ is_language_c
Definition: ri.h:1567

References AND_IF_POLICY, AND_OPERATOR_NAME, C_AND_OPERATOR_NAME, C_OR_OPERATOR_NAME, CreateIntrinsic(), entity_undefined, expression_undefined, expressions_to_operation(), IGNORE_IF_POLICY, is_language_c, is_language_fortran, is_language_fortran95, language_tag, OR_IF_POLICY, OR_OPERATOR_NAME, and pips_internal_error.

Referenced by pragma_omp_merge_expr().

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

◆ pragma_build_if_condition()

expression pragma_build_if_condition ( expression  cond,
language  l 
)

build the expression to be put in the if clause.

This functions takes care of the output language.

Returns
the condition compared to the threshold as an expression
Parameters
cond,thecondition to be compared to the threshold
Parameters
condond

Definition at line 159 of file pragma.c.

159  {
161  //switch(get_prettyprint_language_tag()) {
162  switch(language_tag(l)) {
163  case is_language_fortran:
166  break;
167  case is_language_c:
169  break;
170  default:
171  pips_internal_error ("This case should have been handled before" );
172  break;
173  }
174  int threshold = get_int_property("OMP_LOOP_PARALLEL_THRESHOLD_VALUE");
175  list args_if = gen_expression_cons(int_to_expression(threshold), NIL);
176  args_if = gen_expression_cons(cond, args_if);
177  call c = make_call(op, args_if);
178  return call_to_expression(c);
179 }
int get_int_property(const string)
call make_call(entity a1, list a2)
Definition: ri.c:269
#define C_GREATER_OR_EQUAL_OPERATOR_NAME
#define GREATER_OR_EQUAL_OPERATOR_NAME
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
expression call_to_expression(call c)
Build an expression that call a function or procedure.
Definition: expression.c:309

References C_GREATER_OR_EQUAL_OPERATOR_NAME, call_to_expression(), CreateIntrinsic(), entity_undefined, gen_expression_cons(), get_int_property(), GREATER_OR_EQUAL_OPERATOR_NAME, int_to_expression(), is_language_c, is_language_fortran, is_language_fortran95, language_tag, make_call(), NIL, and pips_internal_error.

Referenced by add_loop_parallel_threshold().

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

◆ pragma_if_as_expr()

expression pragma_if_as_expr ( expression  arg)
Returns
"if (cond)" as an expression
Parameters
arg,thecondition to be evaluted by the if clause
Parameters
argrg

Definition at line 184 of file pragma.c.

184  {
186  list args_expr = gen_expression_cons (arg, NIL);
187  call c = make_call (omp, args_expr);
188  // syntax s = make_syntax_call (c);
189  expression expr_if = call_to_expression (c);// make_expression (s, normalized_undefined);
190  return expr_if;
191 }
#define OMP_IF_FUNCTION_NAME
OMP related function and opertor names.

References call_to_expression(), CreateIntrinsic(), gen_expression_cons(), make_call(), NIL, and OMP_IF_FUNCTION_NAME.

Referenced by add_loop_parallel_threshold(), and pragma_omp_merge_expr().

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

◆ pragma_omp_merge_expr()

list pragma_omp_merge_expr ( list  outer_extensions,
list  l_pragma,
language  l 
)

merge omp pragma.

Returns
the merged pragma as a list of expression
Parameters
l_pragma,thelist of pragma to merge. The pragma as to be a list of expression ordered. The pragma list has to be ordered from the outer pragma to the inner pragma as in the original loop nest.
Parameters
outer_extensionsuter_extensions
l_pragma_pragma

Definition at line 326 of file pragma.c.

326  {
327  // The "omp parallel for" as a list of expression
329  // The list of the variables of the private clauses
330  list priv_var = NIL;
331  // The list of condition of the if clauses
332  list if_cond = NIL;
333  // The list of reductions
334  list red = NIL;
335  // Get the if clause policy
337  // the outer pragmas
338  set outer_pragmas = set_make(set_pointer);
339  FOREACH(EXTENSION,ex, outer_extensions) {
340  pragma p = extension_pragma(ex);
341  if(pragma_expression_p(p)) {
343  set_add_element(outer_pragmas,outer_pragmas,e);
344  }
345  }
346 
347  // look into each pragma for private, reduction and if clauses
348  FOREACH (PRAGMA, p, l_pragma) {
349  pips_assert ("Can only merge a list of pragma as expression",
350  pragma_expression_p (p));
352  // check each expression and save what need to be saved to generate
353  // the new omp pragma
354  call c = expression_call(e);
355  list args = call_arguments (c);
356  // bind the args to the right list
358  // each private var has to be uniquely declared
359  list add = NIL;
360  FOREACH (EXPRESSION, exp, args) {
361  if(!expression_equal_in_list_p(exp, priv_var) )
362  add = gen_expression_cons(exp, add);
363  }
364  priv_var = gen_nconc(priv_var, add);
365  } else if(is_expression_omp_if_p(e)) {
366  // if clause : check the policy
367  switch(policy) {
368  case IGNORE_IF_POLICY:
369  // do nothing
370  break;
371  case AND_IF_POLICY:
372  case OR_IF_POLICY:
373  if_cond = gen_nconc(if_cond, args);
374  break;
375  default:
376  pips_internal_error ("Should not happen");
377  break;
378  }
379  } else if(is_expression_omp_reduction_p(e)) {
380  // only reductions on outer statement are kept
381  if(set_belong_p(outer_pragmas,e) ) {
382  red = gen_expression_cons(e, red);
383  }
386  // nothing to do the omp parallel for will be automaticly generated
387  } else {
388  // FI: to avoid cycles between librairies ri-util and prettyprint
389  // print_expression(e);
390  pips_internal_error("pips cannot merge this pragma clause");
391  }
392  }
393  }
394  set_free(outer_pragmas);
395  // build the private clause if needed
396  if(priv_var != NIL) {
398  // append the private clause to the omp parallel for
399  result = gen_expression_cons(priv, result);
400  }
401  // append the reduction clauses if any
402  if(red != NIL) {
403  result = gen_nconc(red, result);
404  }
405  // merge the if condition if needed
406  if(policy != IGNORE_IF_POLICY) {
407  expression expr_if = merge_conditions(if_cond, policy, l);
408  // encapsulate the condition into the if clause
409  expr_if = pragma_if_as_expr(expr_if);
410  // append the if clause to the omp parallel for
411  result = gen_expression_cons(expr_if, result);
412  }
413  return result;
414 }
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
void set_free(set)
Definition: set.c:332
bool set_belong_p(const set, const void *)
Definition: set.c:194
@ set_pointer
Definition: newgen_set.h:44
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
set set_add_element(set, const set, const void *)
Definition: set.c:152
bool expression_equal_in_list_p(expression e, list le)
This function returns true, if there exists an expression equal in the list false,...
Definition: expression.c:566
static expression merge_conditions(list l_cond, if_clause_policy policy, language l)
Definition: pragma.c:104
expression pragma_if_as_expr(expression arg)
Definition: pragma.c:184
list pragma_omp_parallel_for_as_exprs(void)
Definition: pragma.c:236
static if_clause_policy get_if_clause_policy(void)
Definition: pragma.c:88
expression pragma_private_as_expr_with_args(list args_expr)
Definition: pragma.c:196
#define PRAGMA(x)
PRAGMA.
Definition: ri.h:1991
#define pragma_expression_p(x)
Definition: ri.h:2034
#define extension_pragma(x)
Definition: ri.h:1295
#define EXTENSION(x)
EXTENSION.
Definition: ri.h:1253
#define pragma_expression(x)
Definition: ri.h:2036
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59

References AND_IF_POLICY, call_arguments, exp, EXPRESSION, expression_call(), expression_equal_in_list_p(), EXTENSION, extension_pragma, FOREACH, gen_expression_cons(), gen_nconc(), get_if_clause_policy(), IGNORE_IF_POLICY, is_expression_omp_for_p(), is_expression_omp_if_p(), is_expression_omp_omp_p(), is_expression_omp_parallel_p(), is_expression_omp_private_p(), is_expression_omp_reduction_p(), merge_conditions(), NIL, OR_IF_POLICY, pips_assert, pips_internal_error, PRAGMA, pragma_expression, pragma_expression_p, pragma_if_as_expr(), pragma_omp_parallel_for_as_exprs(), pragma_private_as_expr_with_args(), set_add_element(), set_belong_p(), set_free(), set_make(), and set_pointer.

Referenced by merge_on_outer().

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

◆ pragma_omp_parallel_as_exprs()

list pragma_omp_parallel_as_exprs ( void  )
Returns
"omp parallel" as a list of expression

Definition at line 215 of file pragma.c.

215  {
216  // first prepare "omp" as an expression
218  call c = make_call (omp, NULL);
219  syntax s = make_syntax_call (c);
221 
222  //secondly prepare "parallel" as an expression
224  c = make_call (parallel, NULL);
225  s = make_syntax_call (c);
226  expression expr_parallel = make_expression (s, normalized_undefined);
227 
228  // build the list of expression
229  list result = CONS(EXPRESSION, expr_omp, NIL);
230  result = gen_expression_cons (expr_parallel, result);
231  return result;
232 }
syntax make_syntax_call(call _field_)
Definition: ri.c:2500
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#define OMP_OMP_FUNCTION_NAME
#define OMP_PARALLEL_FUNCTION_NAME
#define normalized_undefined
Definition: ri.h:1745

References CONS, CreateIntrinsic(), EXPRESSION, gen_expression_cons(), make_call(), make_expression(), make_syntax_call(), NIL, normalized_undefined, OMP_OMP_FUNCTION_NAME, and OMP_PARALLEL_FUNCTION_NAME.

Referenced by pragma_omp_parallel_for_as_exprs().

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

◆ pragma_omp_parallel_for_as_exprs()

list pragma_omp_parallel_for_as_exprs ( void  )
Returns
"omp parallel for" as an expression

Definition at line 236 of file pragma.c.

236  {
237  // first prepare "for" as an expression
239  call c = make_call (e, NULL);
240  syntax s = make_syntax_call (c);
242 
243  //secondly get "omp parallel as an expr and concat
245  result = gen_expression_cons (expr_for, result);
246 
247  return result;
248 }
#define OMP_FOR_FUNCTION_NAME
list pragma_omp_parallel_as_exprs(void)
Definition: pragma.c:215

References CreateIntrinsic(), gen_expression_cons(), make_call(), make_expression(), make_syntax_call(), normalized_undefined, OMP_FOR_FUNCTION_NAME, and pragma_omp_parallel_as_exprs().

Referenced by omp_pragma_expr_for(), pragma_omp_merge_expr(), and reductions_get_omp_pragma_expr().

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

◆ pragma_private_as_expr()

expression pragma_private_as_expr ( list  args_ent)
Returns
"private (x,y)" as an expression
Parameters
arg,theprivate variables as a list of entities
Parameters
args_entrgs_ent

Definition at line 207 of file pragma.c.

207  {
208  // build the privates variable as a list of expression
209  list args_expr = entities_to_expressions (args_ent);
210  return pragma_private_as_expr_with_args (args_expr);
211 }
list entities_to_expressions(list l_ent)
build a list of expressions from a list of entities
Definition: entity.c:2703

References entities_to_expressions(), and pragma_private_as_expr_with_args().

Referenced by omp_append_private_clause().

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

◆ pragma_private_as_expr_with_args()

expression pragma_private_as_expr_with_args ( list  args_expr)
Returns
"private (x,y)" as an expression
Parameters
args_expr,theprivate variables as a list of expression
Parameters
args_exprrgs_expr

Definition at line 196 of file pragma.c.

196  {
198  call c = make_call (omp, args_expr);
199  syntax s = make_syntax_call (c);
201  return expr_omp;
202 }
#define OMP_PRIVATE_FUNCTION_NAME

References CreateIntrinsic(), make_call(), make_expression(), make_syntax_call(), normalized_undefined, and OMP_PRIVATE_FUNCTION_NAME.

Referenced by pragma_omp_merge_expr(), and pragma_private_as_expr().

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

Variable Documentation

◆ FORTRAN_OMP_CONTINUATION

const string FORTRAN_OMP_CONTINUATION = FORTRAN_OMP_CONTINUATION_STRING

Definition at line 52 of file pragma.c.

◆ FORTRAN_PRAGMA_HEADER

const string FORTRAN_PRAGMA_HEADER = FORTRAN_PRAGMA_HEADER_STRING

pragma.c

Definition at line 51 of file pragma.c.