1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Revert "[OpenMP][NFCI] Move OpenMP clause information to lib/Frontend/OpenMP"

This reverts commit c18d55998b3352e6ec92ccb8a3240a16a57c61e6.

Bots have reported uses that need changing, e.g.,
  clang-tools-extra/clang-tidy/openmp/UseDefaultNoneCheck.cp
as reported by
  http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/46591
This commit is contained in:
Johannes Doerfert 2020-04-02 02:23:22 -05:00
parent 8ad3628b29
commit c69e880f40
3 changed files with 2 additions and 146 deletions

View File

@ -34,18 +34,11 @@ enum class Directive {
#include "llvm/Frontend/OpenMP/OMPKinds.def"
};
/// IDs for all OpenMP clauses.
enum class Clause {
#define OMP_CLAUSE(Enum, ...) Enum,
#include "llvm/Frontend/OpenMP/OMPKinds.def"
};
/// Make the enum values available in the llvm::omp namespace. This allows us to
/// write something like OMPD_parallel if we have a `using namespace omp`. At
/// the same time we do not loose the strong type guarantees of the enum class,
/// that is we cannot pass an unsigned as Directive without an explicit cast.
#define OMP_DIRECTIVE(Enum, ...) constexpr auto Enum = omp::Directive::Enum;
#define OMP_CLAUSE(Enum, ...) constexpr auto Enum = omp::Clause::Enum;
#include "llvm/Frontend/OpenMP/OMPKinds.def"
/// IDs for all omp runtime library (RTL) functions.
@ -94,12 +87,6 @@ Directive getOpenMPDirectiveKind(StringRef Str);
/// Return a textual representation of the directive \p D.
StringRef getOpenMPDirectiveName(Directive D);
/// Parse \p Str and return the clause it matches or OMPC_unknown if none.
Clause getOpenMPClauseKind(StringRef Str);
/// Return a textual representation of the clause \p C.
StringRef getOpenMPClauseName(Clause C);
/// Forward declarations for LLVM-IR types (simple, function and structure) are
/// generated below. Their names are defined and used in OpenMP/OMPKinds.def.
/// Here we provide the forward declarations, the initializeTypes function will

View File

@ -105,117 +105,6 @@ __OMP_DIRECTIVE(unknown)
///}
/// OpenMP Clauses
///
///{
#ifndef OMP_CLAUSE
#define OMP_CLAUSE(Enum, Str, Implicit)
#endif
#ifndef OMP_CLAUSE_CLASS
#define OMP_CLAUSE_CLASS(Enum, Str, Class)
#endif
#ifndef OMP_CLAUSE_NO_CLASS
#define OMP_CLAUSE_NO_CLASS(Enum, Str)
#endif
#define __OMP_CLAUSE(Name, Class) \
OMP_CLAUSE(OMPC_##Name, #Name, /* Implicit */ false) \
OMP_CLAUSE_CLASS(OMPC_##Name, #Name, Class)
#define __OMP_CLAUSE_NO_CLASS(Name) \
OMP_CLAUSE(OMPC_##Name, #Name, /* Implicit */ false) \
OMP_CLAUSE_NO_CLASS(OMPC_##Name, #Name)
#define __OMP_IMPLICIT_CLAUSE_CLASS(Name, Str, Class) \
OMP_CLAUSE(OMPC_##Name, Str, /* Implicit */ true) \
OMP_CLAUSE_CLASS(OMPC_##Name, Str, Class)
#define __OMP_IMPLICIT_CLAUSE_NO_CLASS(Name, Str) \
OMP_CLAUSE(OMPC_##Name, Str, /* Implicit */ true) \
OMP_CLAUSE_NO_CLASS(OMPC_##Name, Str)
__OMP_CLAUSE(allocator, OMPAllocatorClause)
__OMP_CLAUSE(if, OMPIfClause)
__OMP_CLAUSE(final, OMPFinalClause)
__OMP_CLAUSE(num_threads, OMPNumThreadsClause)
__OMP_CLAUSE(safelen, OMPSafelenClause)
__OMP_CLAUSE(simdlen, OMPSimdlenClause)
__OMP_CLAUSE(collapse, OMPCollapseClause)
__OMP_CLAUSE(default, OMPDefaultClause)
__OMP_CLAUSE(private, OMPPrivateClause)
__OMP_CLAUSE(firstprivate, OMPFirstprivateClause)
__OMP_CLAUSE(lastprivate, OMPLastprivateClause)
__OMP_CLAUSE(shared, OMPSharedClause)
__OMP_CLAUSE(reduction, OMPReductionClause)
__OMP_CLAUSE(linear, OMPLinearClause)
__OMP_CLAUSE(aligned, OMPAlignedClause)
__OMP_CLAUSE(copyin, OMPCopyinClause)
__OMP_CLAUSE(copyprivate, OMPCopyprivateClause)
__OMP_CLAUSE(proc_bind, OMPProcBindClause)
__OMP_CLAUSE(schedule, OMPScheduleClause)
__OMP_CLAUSE(ordered, OMPOrderedClause)
__OMP_CLAUSE(nowait, OMPNowaitClause)
__OMP_CLAUSE(untied, OMPUntiedClause)
__OMP_CLAUSE(mergeable, OMPMergeableClause)
__OMP_CLAUSE(read, OMPReadClause)
__OMP_CLAUSE(write, OMPWriteClause)
__OMP_CLAUSE(update, OMPUpdateClause)
__OMP_CLAUSE(capture, OMPCaptureClause)
__OMP_CLAUSE(seq_cst, OMPSeqCstClause)
__OMP_CLAUSE(acq_rel, OMPAcqRelClause)
__OMP_CLAUSE(acquire, OMPAcquireClause)
__OMP_CLAUSE(release, OMPReleaseClause)
__OMP_CLAUSE(relaxed, OMPRelaxedClause)
__OMP_CLAUSE(depend, OMPDependClause)
__OMP_CLAUSE(device, OMPDeviceClause)
__OMP_CLAUSE(threads, OMPThreadsClause)
__OMP_CLAUSE(simd, OMPSIMDClause)
__OMP_CLAUSE(map, OMPMapClause)
__OMP_CLAUSE(num_teams, OMPNumTeamsClause)
__OMP_CLAUSE(thread_limit, OMPThreadLimitClause)
__OMP_CLAUSE(priority, OMPPriorityClause)
__OMP_CLAUSE(grainsize, OMPGrainsizeClause)
__OMP_CLAUSE(nogroup, OMPNogroupClause)
__OMP_CLAUSE(num_tasks, OMPNumTasksClause)
__OMP_CLAUSE(hint, OMPHintClause)
__OMP_CLAUSE(dist_schedule, OMPDistScheduleClause)
__OMP_CLAUSE(defaultmap, OMPDefaultmapClause)
__OMP_CLAUSE(to, OMPToClause)
__OMP_CLAUSE(from, OMPFromClause)
__OMP_CLAUSE(use_device_ptr, OMPUseDevicePtrClause)
__OMP_CLAUSE(is_device_ptr, OMPIsDevicePtrClause)
__OMP_CLAUSE(task_reduction, OMPTaskReductionClause)
__OMP_CLAUSE(in_reduction, OMPInReductionClause)
__OMP_CLAUSE(unified_address, OMPUnifiedAddressClause)
__OMP_CLAUSE(unified_shared_memory, OMPUnifiedSharedMemoryClause)
__OMP_CLAUSE(reverse_offload, OMPReverseOffloadClause)
__OMP_CLAUSE(dynamic_allocators, OMPDynamicAllocatorsClause)
__OMP_CLAUSE(atomic_default_mem_order, OMPAtomicDefaultMemOrderClause)
__OMP_CLAUSE(allocate, OMPAllocateClause)
__OMP_CLAUSE(nontemporal, OMPNontemporalClause)
__OMP_CLAUSE(order, OMPOrderClause)
__OMP_CLAUSE(destroy, OMPDestroyClause)
__OMP_CLAUSE(detach, OMPDetachClause)
__OMP_CLAUSE(inclusive, OMPInclusiveClause)
__OMP_CLAUSE(exclusive, OMPExclusiveClause)
__OMP_CLAUSE_NO_CLASS(uniform)
__OMP_CLAUSE_NO_CLASS(device_type)
__OMP_CLAUSE_NO_CLASS(match)
__OMP_IMPLICIT_CLAUSE_CLASS(depobj, "depobj", OMPDepobjClause)
__OMP_IMPLICIT_CLAUSE_CLASS(flush, "flush", OMPFlushClause)
__OMP_IMPLICIT_CLAUSE_NO_CLASS(threadprivate, "threadprivate or thread local")
__OMP_IMPLICIT_CLAUSE_NO_CLASS(unknown, "unknown")
#undef __OMP_IMPLICIT_CLAUSE_NO_CLASS
#undef __OMP_IMPLICIT_CLAUSE_CLASS
#undef __OMP_CLAUSE
#undef OMP_CLAUSE_NO_CLASS
#undef OMP_CLAUSE_CLASS
#undef OMP_CLAUSE
///}
/// Types used in runtime structs or runtime functions
///
///{
@ -343,10 +232,8 @@ __OMP_RTL(omp_set_max_active_levels, false, Void, Int32)
__OMP_RTL(__kmpc_master, false, Int32, IdentPtr, Int32)
__OMP_RTL(__kmpc_end_master, false, Void, IdentPtr, Int32)
__OMP_RTL(__kmpc_critical, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy)
__OMP_RTL(__kmpc_critical_with_hint, false, Void, IdentPtr, Int32,
KmpCriticalNamePtrTy, Int32)
__OMP_RTL(__kmpc_end_critical, false, Void, IdentPtr, Int32,
KmpCriticalNamePtrTy)
__OMP_RTL(__kmpc_critical_with_hint, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy, Int32)
__OMP_RTL(__kmpc_end_critical, false, Void, IdentPtr, Int32, KmpCriticalNamePtrTy)
__OMP_RTL(__last, false, Void, )

View File

@ -36,24 +36,6 @@ StringRef llvm::omp::getOpenMPDirectiveName(Directive Kind) {
llvm_unreachable("Invalid OpenMP directive kind");
}
Clause llvm::omp::getOpenMPClauseKind(StringRef Str) {
return llvm::StringSwitch<Clause>(Str)
#define OMP_CLAUSE(Enum, Str, Implicit) \
.Case(Str, Implicit ? OMPC_unknown : Enum)
#include "llvm/Frontend/OpenMP/OMPKinds.def"
.Default(OMPC_unknown);
}
StringRef llvm::omp::getOpenMPClauseName(Clause C) {
switch (C) {
#define OMP_CLAUSE(Enum, Str, ...) \
case Enum: \
return Str;
#include "llvm/Frontend/OpenMP/OMPKinds.def"
}
llvm_unreachable("Invalid OpenMP clause kind");
}
/// Declarations for LLVM-IR types (simple, array, function and structure) are
/// generated below. Their names are defined and used in OpenMPKinds.def. Here
/// we provide the declarations, the initializeTypes function will provide the