extern enum omp_clause_defaultmap_kind c_omp_predetermined_mapping (tree);
extern tree c_omp_check_context_selector (location_t, tree);
extern void c_omp_mark_declare_variant (location_t, tree, tree);
-extern const char *c_omp_map_clause_name (tree, bool);
extern void c_omp_adjust_map_clauses (tree, bool);
enum c_omp_directive_kind {
}
-/* For OpenACC, the OMP_CLAUSE_MAP_KIND of an OMP_CLAUSE_MAP is used internally
- to distinguish clauses as seen by the user. Return the "friendly" clause
- name for error messages etc., where possible. See also
- c/c-parser.cc:c_parser_oacc_data_clause and
- cp/parser.cc:cp_parser_oacc_data_clause. */
-
-const char *
-c_omp_map_clause_name (tree clause, bool oacc)
-{
- if (oacc && OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP)
- switch (OMP_CLAUSE_MAP_KIND (clause))
- {
- case GOMP_MAP_FORCE_ALLOC:
- case GOMP_MAP_ALLOC: return "create";
- case GOMP_MAP_FORCE_TO:
- case GOMP_MAP_TO: return "copyin";
- case GOMP_MAP_FORCE_FROM:
- case GOMP_MAP_FROM: return "copyout";
- case GOMP_MAP_FORCE_TOFROM:
- case GOMP_MAP_TOFROM: return "copy";
- case GOMP_MAP_RELEASE: return "delete";
- case GOMP_MAP_FORCE_PRESENT: return "present";
- case GOMP_MAP_ATTACH: return "attach";
- case GOMP_MAP_FORCE_DETACH:
- case GOMP_MAP_DETACH: return "detach";
- case GOMP_MAP_DEVICE_RESIDENT: return "device_resident";
- case GOMP_MAP_LINK: return "link";
- case GOMP_MAP_FORCE_DEVICEPTR: return "deviceptr";
- default: break;
- }
- return omp_clause_code_name[OMP_CLAUSE_CODE (clause)];
-}
-
/* Used to merge map clause information in c_omp_adjust_map_clauses. */
struct map_clause
{
{
error_at (OMP_CLAUSE_LOCATION (c),
"expected single pointer in %qs clause",
- c_omp_map_clause_name (c, ort == C_ORT_ACC));
+ user_omp_clause_code_name (c, ort == C_ORT_ACC));
return error_mark_node;
}
}
if (TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
{
error_at (OMP_CLAUSE_LOCATION (c), "expected pointer in %qs clause",
- c_omp_map_clause_name (c, true));
+ user_omp_clause_code_name (c, true));
return true;
}
}
{
error_at (OMP_CLAUSE_LOCATION (c),
"expected single pointer in %qs clause",
- c_omp_map_clause_name (c, ort == C_ORT_ACC));
+ user_omp_clause_code_name (c, ort == C_ORT_ACC));
return error_mark_node;
}
}
if (TREE_CODE (type) != POINTER_TYPE)
{
error_at (OMP_CLAUSE_LOCATION (c), "expected pointer in %qs clause",
- c_omp_map_clause_name (c, true));
+ user_omp_clause_code_name (c, true));
return true;
}
}
/* Number of operands and names for each OMP_CLAUSE node. */
extern unsigned const char omp_clause_num_ops[];
extern const char * const omp_clause_code_name[];
+extern const char *user_omp_clause_code_name (tree, bool);
/* A vector of all translation-units. */
extern GTY (()) vec<tree, va_gc> *all_translation_units;
#include "gimple-fold.h"
#include "escaped_string.h"
#include "gimple-range.h"
+#include "gomp-constants.h"
/* Tree code classes. */
"nohost",
};
+/* Unless specific to OpenACC, we tend to internally maintain OpenMP-centric
+ clause names, but for use in diagnostics etc. would like to use the "user"
+ clause names. */
+
+const char *
+user_omp_clause_code_name (tree clause, bool oacc)
+{
+ /* For OpenACC, the 'OMP_CLAUSE_MAP_KIND' of an 'OMP_CLAUSE_MAP' is used to
+ distinguish clauses as seen by the user. See also where front ends do
+ 'build_omp_clause' with 'OMP_CLAUSE_MAP'. */
+ if (oacc && OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP)
+ switch (OMP_CLAUSE_MAP_KIND (clause))
+ {
+ case GOMP_MAP_FORCE_ALLOC:
+ case GOMP_MAP_ALLOC: return "create";
+ case GOMP_MAP_FORCE_TO:
+ case GOMP_MAP_TO: return "copyin";
+ case GOMP_MAP_FORCE_FROM:
+ case GOMP_MAP_FROM: return "copyout";
+ case GOMP_MAP_FORCE_TOFROM:
+ case GOMP_MAP_TOFROM: return "copy";
+ case GOMP_MAP_RELEASE: return "delete";
+ case GOMP_MAP_FORCE_PRESENT: return "present";
+ case GOMP_MAP_ATTACH: return "attach";
+ case GOMP_MAP_FORCE_DETACH:
+ case GOMP_MAP_DETACH: return "detach";
+ case GOMP_MAP_DEVICE_RESIDENT: return "device_resident";
+ case GOMP_MAP_LINK: return "link";
+ case GOMP_MAP_FORCE_DEVICEPTR: return "deviceptr";
+ default: break;
+ }
+
+ return omp_clause_code_name[OMP_CLAUSE_CODE (clause)];
+}
+
/* Return the tree node structure used by tree code CODE. */