From 1858f4b50dd35c28b377ba5dbc572fed43a5d38a Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Thu, 2 Apr 2020 02:23:22 -0500 Subject: [PATCH] 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 --- clang/include/clang/AST/ASTFwd.h | 4 +- clang/include/clang/AST/ASTTypeTraits.h | 8 +- clang/include/clang/AST/OpenMPClause.h | 566 ++++++++++----------- clang/include/clang/AST/RecursiveASTVisitor.h | 17 +- clang/include/clang/Basic/Attr.td | 7 +- clang/include/clang/Basic/OpenMPKinds.def | 68 +++ clang/include/clang/Basic/OpenMPKinds.h | 14 +- clang/lib/AST/ASTTypeTraits.cpp | 18 +- clang/lib/AST/AttrImpl.cpp | 3 +- clang/lib/AST/OpenMPClause.cpp | 12 +- clang/lib/AST/StmtProfile.cpp | 5 +- clang/lib/AST/TextNodeDumper.cpp | 5 +- clang/lib/ASTMatchers/CMakeLists.txt | 5 +- clang/lib/ASTMatchers/Dynamic/Marshallers.h | 5 +- clang/lib/Analysis/CMakeLists.txt | 1 - clang/lib/Basic/OpenMPKinds.cpp | 44 ++ clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 3 +- clang/lib/Parse/ParseOpenMP.cpp | 54 +- clang/lib/Sema/SemaOpenMP.cpp | 2 +- clang/lib/Sema/TreeTransform.h | 10 +- clang/lib/Serialization/ASTReader.cpp | 142 +++--- clang/lib/Serialization/ASTWriter.cpp | 6 +- clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt | 1 - clang/lib/StaticAnalyzer/Core/CMakeLists.txt | 5 +- clang/tools/libclang/CIndex.cpp | 4 +- .../ASTMatchers/ASTMatchersNarrowingTest.cpp | 8 +- llvm/include/llvm/Frontend/OpenMP/OMPConstants.h | 13 - llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | 117 +---- llvm/lib/Frontend/OpenMP/OMPConstants.cpp | 18 - 29 files changed, 544 insertions(+), 621 deletions(-) diff --git a/clang/include/clang/AST/ASTFwd.h b/clang/include/clang/AST/ASTFwd.h index 65319a1..5a89181 100644 --- a/clang/include/clang/AST/ASTFwd.h +++ b/clang/include/clang/AST/ASTFwd.h @@ -27,8 +27,8 @@ class Type; #include "clang/AST/TypeNodes.inc" class CXXCtorInitializer; class OMPClause; -#define OMP_CLAUSE_CLASS(Enum, Str, Class) class Class; -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(KIND, CLASSNAME) class CLASSNAME; +#include "clang/Basic/OpenMPKinds.def" } // end namespace clang diff --git a/clang/include/clang/AST/ASTTypeTraits.h b/clang/include/clang/AST/ASTTypeTraits.h index cd80e9b..a9c2e33 100644 --- a/clang/include/clang/AST/ASTTypeTraits.h +++ b/clang/include/clang/AST/ASTTypeTraits.h @@ -148,8 +148,8 @@ private: #define TYPE(DERIVED, BASE) NKI_##DERIVED##Type, #include "clang/AST/TypeNodes.inc" NKI_OMPClause, -#define OMP_CLAUSE_CLASS(Enum, Str, Class) NKI_##Class, -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(TextualSpelling, Class) NKI_##Class, +#include "clang/Basic/OpenMPKinds.def" NKI_NumberOfKinds }; @@ -204,8 +204,8 @@ KIND_TO_KIND_ID(OMPClause) #include "clang/AST/StmtNodes.inc" #define TYPE(DERIVED, BASE) KIND_TO_KIND_ID(DERIVED##Type) #include "clang/AST/TypeNodes.inc" -#define OMP_CLAUSE_CLASS(Enum, Str, Class) KIND_TO_KIND_ID(Class) -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(TextualSpelling, Class) KIND_TO_KIND_ID(Class) +#include "clang/Basic/OpenMPKinds.def" #undef KIND_TO_KIND_ID inline raw_ostream &operator<<(raw_ostream &OS, ASTNodeKind K) { diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index 7718c27..0d4b699 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -285,13 +285,12 @@ public: /// \param EndLoc Ending location of the clause. OMPAllocatorClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_allocator, StartLoc, EndLoc), - LParenLoc(LParenLoc), Allocator(A) {} + : OMPClause(OMPC_allocator, StartLoc, EndLoc), LParenLoc(LParenLoc), + Allocator(A) {} /// Build an empty clause. OMPAllocatorClause() - : OMPClause(llvm::omp::OMPC_allocator, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_allocator, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -316,7 +315,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_allocator; + return T->getClauseKind() == OMPC_allocator; } }; @@ -351,17 +350,17 @@ class OMPAllocateClause final OMPAllocateClause(SourceLocation StartLoc, SourceLocation LParenLoc, Expr *Allocator, SourceLocation ColonLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_allocate, StartLoc, - LParenLoc, EndLoc, N), + : OMPVarListClause(OMPC_allocate, StartLoc, LParenLoc, + EndLoc, N), Allocator(Allocator), ColonLoc(ColonLoc) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPAllocateClause(unsigned N) - : OMPVarListClause(llvm::omp::OMPC_allocate, + : OMPVarListClause(OMPC_allocate, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N) {} + N) {} /// Sets location of ':' symbol in clause. void setColonLoc(SourceLocation CL) { ColonLoc = CL; } @@ -413,7 +412,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_allocate; + return T->getClauseKind() == OMPC_allocate; } }; @@ -471,16 +470,15 @@ public: OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation NameModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_if, StartLoc, EndLoc), - OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Condition(Cond), - ColonLoc(ColonLoc), NameModifier(NameModifier), - NameModifierLoc(NameModifierLoc) { + : OMPClause(OMPC_if, StartLoc, EndLoc), OMPClauseWithPreInit(this), + LParenLoc(LParenLoc), Condition(Cond), ColonLoc(ColonLoc), + NameModifier(NameModifier), NameModifierLoc(NameModifierLoc) { setPreInitStmt(HelperCond, CaptureRegion); } /// Build an empty clause. OMPIfClause() - : OMPClause(llvm::omp::OMPC_if, SourceLocation(), SourceLocation()), + : OMPClause(OMPC_if, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -514,7 +512,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_if; + return T->getClauseKind() == OMPC_if; } }; @@ -550,14 +548,14 @@ public: OMPFinalClause(Expr *Cond, Stmt *HelperCond, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_final, StartLoc, EndLoc), - OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Condition(Cond) { + : OMPClause(OMPC_final, StartLoc, EndLoc), OMPClauseWithPreInit(this), + LParenLoc(LParenLoc), Condition(Cond) { setPreInitStmt(HelperCond, CaptureRegion); } /// Build an empty clause. OMPFinalClause() - : OMPClause(llvm::omp::OMPC_final, SourceLocation(), SourceLocation()), + : OMPClause(OMPC_final, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -582,7 +580,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_final; + return T->getClauseKind() == OMPC_final; } }; @@ -620,7 +618,7 @@ public: OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_num_threads, StartLoc, EndLoc), + : OMPClause(OMPC_num_threads, StartLoc, EndLoc), OMPClauseWithPreInit(this), LParenLoc(LParenLoc), NumThreads(NumThreads) { setPreInitStmt(HelperNumThreads, CaptureRegion); @@ -628,8 +626,7 @@ public: /// Build an empty clause. OMPNumThreadsClause() - : OMPClause(llvm::omp::OMPC_num_threads, SourceLocation(), - SourceLocation()), + : OMPClause(OMPC_num_threads, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -655,7 +652,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_num_threads; + return T->getClauseKind() == OMPC_num_threads; } }; @@ -691,13 +688,12 @@ public: /// \param EndLoc Ending location of the clause. OMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_safelen, StartLoc, EndLoc), - LParenLoc(LParenLoc), Safelen(Len) {} + : OMPClause(OMPC_safelen, StartLoc, EndLoc), LParenLoc(LParenLoc), + Safelen(Len) {} /// Build an empty clause. explicit OMPSafelenClause() - : OMPClause(llvm::omp::OMPC_safelen, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_safelen, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -722,7 +718,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_safelen; + return T->getClauseKind() == OMPC_safelen; } }; @@ -757,13 +753,12 @@ public: /// \param EndLoc Ending location of the clause. OMPSimdlenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_simdlen, StartLoc, EndLoc), - LParenLoc(LParenLoc), Simdlen(Len) {} + : OMPClause(OMPC_simdlen, StartLoc, EndLoc), LParenLoc(LParenLoc), + Simdlen(Len) {} /// Build an empty clause. explicit OMPSimdlenClause() - : OMPClause(llvm::omp::OMPC_simdlen, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_simdlen, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -788,7 +783,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_simdlen; + return T->getClauseKind() == OMPC_simdlen; } }; @@ -824,13 +819,12 @@ public: /// \param EndLoc Ending location of the clause. OMPCollapseClause(Expr *Num, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_collapse, StartLoc, EndLoc), - LParenLoc(LParenLoc), NumForLoops(Num) {} + : OMPClause(OMPC_collapse, StartLoc, EndLoc), LParenLoc(LParenLoc), + NumForLoops(Num) {} /// Build an empty clause. explicit OMPCollapseClause() - : OMPClause(llvm::omp::OMPC_collapse, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_collapse, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -855,7 +849,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_collapse; + return T->getClauseKind() == OMPC_collapse; } }; @@ -899,13 +893,12 @@ public: OMPDefaultClause(llvm::omp::DefaultKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_default, StartLoc, EndLoc), - LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {} + : OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc), + Kind(A), KindKwLoc(ALoc) {} /// Build an empty clause. OMPDefaultClause() - : OMPClause(llvm::omp::OMPC_default, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_default, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -935,7 +928,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_default; + return T->getClauseKind() == OMPC_default; } }; @@ -981,13 +974,12 @@ public: OMPProcBindClause(llvm::omp::ProcBindKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_proc_bind, StartLoc, EndLoc), - LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {} + : OMPClause(OMPC_proc_bind, StartLoc, EndLoc), LParenLoc(LParenLoc), + Kind(A), KindKwLoc(ALoc) {} /// Build an empty clause. OMPProcBindClause() - : OMPClause(llvm::omp::OMPC_proc_bind, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_proc_bind, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -1017,7 +1009,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_proc_bind; + return T->getClauseKind() == OMPC_proc_bind; } }; @@ -1037,12 +1029,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPUnifiedAddressClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_unified_address, StartLoc, EndLoc) {} + : OMPClause(OMPC_unified_address, StartLoc, EndLoc) {} /// Build an empty clause. OMPUnifiedAddressClause() - : OMPClause(llvm::omp::OMPC_unified_address, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_unified_address, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1060,7 +1051,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_unified_address; + return T->getClauseKind() == OMPC_unified_address; } }; @@ -1080,12 +1071,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPUnifiedSharedMemoryClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_unified_shared_memory, StartLoc, EndLoc) {} + : OMPClause(OMPC_unified_shared_memory, StartLoc, EndLoc) {} /// Build an empty clause. OMPUnifiedSharedMemoryClause() - : OMPClause(llvm::omp::OMPC_unified_shared_memory, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_unified_shared_memory, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1103,7 +1093,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_unified_shared_memory; + return T->getClauseKind() == OMPC_unified_shared_memory; } }; @@ -1123,12 +1113,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPReverseOffloadClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_reverse_offload, StartLoc, EndLoc) {} + : OMPClause(OMPC_reverse_offload, StartLoc, EndLoc) {} /// Build an empty clause. OMPReverseOffloadClause() - : OMPClause(llvm::omp::OMPC_reverse_offload, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_reverse_offload, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1146,7 +1135,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_reverse_offload; + return T->getClauseKind() == OMPC_reverse_offload; } }; @@ -1166,12 +1155,12 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPDynamicAllocatorsClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_dynamic_allocators, StartLoc, EndLoc) {} + : OMPClause(OMPC_dynamic_allocators, StartLoc, EndLoc) {} /// Build an empty clause. OMPDynamicAllocatorsClause() - : OMPClause(llvm::omp::OMPC_dynamic_allocators, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_dynamic_allocators, SourceLocation(), SourceLocation()) { + } child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1189,7 +1178,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_dynamic_allocators; + return T->getClauseKind() == OMPC_dynamic_allocators; } }; @@ -1241,12 +1230,12 @@ public: SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, StartLoc, EndLoc), + : OMPClause(OMPC_atomic_default_mem_order, StartLoc, EndLoc), LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {} /// Build an empty clause. OMPAtomicDefaultMemOrderClause() - : OMPClause(llvm::omp::OMPC_atomic_default_mem_order, SourceLocation(), + : OMPClause(OMPC_atomic_default_mem_order, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. @@ -1279,7 +1268,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_atomic_default_mem_order; + return T->getClauseKind() == OMPC_atomic_default_mem_order; } }; @@ -1398,9 +1387,9 @@ public: Expr *ChunkSize, Stmt *HelperChunkSize, OpenMPScheduleClauseModifier M1, SourceLocation M1Loc, OpenMPScheduleClauseModifier M2, SourceLocation M2Loc) - : OMPClause(llvm::omp::OMPC_schedule, StartLoc, EndLoc), - OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Kind(Kind), - KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) { + : OMPClause(OMPC_schedule, StartLoc, EndLoc), OMPClauseWithPreInit(this), + LParenLoc(LParenLoc), Kind(Kind), KindLoc(KLoc), CommaLoc(CommaLoc), + ChunkSize(ChunkSize) { setPreInitStmt(HelperChunkSize); Modifiers[FIRST] = M1; Modifiers[SECOND] = M2; @@ -1410,7 +1399,7 @@ public: /// Build an empty clause. explicit OMPScheduleClause() - : OMPClause(llvm::omp::OMPC_schedule, SourceLocation(), SourceLocation()), + : OMPClause(OMPC_schedule, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) { Modifiers[FIRST] = OMPC_SCHEDULE_MODIFIER_unknown; Modifiers[SECOND] = OMPC_SCHEDULE_MODIFIER_unknown; @@ -1472,7 +1461,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_schedule; + return T->getClauseKind() == OMPC_schedule; } }; @@ -1507,12 +1496,12 @@ class OMPOrderedClause final /// \param EndLoc Ending location of the clause. OMPOrderedClause(Expr *Num, unsigned NumLoops, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_ordered, StartLoc, EndLoc), - LParenLoc(LParenLoc), NumForLoops(Num), NumberOfLoops(NumLoops) {} + : OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc), + NumForLoops(Num), NumberOfLoops(NumLoops) {} /// Build an empty clause. explicit OMPOrderedClause(unsigned NumLoops) - : OMPClause(llvm::omp::OMPC_ordered, SourceLocation(), SourceLocation()), + : OMPClause(OMPC_ordered, SourceLocation(), SourceLocation()), NumberOfLoops(NumLoops) {} /// Set the number of associated for-loops. @@ -1568,7 +1557,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_ordered; + return T->getClauseKind() == OMPC_ordered; } }; @@ -1585,11 +1574,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_nowait, StartLoc, EndLoc) {} + : OMPClause(OMPC_nowait, StartLoc, EndLoc) {} /// Build an empty clause. OMPNowaitClause() - : OMPClause(llvm::omp::OMPC_nowait, SourceLocation(), SourceLocation()) {} + : OMPClause(OMPC_nowait, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1607,7 +1596,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_nowait; + return T->getClauseKind() == OMPC_nowait; } }; @@ -1624,11 +1613,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_untied, StartLoc, EndLoc) {} + : OMPClause(OMPC_untied, StartLoc, EndLoc) {} /// Build an empty clause. OMPUntiedClause() - : OMPClause(llvm::omp::OMPC_untied, SourceLocation(), SourceLocation()) {} + : OMPClause(OMPC_untied, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1646,7 +1635,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_untied; + return T->getClauseKind() == OMPC_untied; } }; @@ -1664,12 +1653,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_mergeable, StartLoc, EndLoc) {} + : OMPClause(OMPC_mergeable, StartLoc, EndLoc) {} /// Build an empty clause. OMPMergeableClause() - : OMPClause(llvm::omp::OMPC_mergeable, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_mergeable, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1687,7 +1675,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_mergeable; + return T->getClauseKind() == OMPC_mergeable; } }; @@ -1704,11 +1692,10 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_read, StartLoc, EndLoc) {} + : OMPClause(OMPC_read, StartLoc, EndLoc) {} /// Build an empty clause. - OMPReadClause() - : OMPClause(llvm::omp::OMPC_read, SourceLocation(), SourceLocation()) {} + OMPReadClause() : OMPClause(OMPC_read, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1726,7 +1713,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_read; + return T->getClauseKind() == OMPC_read; } }; @@ -1743,11 +1730,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_write, StartLoc, EndLoc) {} + : OMPClause(OMPC_write, StartLoc, EndLoc) {} /// Build an empty clause. OMPWriteClause() - : OMPClause(llvm::omp::OMPC_write, SourceLocation(), SourceLocation()) {} + : OMPClause(OMPC_write, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1765,7 +1752,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_write; + return T->getClauseKind() == OMPC_write; } }; @@ -1825,12 +1812,11 @@ class OMPUpdateClause final /// \param EndLoc Ending location of the clause. OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc, bool IsExtended) - : OMPClause(llvm::omp::OMPC_update, StartLoc, EndLoc), - IsExtended(IsExtended) {} + : OMPClause(OMPC_update, StartLoc, EndLoc), IsExtended(IsExtended) {} /// Build an empty clause. OMPUpdateClause(bool IsExtended) - : OMPClause(llvm::omp::OMPC_update, SourceLocation(), SourceLocation()), + : OMPClause(OMPC_update, SourceLocation(), SourceLocation()), IsExtended(IsExtended) {} public: @@ -1900,7 +1886,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_update; + return T->getClauseKind() == OMPC_update; } }; @@ -1918,12 +1904,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_capture, StartLoc, EndLoc) {} + : OMPClause(OMPC_capture, StartLoc, EndLoc) {} /// Build an empty clause. OMPCaptureClause() - : OMPClause(llvm::omp::OMPC_capture, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_capture, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1941,7 +1926,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_capture; + return T->getClauseKind() == OMPC_capture; } }; @@ -1959,12 +1944,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_seq_cst, StartLoc, EndLoc) {} + : OMPClause(OMPC_seq_cst, StartLoc, EndLoc) {} /// Build an empty clause. OMPSeqCstClause() - : OMPClause(llvm::omp::OMPC_seq_cst, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_seq_cst, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -1982,7 +1966,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_seq_cst; + return T->getClauseKind() == OMPC_seq_cst; } }; @@ -2000,12 +1984,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPAcqRelClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_acq_rel, StartLoc, EndLoc) {} + : OMPClause(OMPC_acq_rel, StartLoc, EndLoc) {} /// Build an empty clause. OMPAcqRelClause() - : OMPClause(llvm::omp::OMPC_acq_rel, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_acq_rel, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -2023,7 +2006,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_acq_rel; + return T->getClauseKind() == OMPC_acq_rel; } }; @@ -2041,12 +2024,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPAcquireClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_acquire, StartLoc, EndLoc) {} + : OMPClause(OMPC_acquire, StartLoc, EndLoc) {} /// Build an empty clause. OMPAcquireClause() - : OMPClause(llvm::omp::OMPC_acquire, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_acquire, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -2064,7 +2046,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_acquire; + return T->getClauseKind() == OMPC_acquire; } }; @@ -2082,12 +2064,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPReleaseClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_release, StartLoc, EndLoc) {} + : OMPClause(OMPC_release, StartLoc, EndLoc) {} /// Build an empty clause. OMPReleaseClause() - : OMPClause(llvm::omp::OMPC_release, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_release, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -2105,7 +2086,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_release; + return T->getClauseKind() == OMPC_release; } }; @@ -2123,12 +2104,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPRelaxedClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_relaxed, StartLoc, EndLoc) {} + : OMPClause(OMPC_relaxed, StartLoc, EndLoc) {} /// Build an empty clause. OMPRelaxedClause() - : OMPClause(llvm::omp::OMPC_relaxed, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_relaxed, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -2146,7 +2126,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_relaxed; + return T->getClauseKind() == OMPC_relaxed; } }; @@ -2172,16 +2152,16 @@ class OMPPrivateClause final /// \param N Number of the variables in the clause. OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_private, StartLoc, - LParenLoc, EndLoc, N) {} + : OMPVarListClause(OMPC_private, StartLoc, LParenLoc, + EndLoc, N) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPPrivateClause(unsigned N) - : OMPVarListClause(llvm::omp::OMPC_private, + : OMPVarListClause(OMPC_private, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N) {} + N) {} /// Sets the list of references to private copies with initializers for /// new private variables. @@ -2251,7 +2231,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_private; + return T->getClauseKind() == OMPC_private; } }; @@ -2279,8 +2259,8 @@ class OMPFirstprivateClause final /// \param N Number of the variables in the clause. OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_firstprivate, - StartLoc, LParenLoc, EndLoc, N), + : OMPVarListClause(OMPC_firstprivate, StartLoc, + LParenLoc, EndLoc, N), OMPClauseWithPreInit(this) {} /// Build an empty clause. @@ -2288,7 +2268,7 @@ class OMPFirstprivateClause final /// \param N Number of variables. explicit OMPFirstprivateClause(unsigned N) : OMPVarListClause( - llvm::omp::OMPC_firstprivate, SourceLocation(), SourceLocation(), + OMPC_firstprivate, SourceLocation(), SourceLocation(), SourceLocation(), N), OMPClauseWithPreInit(this) {} @@ -2392,7 +2372,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_firstprivate; + return T->getClauseKind() == OMPC_firstprivate; } }; @@ -2445,8 +2425,8 @@ class OMPLastprivateClause final SourceLocation EndLoc, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_lastprivate, - StartLoc, LParenLoc, EndLoc, N), + : OMPVarListClause(OMPC_lastprivate, StartLoc, + LParenLoc, EndLoc, N), OMPClauseWithPostUpdate(this), LPKind(LPKind), LPKindLoc(LPKindLoc), ColonLoc(ColonLoc) {} @@ -2455,7 +2435,7 @@ class OMPLastprivateClause final /// \param N Number of variables. explicit OMPLastprivateClause(unsigned N) : OMPVarListClause( - llvm::omp::OMPC_lastprivate, SourceLocation(), SourceLocation(), + OMPC_lastprivate, SourceLocation(), SourceLocation(), SourceLocation(), N), OMPClauseWithPostUpdate(this) {} @@ -2631,7 +2611,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_lastprivate; + return T->getClauseKind() == OMPC_lastprivate; } }; @@ -2656,16 +2636,16 @@ class OMPSharedClause final /// \param N Number of the variables in the clause. OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_shared, StartLoc, - LParenLoc, EndLoc, N) {} + : OMPVarListClause(OMPC_shared, StartLoc, LParenLoc, + EndLoc, N) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPSharedClause(unsigned N) - : OMPVarListClause(llvm::omp::OMPC_shared, + : OMPVarListClause(OMPC_shared, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N) {} + N) {} public: /// Creates clause with a list of variables \a VL. @@ -2703,7 +2683,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_shared; + return T->getClauseKind() == OMPC_shared; } }; @@ -2754,8 +2734,8 @@ class OMPReductionClause final OpenMPReductionClauseModifier Modifier, unsigned N, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo) - : OMPVarListClause(llvm::omp::OMPC_reduction, - StartLoc, LParenLoc, EndLoc, N), + : OMPVarListClause(OMPC_reduction, StartLoc, + LParenLoc, EndLoc, N), OMPClauseWithPostUpdate(this), Modifier(Modifier), ModifierLoc(ModifierLoc), ColonLoc(ColonLoc), QualifierLoc(QualifierLoc), NameInfo(NameInfo) {} @@ -2764,9 +2744,9 @@ class OMPReductionClause final /// /// \param N Number of variables. explicit OMPReductionClause(unsigned N) - : OMPVarListClause(llvm::omp::OMPC_reduction, + : OMPVarListClause(OMPC_reduction, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N), + N), OMPClauseWithPostUpdate(this) {} /// Sets reduction modifier. @@ -2963,7 +2943,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_reduction; + return T->getClauseKind() == OMPC_reduction; } }; @@ -3005,8 +2985,8 @@ class OMPTaskReductionClause final SourceLocation ColonLoc, SourceLocation EndLoc, unsigned N, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo) - : OMPVarListClause( - llvm::omp::OMPC_task_reduction, StartLoc, LParenLoc, EndLoc, N), + : OMPVarListClause(OMPC_task_reduction, StartLoc, + LParenLoc, EndLoc, N), OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc), QualifierLoc(QualifierLoc), NameInfo(NameInfo) {} @@ -3015,7 +2995,7 @@ class OMPTaskReductionClause final /// \param N Number of variables. explicit OMPTaskReductionClause(unsigned N) : OMPVarListClause( - llvm::omp::OMPC_task_reduction, SourceLocation(), SourceLocation(), + OMPC_task_reduction, SourceLocation(), SourceLocation(), SourceLocation(), N), OMPClauseWithPostUpdate(this) {} @@ -3195,7 +3175,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_task_reduction; + return T->getClauseKind() == OMPC_task_reduction; } }; @@ -3236,8 +3216,8 @@ class OMPInReductionClause final SourceLocation ColonLoc, SourceLocation EndLoc, unsigned N, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo) - : OMPVarListClause(llvm::omp::OMPC_in_reduction, - StartLoc, LParenLoc, EndLoc, N), + : OMPVarListClause(OMPC_in_reduction, StartLoc, + LParenLoc, EndLoc, N), OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc), QualifierLoc(QualifierLoc), NameInfo(NameInfo) {} @@ -3246,7 +3226,7 @@ class OMPInReductionClause final /// \param N Number of variables. explicit OMPInReductionClause(unsigned N) : OMPVarListClause( - llvm::omp::OMPC_in_reduction, SourceLocation(), SourceLocation(), + OMPC_in_reduction, SourceLocation(), SourceLocation(), SourceLocation(), N), OMPClauseWithPostUpdate(this) {} @@ -3450,7 +3430,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_in_reduction; + return T->getClauseKind() == OMPC_in_reduction; } }; @@ -3496,8 +3476,8 @@ class OMPLinearClause final OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, unsigned NumVars) - : OMPVarListClause(llvm::omp::OMPC_linear, StartLoc, - LParenLoc, EndLoc, NumVars), + : OMPVarListClause(OMPC_linear, StartLoc, LParenLoc, + EndLoc, NumVars), OMPClauseWithPostUpdate(this), Modifier(Modifier), ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {} @@ -3505,9 +3485,9 @@ class OMPLinearClause final /// /// \param NumVars Number of variables. explicit OMPLinearClause(unsigned NumVars) - : OMPVarListClause(llvm::omp::OMPC_linear, + : OMPVarListClause(OMPC_linear, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), NumVars), + NumVars), OMPClauseWithPostUpdate(this) {} /// Gets the list of initial values for linear variables. @@ -3727,7 +3707,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_linear; + return T->getClauseKind() == OMPC_linear; } }; @@ -3762,17 +3742,17 @@ class OMPAlignedClause final OMPAlignedClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, unsigned NumVars) - : OMPVarListClause(llvm::omp::OMPC_aligned, StartLoc, - LParenLoc, EndLoc, NumVars), + : OMPVarListClause(OMPC_aligned, StartLoc, LParenLoc, + EndLoc, NumVars), ColonLoc(ColonLoc) {} /// Build an empty clause. /// /// \param NumVars Number of variables. explicit OMPAlignedClause(unsigned NumVars) - : OMPVarListClause(llvm::omp::OMPC_aligned, + : OMPVarListClause(OMPC_aligned, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), NumVars) {} + NumVars) {} public: /// Creates clause with a list of variables \a VL and alignment \a A. @@ -3826,7 +3806,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_aligned; + return T->getClauseKind() == OMPC_aligned; } }; @@ -3865,16 +3845,16 @@ class OMPCopyinClause final /// \param N Number of the variables in the clause. OMPCopyinClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_copyin, StartLoc, - LParenLoc, EndLoc, N) {} + : OMPVarListClause(OMPC_copyin, StartLoc, LParenLoc, + EndLoc, N) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPCopyinClause(unsigned N) - : OMPVarListClause(llvm::omp::OMPC_copyin, + : OMPVarListClause(OMPC_copyin, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N) {} + N) {} /// Set list of helper expressions, required for proper codegen of the /// clause. These expressions represent source expression in the final @@ -4002,7 +3982,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_copyin; + return T->getClauseKind() == OMPC_copyin; } }; @@ -4029,16 +4009,15 @@ class OMPCopyprivateClause final /// \param N Number of the variables in the clause. OMPCopyprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_copyprivate, - StartLoc, LParenLoc, EndLoc, N) { - } + : OMPVarListClause(OMPC_copyprivate, StartLoc, + LParenLoc, EndLoc, N) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPCopyprivateClause(unsigned N) : OMPVarListClause( - llvm::omp::OMPC_copyprivate, SourceLocation(), SourceLocation(), + OMPC_copyprivate, SourceLocation(), SourceLocation(), SourceLocation(), N) {} /// Set list of helper expressions, required for proper codegen of the @@ -4166,7 +4145,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_copyprivate; + return T->getClauseKind() == OMPC_copyprivate; } }; @@ -4196,16 +4175,16 @@ class OMPFlushClause final /// \param N Number of the variables in the clause. OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_flush, StartLoc, - LParenLoc, EndLoc, N) {} + : OMPVarListClause(OMPC_flush, StartLoc, LParenLoc, + EndLoc, N) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPFlushClause(unsigned N) - : OMPVarListClause(llvm::omp::OMPC_flush, + : OMPVarListClause(OMPC_flush, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N) {} + N) {} public: /// Creates clause with a list of variables \a VL. @@ -4243,7 +4222,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_flush; + return T->getClauseKind() == OMPC_flush; } }; @@ -4275,13 +4254,12 @@ class OMPDepobjClause final : public OMPClause { /// \param EndLoc Ending location of the clause. OMPDepobjClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_depobj, StartLoc, EndLoc), - LParenLoc(LParenLoc) {} + : OMPClause(OMPC_depobj, StartLoc, EndLoc), LParenLoc(LParenLoc) {} /// Build an empty clause. /// explicit OMPDepobjClause() - : OMPClause(llvm::omp::OMPC_depobj, SourceLocation(), SourceLocation()) {} + : OMPClause(OMPC_depobj, SourceLocation(), SourceLocation()) {} void setDepobj(Expr *E) { Depobj = E; } @@ -4330,7 +4308,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_depobj; + return T->getClauseKind() == OMPC_depobj; } }; @@ -4371,9 +4349,8 @@ class OMPDependClause final /// clause. OMPDependClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N, unsigned NumLoops) - : OMPVarListClause(llvm::omp::OMPC_depend, StartLoc, - LParenLoc, EndLoc, N), - NumLoops(NumLoops) {} + : OMPVarListClause(OMPC_depend, StartLoc, LParenLoc, + EndLoc, N), NumLoops(NumLoops) {} /// Build an empty clause. /// @@ -4381,9 +4358,9 @@ class OMPDependClause final /// \param NumLoops Number of loops that is associated with this depend /// clause. explicit OMPDependClause(unsigned N, unsigned NumLoops) - : OMPVarListClause(llvm::omp::OMPC_depend, + : OMPVarListClause(OMPC_depend, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N), + N), NumLoops(NumLoops) {} /// Set dependency kind. @@ -4462,7 +4439,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_depend; + return T->getClauseKind() == OMPC_depend; } }; @@ -4515,15 +4492,15 @@ public: OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_device, StartLoc, EndLoc), - OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Modifier(Modifier), - ModifierLoc(ModifierLoc), Device(E) { + : OMPClause(OMPC_device, StartLoc, EndLoc), OMPClauseWithPreInit(this), + LParenLoc(LParenLoc), Modifier(Modifier), ModifierLoc(ModifierLoc), + Device(E) { setPreInitStmt(HelperE, CaptureRegion); } /// Build an empty clause. OMPDeviceClause() - : OMPClause(llvm::omp::OMPC_device, SourceLocation(), SourceLocation()), + : OMPClause(OMPC_device, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -4558,7 +4535,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_device; + return T->getClauseKind() == OMPC_device; } }; @@ -4575,12 +4552,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPThreadsClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_threads, StartLoc, EndLoc) {} + : OMPClause(OMPC_threads, StartLoc, EndLoc) {} /// Build an empty clause. OMPThreadsClause() - : OMPClause(llvm::omp::OMPC_threads, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_threads, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -4598,7 +4574,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_threads; + return T->getClauseKind() == OMPC_threads; } }; @@ -4615,11 +4591,10 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPSIMDClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_simd, StartLoc, EndLoc) {} + : OMPClause(OMPC_simd, StartLoc, EndLoc) {} /// Build an empty clause. - OMPSIMDClause() - : OMPClause(llvm::omp::OMPC_simd, SourceLocation(), SourceLocation()) {} + OMPSIMDClause() : OMPClause(OMPC_simd, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -4637,7 +4612,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_simd; + return T->getClauseKind() == OMPC_simd; } }; @@ -5318,8 +5293,8 @@ private: OpenMPMapClauseKind MapType, bool MapTypeIsImplicit, SourceLocation MapLoc, const OMPVarListLocTy &Locs, const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_map, Locs, Sizes, - &MapperQualifierLoc, &MapperIdInfo), + : OMPMappableExprListClause(OMPC_map, Locs, Sizes, &MapperQualifierLoc, + &MapperIdInfo), MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) { assert(llvm::array_lengthof(MapTypeModifiers) == MapModifiers.size() && "Unexpected number of map type modifiers."); @@ -5339,8 +5314,7 @@ private: /// 3) NumComponentLists: number of component lists in this clause; and 4) /// NumComponents: total number of expression components in the clause. explicit OMPMapClause(const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_map, OMPVarListLocTy(), - Sizes) {} + : OMPMappableExprListClause(OMPC_map, OMPVarListLocTy(), Sizes) {} /// Set map-type-modifier for the clause. /// @@ -5487,7 +5461,7 @@ public: static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_map; + return T->getClauseKind() == OMPC_map; } }; @@ -5526,15 +5500,14 @@ public: OMPNumTeamsClause(Expr *E, Stmt *HelperE, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_num_teams, StartLoc, EndLoc), - OMPClauseWithPreInit(this), LParenLoc(LParenLoc), NumTeams(E) { + : OMPClause(OMPC_num_teams, StartLoc, EndLoc), OMPClauseWithPreInit(this), + LParenLoc(LParenLoc), NumTeams(E) { setPreInitStmt(HelperE, CaptureRegion); } /// Build an empty clause. OMPNumTeamsClause() - : OMPClause(llvm::omp::OMPC_num_teams, SourceLocation(), - SourceLocation()), + : OMPClause(OMPC_num_teams, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -5563,7 +5536,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_num_teams; + return T->getClauseKind() == OMPC_num_teams; } }; @@ -5603,15 +5576,14 @@ public: OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_thread_limit, StartLoc, EndLoc), + : OMPClause(OMPC_thread_limit, StartLoc, EndLoc), OMPClauseWithPreInit(this), LParenLoc(LParenLoc), ThreadLimit(E) { setPreInitStmt(HelperE, CaptureRegion); } /// Build an empty clause. OMPThreadLimitClause() - : OMPClause(llvm::omp::OMPC_thread_limit, SourceLocation(), - SourceLocation()), + : OMPClause(OMPC_thread_limit, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -5640,7 +5612,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_thread_limit; + return T->getClauseKind() == OMPC_thread_limit; } }; @@ -5679,14 +5651,14 @@ public: OMPPriorityClause(Expr *Priority, Stmt *HelperPriority, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_priority, StartLoc, EndLoc), - OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Priority(Priority) { + : OMPClause(OMPC_priority, StartLoc, EndLoc), OMPClauseWithPreInit(this), + LParenLoc(LParenLoc), Priority(Priority) { setPreInitStmt(HelperPriority, CaptureRegion); } /// Build an empty clause. OMPPriorityClause() - : OMPClause(llvm::omp::OMPC_priority, SourceLocation(), SourceLocation()), + : OMPClause(OMPC_priority, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -5714,7 +5686,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_priority; + return T->getClauseKind() == OMPC_priority; } }; @@ -5750,15 +5722,14 @@ public: OMPGrainsizeClause(Expr *Size, Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_grainsize, StartLoc, EndLoc), - OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Grainsize(Size) { + : OMPClause(OMPC_grainsize, StartLoc, EndLoc), OMPClauseWithPreInit(this), + LParenLoc(LParenLoc), Grainsize(Size) { setPreInitStmt(HelperSize, CaptureRegion); } /// Build an empty clause. explicit OMPGrainsizeClause() - : OMPClause(llvm::omp::OMPC_grainsize, SourceLocation(), - SourceLocation()), + : OMPClause(OMPC_grainsize, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -5783,7 +5754,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_grainsize; + return T->getClauseKind() == OMPC_grainsize; } }; @@ -5800,12 +5771,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_nogroup, StartLoc, EndLoc) {} + : OMPClause(OMPC_nogroup, StartLoc, EndLoc) {} /// Build an empty clause. OMPNogroupClause() - : OMPClause(llvm::omp::OMPC_nogroup, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_nogroup, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -5823,7 +5793,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_nogroup; + return T->getClauseKind() == OMPC_nogroup; } }; @@ -5859,15 +5829,14 @@ public: OMPNumTasksClause(Expr *Size, Stmt *HelperSize, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_num_tasks, StartLoc, EndLoc), - OMPClauseWithPreInit(this), LParenLoc(LParenLoc), NumTasks(Size) { + : OMPClause(OMPC_num_tasks, StartLoc, EndLoc), OMPClauseWithPreInit(this), + LParenLoc(LParenLoc), NumTasks(Size) { setPreInitStmt(HelperSize, CaptureRegion); } /// Build an empty clause. explicit OMPNumTasksClause() - : OMPClause(llvm::omp::OMPC_num_tasks, SourceLocation(), - SourceLocation()), + : OMPClause(OMPC_num_tasks, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Sets the location of '('. @@ -5892,7 +5861,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_num_tasks; + return T->getClauseKind() == OMPC_num_tasks; } }; @@ -5924,12 +5893,11 @@ public: /// \param EndLoc Ending location of the clause. OMPHintClause(Expr *Hint, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc), + : OMPClause(OMPC_hint, StartLoc, EndLoc), LParenLoc(LParenLoc), Hint(Hint) {} /// Build an empty clause. - OMPHintClause() - : OMPClause(llvm::omp::OMPC_hint, SourceLocation(), SourceLocation()) {} + OMPHintClause() : OMPClause(OMPC_hint, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -5954,7 +5922,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_hint; + return T->getClauseKind() == OMPC_hint; } }; @@ -6026,7 +5994,7 @@ public: SourceLocation EndLoc, OpenMPDistScheduleClauseKind Kind, Expr *ChunkSize, Stmt *HelperChunkSize) - : OMPClause(llvm::omp::OMPC_dist_schedule, StartLoc, EndLoc), + : OMPClause(OMPC_dist_schedule, StartLoc, EndLoc), OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Kind(Kind), KindLoc(KLoc), CommaLoc(CommaLoc), ChunkSize(ChunkSize) { setPreInitStmt(HelperChunkSize); @@ -6034,8 +6002,7 @@ public: /// Build an empty clause. explicit OMPDistScheduleClause() - : OMPClause(llvm::omp::OMPC_dist_schedule, SourceLocation(), - SourceLocation()), + : OMPClause(OMPC_dist_schedule, SourceLocation(), SourceLocation()), OMPClauseWithPreInit(this) {} /// Get kind of the clause. @@ -6074,7 +6041,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_dist_schedule; + return T->getClauseKind() == OMPC_dist_schedule; } }; @@ -6144,14 +6111,12 @@ public: SourceLocation MLoc, SourceLocation KLoc, SourceLocation EndLoc, OpenMPDefaultmapClauseKind Kind, OpenMPDefaultmapClauseModifier M) - : OMPClause(llvm::omp::OMPC_defaultmap, StartLoc, EndLoc), - LParenLoc(LParenLoc), Modifier(M), ModifierLoc(MLoc), Kind(Kind), - KindLoc(KLoc) {} + : OMPClause(OMPC_defaultmap, StartLoc, EndLoc), LParenLoc(LParenLoc), + Modifier(M), ModifierLoc(MLoc), Kind(Kind), KindLoc(KLoc) {} /// Build an empty clause. explicit OMPDefaultmapClause() - : OMPClause(llvm::omp::OMPC_defaultmap, SourceLocation(), - SourceLocation()) {} + : OMPClause(OMPC_defaultmap, SourceLocation(), SourceLocation()) {} /// Get kind of the clause. OpenMPDefaultmapClauseKind getDefaultmapKind() const { return Kind; } @@ -6188,7 +6153,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_defaultmap; + return T->getClauseKind() == OMPC_defaultmap; } }; @@ -6226,8 +6191,8 @@ class OMPToClause final : public OMPMappableExprListClause, DeclarationNameInfo MapperIdInfo, const OMPVarListLocTy &Locs, const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_to, Locs, Sizes, - &MapperQualifierLoc, &MapperIdInfo) {} + : OMPMappableExprListClause(OMPC_to, Locs, Sizes, &MapperQualifierLoc, + &MapperIdInfo) {} /// Build an empty clause. /// @@ -6237,8 +6202,7 @@ class OMPToClause final : public OMPMappableExprListClause, /// 3) NumComponentLists: number of component lists in this clause; and 4) /// NumComponents: total number of expression components in the clause. explicit OMPToClause(const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_to, OMPVarListLocTy(), - Sizes) {} + : OMPMappableExprListClause(OMPC_to, OMPVarListLocTy(), Sizes) {} /// Define the sizes of each trailing object array except the last one. This /// is required for TrailingObjects to work properly. @@ -6306,7 +6270,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_to; + return T->getClauseKind() == OMPC_to; } }; @@ -6345,8 +6309,8 @@ class OMPFromClause final DeclarationNameInfo MapperIdInfo, const OMPVarListLocTy &Locs, const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_from, Locs, Sizes, - &MapperQualifierLoc, &MapperIdInfo) {} + : OMPMappableExprListClause(OMPC_from, Locs, Sizes, &MapperQualifierLoc, + &MapperIdInfo) {} /// Build an empty clause. /// @@ -6356,8 +6320,7 @@ class OMPFromClause final /// 3) NumComponentLists: number of component lists in this clause; and 4) /// NumComponents: total number of expression components in the clause. explicit OMPFromClause(const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_from, OMPVarListLocTy(), - Sizes) {} + : OMPMappableExprListClause(OMPC_from, OMPVarListLocTy(), Sizes) {} /// Define the sizes of each trailing object array except the last one. This /// is required for TrailingObjects to work properly. @@ -6425,7 +6388,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_from; + return T->getClauseKind() == OMPC_from; } }; @@ -6459,8 +6422,7 @@ class OMPUseDevicePtrClause final /// NumComponents: total number of expression components in the clause. explicit OMPUseDevicePtrClause(const OMPVarListLocTy &Locs, const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_use_device_ptr, Locs, Sizes) { - } + : OMPMappableExprListClause(OMPC_use_device_ptr, Locs, Sizes) {} /// Build an empty clause. /// @@ -6470,8 +6432,8 @@ class OMPUseDevicePtrClause final /// 3) NumComponentLists: number of component lists in this clause; and 4) /// NumComponents: total number of expression components in the clause. explicit OMPUseDevicePtrClause(const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_use_device_ptr, - OMPVarListLocTy(), Sizes) {} + : OMPMappableExprListClause(OMPC_use_device_ptr, OMPVarListLocTy(), + Sizes) {} /// Define the sizes of each trailing object array except the last one. This /// is required for TrailingObjects to work properly. @@ -6589,7 +6551,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_use_device_ptr; + return T->getClauseKind() == OMPC_use_device_ptr; } }; @@ -6623,7 +6585,7 @@ class OMPIsDevicePtrClause final /// NumComponents: total number of expression components in the clause. explicit OMPIsDevicePtrClause(const OMPVarListLocTy &Locs, const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_is_device_ptr, Locs, Sizes) {} + : OMPMappableExprListClause(OMPC_is_device_ptr, Locs, Sizes) {} /// Build an empty clause. /// @@ -6633,8 +6595,8 @@ class OMPIsDevicePtrClause final /// 3) NumComponentLists: number of component lists in this clause; and 4) /// NumComponents: total number of expression components in the clause. explicit OMPIsDevicePtrClause(const OMPMappableExprListSizeTy &Sizes) - : OMPMappableExprListClause(llvm::omp::OMPC_is_device_ptr, - OMPVarListLocTy(), Sizes) {} + : OMPMappableExprListClause(OMPC_is_device_ptr, OMPVarListLocTy(), + Sizes) {} /// Define the sizes of each trailing object array except the last one. This /// is required for TrailingObjects to work properly. @@ -6692,7 +6654,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_is_device_ptr; + return T->getClauseKind() == OMPC_is_device_ptr; } }; @@ -6718,16 +6680,15 @@ class OMPNontemporalClause final /// \param N Number of the variables in the clause. OMPNontemporalClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_nontemporal, - StartLoc, LParenLoc, EndLoc, N) { - } + : OMPVarListClause(OMPC_nontemporal, StartLoc, + LParenLoc, EndLoc, N) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPNontemporalClause(unsigned N) : OMPVarListClause( - llvm::omp::OMPC_nontemporal, SourceLocation(), SourceLocation(), + OMPC_nontemporal, SourceLocation(), SourceLocation(), SourceLocation(), N) {} /// Get the list of privatied copies if the member expression was captured by @@ -6789,7 +6750,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_nontemporal; + return T->getClauseKind() == OMPC_nontemporal; } }; @@ -6833,12 +6794,12 @@ public: OMPOrderClause(OpenMPOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_order, StartLoc, EndLoc), - LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {} + : OMPClause(OMPC_order, StartLoc, EndLoc), LParenLoc(LParenLoc), Kind(A), + KindKwLoc(ALoc) {} /// Build an empty clause. OMPOrderClause() - : OMPClause(llvm::omp::OMPC_order, SourceLocation(), SourceLocation()) {} + : OMPClause(OMPC_order, SourceLocation(), SourceLocation()) {} /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -6868,7 +6829,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_order; + return T->getClauseKind() == OMPC_order; } }; @@ -6886,12 +6847,11 @@ public: /// \param StartLoc Starting location of the clause. /// \param EndLoc Ending location of the clause. OMPDestroyClause(SourceLocation StartLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_destroy, StartLoc, EndLoc) {} + : OMPClause(OMPC_destroy, StartLoc, EndLoc) {} /// Build an empty clause. OMPDestroyClause() - : OMPClause(llvm::omp::OMPC_destroy, SourceLocation(), SourceLocation()) { - } + : OMPClause(OMPC_destroy, SourceLocation(), SourceLocation()) {} child_range children() { return child_range(child_iterator(), child_iterator()); @@ -6909,7 +6869,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_destroy; + return T->getClauseKind() == OMPC_destroy; } }; @@ -6944,12 +6904,12 @@ public: /// \param EndLoc Ending location of the clause. OMPDetachClause(Expr *Evt, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(llvm::omp::OMPC_detach, StartLoc, EndLoc), - LParenLoc(LParenLoc), Evt(Evt) {} + : OMPClause(OMPC_detach, StartLoc, EndLoc), LParenLoc(LParenLoc), + Evt(Evt) {} /// Build an empty clause. OMPDetachClause() - : OMPClause(llvm::omp::OMPC_detach, SourceLocation(), SourceLocation()) {} + : OMPClause(OMPC_detach, SourceLocation(), SourceLocation()) {} /// Returns the location of '('. SourceLocation getLParenLoc() const { return LParenLoc; } @@ -6971,7 +6931,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_detach; + return T->getClauseKind() == OMPC_detach; } }; @@ -6997,16 +6957,16 @@ class OMPInclusiveClause final /// \param N Number of the variables in the clause. OMPInclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_inclusive, - StartLoc, LParenLoc, EndLoc, N) {} + : OMPVarListClause(OMPC_inclusive, StartLoc, + LParenLoc, EndLoc, N) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPInclusiveClause(unsigned N) - : OMPVarListClause(llvm::omp::OMPC_inclusive, + : OMPVarListClause(OMPC_inclusive, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N) {} + N) {} public: /// Creates clause with a list of variables \a VL. @@ -7045,7 +7005,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_inclusive; + return T->getClauseKind() == OMPC_inclusive; } }; @@ -7071,16 +7031,16 @@ class OMPExclusiveClause final /// \param N Number of the variables in the clause. OMPExclusiveClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N) - : OMPVarListClause(llvm::omp::OMPC_exclusive, - StartLoc, LParenLoc, EndLoc, N) {} + : OMPVarListClause(OMPC_exclusive, StartLoc, + LParenLoc, EndLoc, N) {} /// Build an empty clause. /// /// \param N Number of variables. explicit OMPExclusiveClause(unsigned N) - : OMPVarListClause(llvm::omp::OMPC_exclusive, + : OMPVarListClause(OMPC_exclusive, SourceLocation(), SourceLocation(), SourceLocation(), - SourceLocation(), N) {} + N) {} public: /// Creates clause with a list of variables \a VL. @@ -7119,7 +7079,7 @@ public: } static bool classof(const OMPClause *T) { - return T->getClauseKind() == llvm::omp::OMPC_exclusive; + return T->getClauseKind() == OMPC_exclusive; } }; @@ -7132,20 +7092,17 @@ public: #define DISPATCH(CLASS) \ return static_cast(this)->Visit##CLASS(static_cast(S)) -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ +#define OPENMP_CLAUSE(Name, Class) \ RetTy Visit ## Class (PTR(Class) S) { DISPATCH(Class); } -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#include "clang/Basic/OpenMPKinds.def" RetTy Visit(PTR(OMPClause) S) { // Top switch clause: visit each OMPClause. switch (S->getClauseKind()) { -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ - case llvm::omp::Clause::Enum: \ - return Visit##Class(static_cast(S)); -#define OMP_CLAUSE_NO_CLASS(Enum, Str) \ - case llvm::omp::Clause::Enum: \ - break; -#include "llvm/Frontend/OpenMP/OMPKinds.def" + default: llvm_unreachable("Unknown clause kind!"); +#define OPENMP_CLAUSE(Name, Class) \ + case OMPC_ ## Name : return Visit ## Class(static_cast(S)); +#include "clang/Basic/OpenMPKinds.def" } } // Base case, ignore it. :) @@ -7174,9 +7131,8 @@ public: OMPClausePrinter(raw_ostream &OS, const PrintingPolicy &Policy) : OS(OS), Policy(Policy) {} -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ - void Visit##Class(Class *S); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S); +#include "clang/Basic/OpenMPKinds.def" }; /// Helper data structure representing the traits in a match clause of an diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h index 476e910..46661e5 100644 --- a/clang/include/clang/AST/RecursiveASTVisitor.h +++ b/clang/include/clang/AST/RecursiveASTVisitor.h @@ -534,8 +534,8 @@ private: bool TraverseOMPExecutableDirective(OMPExecutableDirective *S); bool TraverseOMPLoopDirective(OMPLoopDirective *S); bool TraverseOMPClause(OMPClause *C); -#define OMP_CLAUSE_CLASS(Enum, Str, Class) bool Visit##Class(Class *C); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(Name, Class) bool Visit##Class(Class *C); +#include "clang/Basic/OpenMPKinds.def" /// Process clauses with list of variables. template bool VisitOMPClauseList(T *Node); /// Process clauses with pre-initis. @@ -2956,14 +2956,17 @@ bool RecursiveASTVisitor::TraverseOMPClause(OMPClause *C) { if (!C) return true; switch (C->getClauseKind()) { -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ - case llvm::omp::Clause::Enum: \ +#define OPENMP_CLAUSE(Name, Class) \ + case OMPC_##Name: \ TRY_TO(Visit##Class(static_cast(C))); \ break; -#define OMP_CLAUSE_NO_CLASS(Enum, Str) \ - case llvm::omp::Clause::Enum: \ +#include "clang/Basic/OpenMPKinds.def" + case OMPC_threadprivate: + case OMPC_uniform: + case OMPC_device_type: + case OMPC_match: + case OMPC_unknown: break; -#include "llvm/Frontend/OpenMP/OMPKinds.def" } return true; } diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index f55ce2c..96bfdd3 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -3242,13 +3242,8 @@ def OMPCaptureKind : Attr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = []; let SemaHandler = 0; - let Args = [UnsignedArgument<"CaptureKindVal">]; + let Args = [UnsignedArgument<"CaptureKind">]; let Documentation = [Undocumented]; - let AdditionalMembers = [{ - llvm::omp::Clause getCaptureKind() const { - return static_cast(getCaptureKindVal()); - } - }]; } def OMPReferencedVar : Attr { diff --git a/clang/include/clang/Basic/OpenMPKinds.def b/clang/include/clang/Basic/OpenMPKinds.def index 4a4e6c6..3cf92ea 100644 --- a/clang/include/clang/Basic/OpenMPKinds.def +++ b/clang/include/clang/Basic/OpenMPKinds.def @@ -222,6 +222,74 @@ #define OPENMP_REDUCTION_MODIFIER(Name) #endif +// OpenMP clauses. +OPENMP_CLAUSE(allocator, OMPAllocatorClause) +OPENMP_CLAUSE(if, OMPIfClause) +OPENMP_CLAUSE(final, OMPFinalClause) +OPENMP_CLAUSE(num_threads, OMPNumThreadsClause) +OPENMP_CLAUSE(safelen, OMPSafelenClause) +OPENMP_CLAUSE(simdlen, OMPSimdlenClause) +OPENMP_CLAUSE(collapse, OMPCollapseClause) +OPENMP_CLAUSE(default, OMPDefaultClause) +OPENMP_CLAUSE(private, OMPPrivateClause) +OPENMP_CLAUSE(firstprivate, OMPFirstprivateClause) +OPENMP_CLAUSE(lastprivate, OMPLastprivateClause) +OPENMP_CLAUSE(shared, OMPSharedClause) +OPENMP_CLAUSE(reduction, OMPReductionClause) +OPENMP_CLAUSE(linear, OMPLinearClause) +OPENMP_CLAUSE(aligned, OMPAlignedClause) +OPENMP_CLAUSE(copyin, OMPCopyinClause) +OPENMP_CLAUSE(copyprivate, OMPCopyprivateClause) +OPENMP_CLAUSE(proc_bind, OMPProcBindClause) +OPENMP_CLAUSE(schedule, OMPScheduleClause) +OPENMP_CLAUSE(ordered, OMPOrderedClause) +OPENMP_CLAUSE(nowait, OMPNowaitClause) +OPENMP_CLAUSE(untied, OMPUntiedClause) +OPENMP_CLAUSE(mergeable, OMPMergeableClause) +OPENMP_CLAUSE(flush, OMPFlushClause) +OPENMP_CLAUSE(read, OMPReadClause) +OPENMP_CLAUSE(write, OMPWriteClause) +OPENMP_CLAUSE(update, OMPUpdateClause) +OPENMP_CLAUSE(capture, OMPCaptureClause) +OPENMP_CLAUSE(seq_cst, OMPSeqCstClause) +OPENMP_CLAUSE(acq_rel, OMPAcqRelClause) +OPENMP_CLAUSE(acquire, OMPAcquireClause) +OPENMP_CLAUSE(release, OMPReleaseClause) +OPENMP_CLAUSE(relaxed, OMPRelaxedClause) +OPENMP_CLAUSE(depend, OMPDependClause) +OPENMP_CLAUSE(device, OMPDeviceClause) +OPENMP_CLAUSE(threads, OMPThreadsClause) +OPENMP_CLAUSE(simd, OMPSIMDClause) +OPENMP_CLAUSE(map, OMPMapClause) +OPENMP_CLAUSE(num_teams, OMPNumTeamsClause) +OPENMP_CLAUSE(thread_limit, OMPThreadLimitClause) +OPENMP_CLAUSE(priority, OMPPriorityClause) +OPENMP_CLAUSE(grainsize, OMPGrainsizeClause) +OPENMP_CLAUSE(nogroup, OMPNogroupClause) +OPENMP_CLAUSE(num_tasks, OMPNumTasksClause) +OPENMP_CLAUSE(hint, OMPHintClause) +OPENMP_CLAUSE(dist_schedule, OMPDistScheduleClause) +OPENMP_CLAUSE(defaultmap, OMPDefaultmapClause) +OPENMP_CLAUSE(to, OMPToClause) +OPENMP_CLAUSE(from, OMPFromClause) +OPENMP_CLAUSE(use_device_ptr, OMPUseDevicePtrClause) +OPENMP_CLAUSE(is_device_ptr, OMPIsDevicePtrClause) +OPENMP_CLAUSE(task_reduction, OMPTaskReductionClause) +OPENMP_CLAUSE(in_reduction, OMPInReductionClause) +OPENMP_CLAUSE(unified_address, OMPUnifiedAddressClause) +OPENMP_CLAUSE(unified_shared_memory, OMPUnifiedSharedMemoryClause) +OPENMP_CLAUSE(reverse_offload, OMPReverseOffloadClause) +OPENMP_CLAUSE(dynamic_allocators, OMPDynamicAllocatorsClause) +OPENMP_CLAUSE(atomic_default_mem_order, OMPAtomicDefaultMemOrderClause) +OPENMP_CLAUSE(allocate, OMPAllocateClause) +OPENMP_CLAUSE(nontemporal, OMPNontemporalClause) +OPENMP_CLAUSE(order, OMPOrderClause) +OPENMP_CLAUSE(depobj, OMPDepobjClause) +OPENMP_CLAUSE(destroy, OMPDestroyClause) +OPENMP_CLAUSE(detach, OMPDetachClause) +OPENMP_CLAUSE(inclusive, OMPInclusiveClause) +OPENMP_CLAUSE(exclusive, OMPExclusiveClause) + // Clauses allowed for OpenMP directive 'scan'. OPENMP_SCAN_CLAUSE(inclusive) OPENMP_SCAN_CLAUSE(exclusive) diff --git a/clang/include/clang/Basic/OpenMPKinds.h b/clang/include/clang/Basic/OpenMPKinds.h index 4064cb2..b567f89 100644 --- a/clang/include/clang/Basic/OpenMPKinds.h +++ b/clang/include/clang/Basic/OpenMPKinds.h @@ -23,7 +23,16 @@ namespace clang { using OpenMPDirectiveKind = llvm::omp::Directive; /// OpenMP clauses. -using OpenMPClauseKind = llvm::omp::Clause; +enum OpenMPClauseKind { +#define OPENMP_CLAUSE(Name, Class) \ + OMPC_##Name, +#include "clang/Basic/OpenMPKinds.def" + OMPC_threadprivate, + OMPC_uniform, + OMPC_device_type, + OMPC_match, + OMPC_unknown +}; /// OpenMP attributes for 'schedule' clause. enum OpenMPScheduleClauseKind { @@ -166,6 +175,9 @@ enum OpenMPReductionClauseModifier { OMPC_REDUCTION_unknown, }; +OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str); +const char *getOpenMPClauseName(OpenMPClauseKind Kind); + unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str); const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type); diff --git a/clang/lib/AST/ASTTypeTraits.cpp b/clang/lib/AST/ASTTypeTraits.cpp index 6404edd..e4ea3f4 100644 --- a/clang/lib/AST/ASTTypeTraits.cpp +++ b/clang/lib/AST/ASTTypeTraits.cpp @@ -39,8 +39,8 @@ const ASTNodeKind::KindInfo ASTNodeKind::AllKindInfo[] = { #define TYPE(DERIVED, BASE) { NKI_##BASE, #DERIVED "Type" }, #include "clang/AST/TypeNodes.inc" { NKI_None, "OMPClause" }, -#define OMP_CLAUSE_CLASS(Enum, Str, Class) {NKI_OMPClause, #Class}, -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(TextualSpelling, Class) {NKI_OMPClause, #Class}, +#include "clang/Basic/OpenMPKinds.def" }; bool ASTNodeKind::isBaseOf(ASTNodeKind Other, unsigned *Distance) const { @@ -111,13 +111,15 @@ ASTNodeKind ASTNodeKind::getFromNode(const Type &T) { ASTNodeKind ASTNodeKind::getFromNode(const OMPClause &C) { switch (C.getClauseKind()) { -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ - case llvm::omp::Clause::Enum: \ - return ASTNodeKind(NKI_##Class); -#define OMP_CLAUSE_NO_CLASS(Enum, Str) \ - case llvm::omp::Clause::Enum: \ +#define OPENMP_CLAUSE(Name, Class) \ + case OMPC_##Name: return ASTNodeKind(NKI_##Class); +#include "clang/Basic/OpenMPKinds.def" + case OMPC_threadprivate: + case OMPC_uniform: + case OMPC_device_type: + case OMPC_match: + case OMPC_unknown: llvm_unreachable("unexpected OpenMP clause kind"); -#include "llvm/Frontend/OpenMP/OMPKinds.def" } llvm_unreachable("invalid stmt kind"); } diff --git a/clang/lib/AST/AttrImpl.cpp b/clang/lib/AST/AttrImpl.cpp index 7d3a290..a5ff68c 100644 --- a/clang/lib/AST/AttrImpl.cpp +++ b/clang/lib/AST/AttrImpl.cpp @@ -108,8 +108,7 @@ void OMPDeclareSimdDeclAttr::printPrettyPragma( for (auto *E : linears()) { OS << " linear("; if (*MI != OMPC_LINEAR_unknown) - OS << getOpenMPSimpleClauseTypeName(llvm::omp::Clause::OMPC_linear, *MI) - << "("; + OS << getOpenMPSimpleClauseTypeName(OMPC_linear, *MI) << "("; E->printPretty(OS, nullptr, Policy); if (*MI != OMPC_LINEAR_unknown) OS << ")"; diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp index 1cd178c..4b7ebbb 100644 --- a/clang/lib/AST/OpenMPClause.cpp +++ b/clang/lib/AST/OpenMPClause.cpp @@ -31,20 +31,20 @@ OMPClause::child_range OMPClause::children() { switch (getClauseKind()) { default: break; -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ - case Enum: \ +#define OPENMP_CLAUSE(Name, Class) \ + case OMPC_##Name: \ return static_cast(this)->children(); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#include "clang/Basic/OpenMPKinds.def" } llvm_unreachable("unknown OMPClause"); } OMPClause::child_range OMPClause::used_children() { switch (getClauseKind()) { -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ - case Enum: \ +#define OPENMP_CLAUSE(Name, Class) \ + case OMPC_##Name: \ return static_cast(this)->used_children(); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#include "clang/Basic/OpenMPKinds.def" case OMPC_threadprivate: case OMPC_uniform: case OMPC_device_type: diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 1bb1b16..054276a 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -414,8 +414,9 @@ class OMPClauseProfiler : public ConstOMPClauseVisitor { public: OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { } -#define OMP_CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(Name, Class) \ + void Visit##Class(const Class *C); +#include "clang/Basic/OpenMPKinds.def" void VistOMPClauseWithPreInit(const OMPClauseWithPreInit *C); void VistOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C); }; diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp index 29e16d4..6a6d869 100644 --- a/clang/lib/AST/TextNodeDumper.cpp +++ b/clang/lib/AST/TextNodeDumper.cpp @@ -314,7 +314,7 @@ void TextNodeDumper::Visit(const OMPClause *C) { } { ColorScope Color(OS, ShowColors, AttrColor); - StringRef ClauseName(llvm::omp::getOpenMPClauseName(C->getClauseKind())); + StringRef ClauseName(getOpenMPClauseName(C->getClauseKind())); OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper() << ClauseName.drop_front() << "Clause"; } @@ -1517,8 +1517,7 @@ void TextNodeDumper::VisitOMPRequiresDecl(const OMPRequiresDecl *D) { } { ColorScope Color(OS, ShowColors, AttrColor); - StringRef ClauseName( - llvm::omp::getOpenMPClauseName(C->getClauseKind())); + StringRef ClauseName(getOpenMPClauseName(C->getClauseKind())); OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper() << ClauseName.drop_front() << "Clause"; } diff --git a/clang/lib/ASTMatchers/CMakeLists.txt b/clang/lib/ASTMatchers/CMakeLists.txt index cde871c..8f700ca 100644 --- a/clang/lib/ASTMatchers/CMakeLists.txt +++ b/clang/lib/ASTMatchers/CMakeLists.txt @@ -1,9 +1,6 @@ add_subdirectory(Dynamic) -set(LLVM_LINK_COMPONENTS - FrontendOpenMP - Support -) +set(LLVM_LINK_COMPONENTS support) add_clang_library(clangASTMatchers ASTMatchFinder.cpp diff --git a/clang/lib/ASTMatchers/Dynamic/Marshallers.h b/clang/lib/ASTMatchers/Dynamic/Marshallers.h index db9122a..48a454e 100644 --- a/clang/lib/ASTMatchers/Dynamic/Marshallers.h +++ b/clang/lib/ASTMatchers/Dynamic/Marshallers.h @@ -170,8 +170,9 @@ template <> struct ArgTypeTraits { private: static Optional getClauseKind(llvm::StringRef ClauseKind) { return llvm::StringSwitch>(ClauseKind) -#define OMP_CLAUSE_CLASS(Enum, Str, Class) .Case(#Enum, llvm::omp::Clause::Enum) -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(TextualSpelling, Class) \ + .Case("OMPC_" #TextualSpelling, OMPC_##TextualSpelling) +#include "clang/Basic/OpenMPKinds.def" .Default(llvm::None); } diff --git a/clang/lib/Analysis/CMakeLists.txt b/clang/lib/Analysis/CMakeLists.txt index 3333eab..c1d0d6e 100644 --- a/clang/lib/Analysis/CMakeLists.txt +++ b/clang/lib/Analysis/CMakeLists.txt @@ -1,5 +1,4 @@ set(LLVM_LINK_COMPONENTS - FrontendOpenMP Support ) diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp index 981bd7a..7a7c66c 100644 --- a/clang/lib/Basic/OpenMPKinds.cpp +++ b/clang/lib/Basic/OpenMPKinds.cpp @@ -20,6 +20,50 @@ using namespace clang; using namespace llvm::omp; +OpenMPClauseKind clang::getOpenMPClauseKind(StringRef Str) { + // 'flush' clause cannot be specified explicitly, because this is an implicit + // clause for 'flush' directive. If the 'flush' clause is explicitly specified + // the Parser should generate a warning about extra tokens at the end of the + // directive. + // 'depobj' clause cannot be specified explicitly, because this is an implicit + // clause for 'depobj' directive. If the 'depobj' clause is explicitly + // specified the Parser should generate a warning about extra tokens at the + // end of the directive. + if (llvm::StringSwitch(Str) + .Case("flush", true) + .Case("depobj", true) + .Default(false)) + return OMPC_unknown; + return llvm::StringSwitch(Str) +#define OPENMP_CLAUSE(Name, Class) .Case(#Name, OMPC_##Name) +#include "clang/Basic/OpenMPKinds.def" + .Case("uniform", OMPC_uniform) + .Case("device_type", OMPC_device_type) + .Case("match", OMPC_match) + .Default(OMPC_unknown); +} + +const char *clang::getOpenMPClauseName(OpenMPClauseKind Kind) { + assert(Kind <= OMPC_unknown); + switch (Kind) { + case OMPC_unknown: + return "unknown"; +#define OPENMP_CLAUSE(Name, Class) \ + case OMPC_##Name: \ + return #Name; +#include "clang/Basic/OpenMPKinds.def" + case OMPC_uniform: + return "uniform"; + case OMPC_threadprivate: + return "threadprivate or thread local"; + case OMPC_device_type: + return "device_type"; + case OMPC_match: + return "match"; + } + llvm_unreachable("Invalid OpenMP clause kind"); +} + unsigned clang::getOpenMPSimpleClauseType(OpenMPClauseKind Kind, StringRef Str) { switch (Kind) { diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp index b6db635..aa6b6bc 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp @@ -341,7 +341,8 @@ class CheckVarsEscapingDeclContext final if (!Attr) return; if (((Attr->getCaptureKind() != OMPC_map) && - !isOpenMPPrivate(Attr->getCaptureKind())) || + !isOpenMPPrivate( + static_cast(Attr->getCaptureKind()))) || ((Attr->getCaptureKind() == OMPC_map) && !FD->getType()->isAnyPointerType())) return; diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index af4ea4c..147d1b2 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -1387,7 +1387,7 @@ bool Parser::parseOMPDeclareVariantMatchClause(SourceLocation Loc, // Parse '('. BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end); if (T.expectAndConsume(diag::err_expected_lparen_after, - getOpenMPClauseName(OMPC_match).data())) { + getOpenMPClauseName(OMPC_match))) { while (!SkipUntil(tok::annot_pragma_openmp_end, StopBeforeMatch)) ; // Skip the last annot_pragma_openmp_end. @@ -1434,7 +1434,7 @@ parseOpenMPSimpleClause(Parser &P, OpenMPClauseKind Kind) { // Parse '('. BalancedDelimiterTracker T(P, tok::l_paren, tok::annot_pragma_openmp_end); if (T.expectAndConsume(diag::err_expected_lparen_after, - getOpenMPClauseName(Kind).data())) + getOpenMPClauseName(Kind))) return llvm::None; unsigned Type = getOpenMPSimpleClauseType( @@ -1673,18 +1673,18 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( SmallVector Clauses; if (Tok.isNot(tok::annot_pragma_openmp_end)) { SmallVector, - unsigned(OMPC_unknown) + 1> - FirstClauses(unsigned(OMPC_unknown) + 1); + OMPC_unknown + 1> + FirstClauses(OMPC_unknown + 1); while (Tok.isNot(tok::annot_pragma_openmp_end)) { OpenMPClauseKind CKind = Tok.isAnnotation() ? OMPC_unknown : getOpenMPClauseKind(PP.getSpelling(Tok)); Actions.StartOpenMPClause(CKind); - OMPClause *Clause = ParseOpenMPClause( - OMPD_allocate, CKind, !FirstClauses[unsigned(CKind)].getInt()); + OMPClause *Clause = ParseOpenMPClause(OMPD_allocate, CKind, + !FirstClauses[CKind].getInt()); SkipUntil(tok::comma, tok::identifier, tok::annot_pragma_openmp_end, StopBeforeMatch); - FirstClauses[unsigned(CKind)].setInt(true); + FirstClauses[CKind].setInt(true); if (Clause != nullptr) Clauses.push_back(Clause); if (Tok.is(tok::annot_pragma_openmp_end)) { @@ -1708,9 +1708,8 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( case OMPD_requires: { SourceLocation StartLoc = ConsumeToken(); SmallVector Clauses; - SmallVector, - unsigned(OMPC_unknown) + 1> - FirstClauses(unsigned(OMPC_unknown) + 1); + SmallVector, OMPC_unknown + 1> + FirstClauses(OMPC_unknown + 1); if (Tok.is(tok::annot_pragma_openmp_end)) { Diag(Tok, diag::err_omp_expected_clause) << getOpenMPDirectiveName(OMPD_requires); @@ -1721,11 +1720,11 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( ? OMPC_unknown : getOpenMPClauseKind(PP.getSpelling(Tok)); Actions.StartOpenMPClause(CKind); - OMPClause *Clause = ParseOpenMPClause( - OMPD_requires, CKind, !FirstClauses[unsigned(CKind)].getInt()); + OMPClause *Clause = ParseOpenMPClause(OMPD_requires, CKind, + !FirstClauses[CKind].getInt()); SkipUntil(tok::comma, tok::identifier, tok::annot_pragma_openmp_end, StopBeforeMatch); - FirstClauses[unsigned(CKind)].setInt(true); + FirstClauses[CKind].setInt(true); if (Clause != nullptr) Clauses.push_back(Clause); if (Tok.is(tok::annot_pragma_openmp_end)) { @@ -2024,9 +2023,8 @@ Parser::ParseOpenMPDeclarativeOrExecutableDirective(ParsedStmtContext StmtCtx) { ParsingOpenMPDirectiveRAII DirScope(*this); ParenBraceBracketBalancer BalancerRAIIObj(*this); SmallVector Clauses; - SmallVector, - unsigned(OMPC_unknown) + 1> - FirstClauses(unsigned(OMPC_unknown) + 1); + SmallVector, OMPC_unknown + 1> + FirstClauses(OMPC_unknown + 1); unsigned ScopeFlags = Scope::FnScope | Scope::DeclScope | Scope::CompoundStmtScope | Scope::OpenMPDirectiveScope; SourceLocation Loc = ConsumeAnnotationToken(), EndLoc; @@ -2071,18 +2069,18 @@ Parser::ParseOpenMPDeclarativeOrExecutableDirective(ParsedStmtContext StmtCtx) { SmallVector Clauses; if (Tok.isNot(tok::annot_pragma_openmp_end)) { SmallVector, - unsigned(OMPC_unknown) + 1> - FirstClauses(unsigned(OMPC_unknown) + 1); + OMPC_unknown + 1> + FirstClauses(OMPC_unknown + 1); while (Tok.isNot(tok::annot_pragma_openmp_end)) { OpenMPClauseKind CKind = Tok.isAnnotation() ? OMPC_unknown : getOpenMPClauseKind(PP.getSpelling(Tok)); Actions.StartOpenMPClause(CKind); - OMPClause *Clause = ParseOpenMPClause( - OMPD_allocate, CKind, !FirstClauses[unsigned(CKind)].getInt()); + OMPClause *Clause = ParseOpenMPClause(OMPD_allocate, CKind, + !FirstClauses[CKind].getInt()); SkipUntil(tok::comma, tok::identifier, tok::annot_pragma_openmp_end, StopBeforeMatch); - FirstClauses[unsigned(CKind)].setInt(true); + FirstClauses[CKind].setInt(true); if (Clause != nullptr) Clauses.push_back(Clause); if (Tok.is(tok::annot_pragma_openmp_end)) { @@ -2250,11 +2248,11 @@ Parser::ParseOpenMPDeclarativeOrExecutableDirective(ParsedStmtContext StmtCtx) { ImplicitClauseAllowed = false; Actions.StartOpenMPClause(CKind); HasImplicitClause = false; - OMPClause *Clause = ParseOpenMPClause( - DKind, CKind, !FirstClauses[unsigned(CKind)].getInt()); - FirstClauses[unsigned(CKind)].setInt(true); + OMPClause *Clause = + ParseOpenMPClause(DKind, CKind, !FirstClauses[CKind].getInt()); + FirstClauses[CKind].setInt(true); if (Clause) { - FirstClauses[unsigned(CKind)].setPointer(Clause); + FirstClauses[CKind].setPointer(Clause); Clauses.push_back(Clause); } @@ -2271,7 +2269,7 @@ Parser::ParseOpenMPDeclarativeOrExecutableDirective(ParsedStmtContext StmtCtx) { // OpenMP [2.13.8, ordered Construct, Syntax] // If the depend clause is specified, the ordered construct is a stand-alone // directive. - if (DKind == OMPD_ordered && FirstClauses[unsigned(OMPC_depend)].getInt()) { + if (DKind == OMPD_ordered && FirstClauses[OMPC_depend].getInt()) { if ((StmtCtx & ParsedStmtContext::AllowStandaloneOpenMPDirectives) == ParsedStmtContext()) { Diag(Loc, diag::err_omp_immediate_directive) @@ -2756,7 +2754,7 @@ OMPClause *Parser::ParseOpenMPSingleExprWithArgClause(OpenMPDirectiveKind DKind, // Parse '('. BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end); if (T.expectAndConsume(diag::err_expected_lparen_after, - getOpenMPClauseName(Kind).data())) + getOpenMPClauseName(Kind))) return nullptr; ExprResult Val; @@ -3068,7 +3066,7 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind, // Parse '('. BalancedDelimiterTracker T(*this, tok::l_paren, tok::annot_pragma_openmp_end); if (T.expectAndConsume(diag::err_expected_lparen_after, - getOpenMPClauseName(Kind).data())) + getOpenMPClauseName(Kind))) return true; bool NeedRParenForLinear = false; diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 20b6ce4..7d2ae17 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -2231,7 +2231,7 @@ void Sema::setOpenMPCaptureKind(FieldDecl *FD, const ValueDecl *D, } } if (OMPC != OMPC_unknown) - FD->addAttr(OMPCaptureKindAttr::CreateImplicit(Context, unsigned(OMPC))); + FD->addAttr(OMPCaptureKindAttr::CreateImplicit(Context, OMPC)); } bool Sema::isOpenMPTargetCapturedDecl(const ValueDecl *D, unsigned Level, diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 795a2a4..82cfa24 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -730,10 +730,10 @@ public: #define ABSTRACT_STMT(Stmt) #include "clang/AST/StmtNodes.inc" -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ +#define OPENMP_CLAUSE(Name, Class) \ LLVM_ATTRIBUTE_NOINLINE \ OMPClause *Transform ## Class(Class *S); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#include "clang/Basic/OpenMPKinds.def" /// Build a new qualified type given its unqualified type and type location. /// @@ -3585,10 +3585,10 @@ OMPClause *TreeTransform::TransformOMPClause(OMPClause *S) { switch (S->getClauseKind()) { default: break; // Transform individual clause nodes -#define OMP_CLAUSE_CLASS(Enum, Str, Class) \ - case Enum: \ +#define OPENMP_CLAUSE(Name, Class) \ + case OMPC_ ## Name : \ return getDerived().Transform ## Class(cast(S)); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#include "clang/Basic/OpenMPKinds.def" } return S; diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index f01b64b..bea9bdd 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -11613,8 +11613,8 @@ public: OMPClauseReader(ASTRecordReader &Record) : Record(Record), Context(Record.getContext()) {} -#define OMP_CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *C); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *C); +#include "clang/Basic/OpenMPKinds.def" OMPClause *readClause(); void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C); void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C); @@ -11628,149 +11628,149 @@ OMPClause *ASTRecordReader::readOMPClause() { OMPClause *OMPClauseReader::readClause() { OMPClause *C = nullptr; - switch (llvm::omp::Clause(Record.readInt())) { - case llvm::omp::OMPC_if: + switch (Record.readInt()) { + case OMPC_if: C = new (Context) OMPIfClause(); break; - case llvm::omp::OMPC_final: + case OMPC_final: C = new (Context) OMPFinalClause(); break; - case llvm::omp::OMPC_num_threads: + case OMPC_num_threads: C = new (Context) OMPNumThreadsClause(); break; - case llvm::omp::OMPC_safelen: + case OMPC_safelen: C = new (Context) OMPSafelenClause(); break; - case llvm::omp::OMPC_simdlen: + case OMPC_simdlen: C = new (Context) OMPSimdlenClause(); break; - case llvm::omp::OMPC_allocator: + case OMPC_allocator: C = new (Context) OMPAllocatorClause(); break; - case llvm::omp::OMPC_collapse: + case OMPC_collapse: C = new (Context) OMPCollapseClause(); break; - case llvm::omp::OMPC_default: + case OMPC_default: C = new (Context) OMPDefaultClause(); break; - case llvm::omp::OMPC_proc_bind: + case OMPC_proc_bind: C = new (Context) OMPProcBindClause(); break; - case llvm::omp::OMPC_schedule: + case OMPC_schedule: C = new (Context) OMPScheduleClause(); break; - case llvm::omp::OMPC_ordered: + case OMPC_ordered: C = OMPOrderedClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_nowait: + case OMPC_nowait: C = new (Context) OMPNowaitClause(); break; - case llvm::omp::OMPC_untied: + case OMPC_untied: C = new (Context) OMPUntiedClause(); break; - case llvm::omp::OMPC_mergeable: + case OMPC_mergeable: C = new (Context) OMPMergeableClause(); break; - case llvm::omp::OMPC_read: + case OMPC_read: C = new (Context) OMPReadClause(); break; - case llvm::omp::OMPC_write: + case OMPC_write: C = new (Context) OMPWriteClause(); break; - case llvm::omp::OMPC_update: + case OMPC_update: C = OMPUpdateClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_capture: + case OMPC_capture: C = new (Context) OMPCaptureClause(); break; - case llvm::omp::OMPC_seq_cst: + case OMPC_seq_cst: C = new (Context) OMPSeqCstClause(); break; - case llvm::omp::OMPC_acq_rel: + case OMPC_acq_rel: C = new (Context) OMPAcqRelClause(); break; - case llvm::omp::OMPC_acquire: + case OMPC_acquire: C = new (Context) OMPAcquireClause(); break; - case llvm::omp::OMPC_release: + case OMPC_release: C = new (Context) OMPReleaseClause(); break; - case llvm::omp::OMPC_relaxed: + case OMPC_relaxed: C = new (Context) OMPRelaxedClause(); break; - case llvm::omp::OMPC_threads: + case OMPC_threads: C = new (Context) OMPThreadsClause(); break; - case llvm::omp::OMPC_simd: + case OMPC_simd: C = new (Context) OMPSIMDClause(); break; - case llvm::omp::OMPC_nogroup: + case OMPC_nogroup: C = new (Context) OMPNogroupClause(); break; - case llvm::omp::OMPC_unified_address: + case OMPC_unified_address: C = new (Context) OMPUnifiedAddressClause(); break; - case llvm::omp::OMPC_unified_shared_memory: + case OMPC_unified_shared_memory: C = new (Context) OMPUnifiedSharedMemoryClause(); break; - case llvm::omp::OMPC_reverse_offload: + case OMPC_reverse_offload: C = new (Context) OMPReverseOffloadClause(); break; - case llvm::omp::OMPC_dynamic_allocators: + case OMPC_dynamic_allocators: C = new (Context) OMPDynamicAllocatorsClause(); break; - case llvm::omp::OMPC_atomic_default_mem_order: + case OMPC_atomic_default_mem_order: C = new (Context) OMPAtomicDefaultMemOrderClause(); break; - case llvm::omp::OMPC_private: + case OMPC_private: C = OMPPrivateClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_firstprivate: + case OMPC_firstprivate: C = OMPFirstprivateClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_lastprivate: + case OMPC_lastprivate: C = OMPLastprivateClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_shared: + case OMPC_shared: C = OMPSharedClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_reduction: + case OMPC_reduction: C = OMPReductionClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_task_reduction: + case OMPC_task_reduction: C = OMPTaskReductionClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_in_reduction: + case OMPC_in_reduction: C = OMPInReductionClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_linear: + case OMPC_linear: C = OMPLinearClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_aligned: + case OMPC_aligned: C = OMPAlignedClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_copyin: + case OMPC_copyin: C = OMPCopyinClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_copyprivate: + case OMPC_copyprivate: C = OMPCopyprivateClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_flush: + case OMPC_flush: C = OMPFlushClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_depobj: + case OMPC_depobj: C = OMPDepobjClause::CreateEmpty(Context); break; - case llvm::omp::OMPC_depend: { + case OMPC_depend: { unsigned NumVars = Record.readInt(); unsigned NumLoops = Record.readInt(); C = OMPDependClause::CreateEmpty(Context, NumVars, NumLoops); break; } - case llvm::omp::OMPC_device: + case OMPC_device: C = new (Context) OMPDeviceClause(); break; - case llvm::omp::OMPC_map: { + case OMPC_map: { OMPMappableExprListSizeTy Sizes; Sizes.NumVars = Record.readInt(); Sizes.NumUniqueDeclarations = Record.readInt(); @@ -11779,31 +11779,31 @@ OMPClause *OMPClauseReader::readClause() { C = OMPMapClause::CreateEmpty(Context, Sizes); break; } - case llvm::omp::OMPC_num_teams: + case OMPC_num_teams: C = new (Context) OMPNumTeamsClause(); break; - case llvm::omp::OMPC_thread_limit: + case OMPC_thread_limit: C = new (Context) OMPThreadLimitClause(); break; - case llvm::omp::OMPC_priority: + case OMPC_priority: C = new (Context) OMPPriorityClause(); break; - case llvm::omp::OMPC_grainsize: + case OMPC_grainsize: C = new (Context) OMPGrainsizeClause(); break; - case llvm::omp::OMPC_num_tasks: + case OMPC_num_tasks: C = new (Context) OMPNumTasksClause(); break; - case llvm::omp::OMPC_hint: + case OMPC_hint: C = new (Context) OMPHintClause(); break; - case llvm::omp::OMPC_dist_schedule: + case OMPC_dist_schedule: C = new (Context) OMPDistScheduleClause(); break; - case llvm::omp::OMPC_defaultmap: + case OMPC_defaultmap: C = new (Context) OMPDefaultmapClause(); break; - case llvm::omp::OMPC_to: { + case OMPC_to: { OMPMappableExprListSizeTy Sizes; Sizes.NumVars = Record.readInt(); Sizes.NumUniqueDeclarations = Record.readInt(); @@ -11812,7 +11812,7 @@ OMPClause *OMPClauseReader::readClause() { C = OMPToClause::CreateEmpty(Context, Sizes); break; } - case llvm::omp::OMPC_from: { + case OMPC_from: { OMPMappableExprListSizeTy Sizes; Sizes.NumVars = Record.readInt(); Sizes.NumUniqueDeclarations = Record.readInt(); @@ -11821,7 +11821,7 @@ OMPClause *OMPClauseReader::readClause() { C = OMPFromClause::CreateEmpty(Context, Sizes); break; } - case llvm::omp::OMPC_use_device_ptr: { + case OMPC_use_device_ptr: { OMPMappableExprListSizeTy Sizes; Sizes.NumVars = Record.readInt(); Sizes.NumUniqueDeclarations = Record.readInt(); @@ -11830,7 +11830,7 @@ OMPClause *OMPClauseReader::readClause() { C = OMPUseDevicePtrClause::CreateEmpty(Context, Sizes); break; } - case llvm::omp::OMPC_is_device_ptr: { + case OMPC_is_device_ptr: { OMPMappableExprListSizeTy Sizes; Sizes.NumVars = Record.readInt(); Sizes.NumUniqueDeclarations = Record.readInt(); @@ -11839,31 +11839,27 @@ OMPClause *OMPClauseReader::readClause() { C = OMPIsDevicePtrClause::CreateEmpty(Context, Sizes); break; } - case llvm::omp::OMPC_allocate: + case OMPC_allocate: C = OMPAllocateClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_nontemporal: + case OMPC_nontemporal: C = OMPNontemporalClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_inclusive: + case OMPC_inclusive: C = OMPInclusiveClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_exclusive: + case OMPC_exclusive: C = OMPExclusiveClause::CreateEmpty(Context, Record.readInt()); break; - case llvm::omp::OMPC_order: + case OMPC_order: C = new (Context) OMPOrderClause(); break; - case llvm::omp::OMPC_destroy: + case OMPC_destroy: C = new (Context) OMPDestroyClause(); break; - case llvm::omp::OMPC_detach: + case OMPC_detach: C = new (Context) OMPDetachClause(); break; -#define OMP_CLAUSE_NO_CLASS(Enum, Str) \ - case llvm::omp::Enum: \ - break; -#include "llvm/Frontend/OpenMP/OMPKinds.def" } assert(C && "Unknown OMPClause type"); diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 76e2dd6..f7c58ed 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -6037,8 +6037,8 @@ class OMPClauseWriter : public OMPClauseVisitor { public: OMPClauseWriter(ASTRecordWriter &Record) : Record(Record) {} -#define OMP_CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S); +#include "clang/Basic/OpenMPKinds.def" void writeClause(OMPClause *C); void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C); void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C); @@ -6051,7 +6051,7 @@ void ASTRecordWriter::writeOMPClause(OMPClause *C) { } void OMPClauseWriter::writeClause(OMPClause *C) { - Record.push_back(unsigned(C->getClauseKind())); + Record.push_back(C->getClauseKind()); Visit(C); Record.AddSourceLocation(C->getBeginLoc()); Record.AddSourceLocation(C->getEndLoc()); diff --git a/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt b/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt index bcf2dfd..b7fb0d9 100644 --- a/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt +++ b/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt @@ -1,5 +1,4 @@ set(LLVM_LINK_COMPONENTS - FrontendOpenMP Support ) diff --git a/clang/lib/StaticAnalyzer/Core/CMakeLists.txt b/clang/lib/StaticAnalyzer/Core/CMakeLists.txt index 057cdd4..dc2a627 100644 --- a/clang/lib/StaticAnalyzer/Core/CMakeLists.txt +++ b/clang/lib/StaticAnalyzer/Core/CMakeLists.txt @@ -1,7 +1,4 @@ -set(LLVM_LINK_COMPONENTS - FrontendOpenMP - Support -) +set(LLVM_LINK_COMPONENTS support) add_clang_library(clangStaticAnalyzerCore APSIntType.cpp diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 1267b9b..bb9fed1 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -2153,8 +2153,8 @@ class OMPClauseEnqueue : public ConstOMPClauseVisitor { public: OMPClauseEnqueue(EnqueueVisitor *Visitor) : Visitor(Visitor) {} -#define OMP_CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(const Class *C); -#include "llvm/Frontend/OpenMP/OMPKinds.def" +#define OPENMP_CLAUSE(Name, Class) void Visit##Class(const Class *C); +#include "clang/Basic/OpenMPKinds.def" void VisitOMPClauseWithPreInit(const OMPClauseWithPreInit *C); void VisitOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C); }; diff --git a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp index 428879d..fbf2ff1 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp @@ -2612,7 +2612,7 @@ TEST(HasExternalFormalLinkage, Basic) { } TEST(HasDefaultArgument, Basic) { - EXPECT_TRUE(matches("void x(int val = 0) {}", + EXPECT_TRUE(matches("void x(int val = 0) {}", parmVarDecl(hasDefaultArgument()))); EXPECT_TRUE(notMatches("void x(int val) {}", parmVarDecl(hasDefaultArgument()))); @@ -2665,7 +2665,7 @@ TEST(HasTrailingReturn, MatchesTrailingReturn) { EXPECT_TRUE(matches("auto Y() -> int { return 0; }", functionDecl(hasTrailingReturn()))); EXPECT_TRUE(matches("auto X() -> int;", functionDecl(hasTrailingReturn()))); - EXPECT_TRUE(notMatches("int X() { return 0; }", + EXPECT_TRUE(notMatches("int X() { return 0; }", functionDecl(hasTrailingReturn()))); EXPECT_TRUE(notMatches("int X();", functionDecl(hasTrailingReturn()))); EXPECT_TRUE(notMatchesC("void X();", functionDecl(hasTrailingReturn()))); @@ -2891,8 +2891,8 @@ void x(int x) { } TEST(OMPExecutableDirective, isAllowedToContainClauseKind) { - auto Matcher = ompExecutableDirective( - isAllowedToContainClauseKind(llvm::omp::OMPC_default)); + auto Matcher = + ompExecutableDirective(isAllowedToContainClauseKind(OMPC_default)); const std::string Source0 = R"( void x() { diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h index d32fa8d..7cda319 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h +++ b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h @@ -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 diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def index 0946835..c80ecc7 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def +++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def @@ -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, ) diff --git a/llvm/lib/Frontend/OpenMP/OMPConstants.cpp b/llvm/lib/Frontend/OpenMP/OMPConstants.cpp index edd857d..6ee4495 100644 --- a/llvm/lib/Frontend/OpenMP/OMPConstants.cpp +++ b/llvm/lib/Frontend/OpenMP/OMPConstants.cpp @@ -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(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 -- 2.7.4