#ifndef OPENMP_MAP_MODIFIER_KIND
#define OPENMP_MAP_MODIFIER_KIND(Name)
#endif
-#ifndef OPENMP_TO_MODIFIER_KIND
-#define OPENMP_TO_MODIFIER_KIND(Name)
-#endif
-#ifndef OPENMP_FROM_MODIFIER_KIND
-#define OPENMP_FROM_MODIFIER_KIND(Name)
+#ifndef OPENMP_MOTION_MODIFIER_KIND
+#define OPENMP_MOTION_MODIFIER_KIND(Name)
#endif
#ifndef OPENMP_DIST_SCHEDULE_KIND
#define OPENMP_DIST_SCHEDULE_KIND(Name)
OPENMP_MAP_MODIFIER_KIND(mapper)
OPENMP_MAP_MODIFIER_KIND(present)
-// Modifiers for 'to' clause.
-OPENMP_TO_MODIFIER_KIND(mapper)
-
-// Modifiers for 'from' clause.
-OPENMP_FROM_MODIFIER_KIND(mapper)
+// Modifiers for 'to' or 'from' clause.
+OPENMP_MOTION_MODIFIER_KIND(mapper)
// Static attributes for 'dist_schedule' clause.
OPENMP_DIST_SCHEDULE_KIND(static)
#undef OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND
#undef OPENMP_MAP_KIND
#undef OPENMP_MAP_MODIFIER_KIND
-#undef OPENMP_TO_MODIFIER_KIND
-#undef OPENMP_FROM_MODIFIER_KIND
+#undef OPENMP_MOTION_MODIFIER_KIND
#undef OPENMP_DIST_SCHEDULE_KIND
#undef OPENMP_DEFAULTMAP_KIND
#undef OPENMP_DEFAULTMAP_MODIFIER
static constexpr unsigned NumberOfOMPMapClauseModifiers =
OMPC_MAP_MODIFIER_last - OMPC_MAP_MODIFIER_unknown - 1;
-/// OpenMP modifier kind for 'to' clause.
-enum OpenMPToModifierKind {
-#define OPENMP_TO_MODIFIER_KIND(Name) \
- OMPC_TO_MODIFIER_##Name,
+/// OpenMP modifier kind for 'to' or 'from' clause.
+enum OpenMPMotionModifierKind {
+#define OPENMP_MOTION_MODIFIER_KIND(Name) \
+ OMPC_MOTION_MODIFIER_##Name,
#include "clang/Basic/OpenMPKinds.def"
- OMPC_TO_MODIFIER_unknown
-};
-
-/// OpenMP modifier kind for 'from' clause.
-enum OpenMPFromModifierKind {
-#define OPENMP_FROM_MODIFIER_KIND(Name) \
- OMPC_FROM_MODIFIER_##Name,
-#include "clang/Basic/OpenMPKinds.def"
- OMPC_FROM_MODIFIER_unknown
+ OMPC_MOTION_MODIFIER_unknown
};
/// OpenMP attributes for 'dist_schedule' clause.
return Type;
}
case OMPC_to:
- return llvm::StringSwitch<unsigned>(Str)
-#define OPENMP_TO_MODIFIER_KIND(Name) \
- .Case(#Name, static_cast<unsigned>(OMPC_TO_MODIFIER_##Name))
-#include "clang/Basic/OpenMPKinds.def"
- .Default(OMPC_TO_MODIFIER_unknown);
case OMPC_from:
return llvm::StringSwitch<unsigned>(Str)
-#define OPENMP_FROM_MODIFIER_KIND(Name) \
- .Case(#Name, static_cast<unsigned>(OMPC_FROM_MODIFIER_##Name))
+#define OPENMP_MOTION_MODIFIER_KIND(Name) \
+ .Case(#Name, static_cast<unsigned>(OMPC_MOTION_MODIFIER_##Name))
#include "clang/Basic/OpenMPKinds.def"
- .Default(OMPC_FROM_MODIFIER_unknown);
+ .Default(OMPC_MOTION_MODIFIER_unknown);
case OMPC_dist_schedule:
return llvm::StringSwitch<OpenMPDistScheduleClauseKind>(Str)
#define OPENMP_DIST_SCHEDULE_KIND(Name) .Case(#Name, OMPC_DIST_SCHEDULE_##Name)
}
llvm_unreachable("Invalid OpenMP 'map' clause type");
case OMPC_to:
- switch (Type) {
- case OMPC_TO_MODIFIER_unknown:
- return "unknown";
-#define OPENMP_TO_MODIFIER_KIND(Name) \
- case OMPC_TO_MODIFIER_##Name: \
- return #Name;
-#include "clang/Basic/OpenMPKinds.def"
- default:
- break;
- }
- llvm_unreachable("Invalid OpenMP 'to' clause type");
case OMPC_from:
switch (Type) {
- case OMPC_FROM_MODIFIER_unknown:
+ case OMPC_MOTION_MODIFIER_unknown:
return "unknown";
-#define OPENMP_FROM_MODIFIER_KIND(Name) \
- case OMPC_FROM_MODIFIER_##Name: \
+#define OPENMP_MOTION_MODIFIER_KIND(Name) \
+ case OMPC_MOTION_MODIFIER_##Name: \
return #Name;
#include "clang/Basic/OpenMPKinds.def"
default:
break;
}
- llvm_unreachable("Invalid OpenMP 'from' clause type");
+ llvm_unreachable("Invalid OpenMP 'to' or 'from' clause type");
case OMPC_dist_schedule:
switch (Type) {
case OMPC_DIST_SCHEDULE_unknown:
Data.ColonLoc = ConsumeToken();
} else if (Kind == OMPC_to || Kind == OMPC_from) {
if (Tok.is(tok::identifier)) {
- bool IsMapperModifier = false;
- if (Kind == OMPC_to) {
- auto Modifier =
- static_cast<OpenMPToModifierKind>(getOpenMPSimpleClauseType(
- Kind, PP.getSpelling(Tok), getLangOpts().OpenMP));
- if (Modifier == OMPC_TO_MODIFIER_mapper)
- IsMapperModifier = true;
- } else {
- auto Modifier =
- static_cast<OpenMPFromModifierKind>(getOpenMPSimpleClauseType(
- Kind, PP.getSpelling(Tok), getLangOpts().OpenMP));
- if (Modifier == OMPC_FROM_MODIFIER_mapper)
- IsMapperModifier = true;
- }
- if (IsMapperModifier) {
+ auto Modifier =
+ static_cast<OpenMPMotionModifierKind>(getOpenMPSimpleClauseType(
+ Kind, PP.getSpelling(Tok), getLangOpts().OpenMP));
+ if (Modifier == OMPC_MOTION_MODIFIER_mapper) {
// Parse the mapper modifier.
ConsumeToken();
IsInvalidMapperModifier = parseMapperModifier(Data);