diff options
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.h')
| -rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.h | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index b9c1a35434f..09e3272e943 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -230,6 +230,13 @@ private: llvm::Value *Ctor, llvm::Value *CopyCtor, llvm::Value *Dtor, SourceLocation Loc); + /// \brief Returns corresponding lock object for the specified critical region + /// name. If the lock object does not exist it is created, otherwise the + /// reference to the existing copy is returned. + /// \param CriticalName Name of the critical region. + /// + llvm::Value *GetCriticalRegionLock(StringRef CriticalName); + public: explicit CGOpenMPRuntime(CodeGenModule &CGM); virtual ~CGOpenMPRuntime() {} @@ -270,28 +277,14 @@ public: llvm::Value *OutlinedFn, llvm::Value *CapturedStruct); - /// \brief Returns corresponding lock object for the specified critical region - /// name. If the lock object does not exist it is created, otherwise the - /// reference to the existing copy is returned. + /// \brief Emits a critical region. /// \param CriticalName Name of the critical region. - /// - llvm::Value *GetCriticalRegionLock(StringRef CriticalName); - - /// \brief Emits start of the critical region by calling void - /// __kmpc_critical(ident_t *loc, kmp_int32 global_tid, kmp_critical_name - /// * \a RegionLock) - /// \param RegionLock The lock object for critical region. - virtual void EmitOMPCriticalRegionStart(CodeGenFunction &CGF, - llvm::Value *RegionLock, - SourceLocation Loc); - - /// \brief Emits end of the critical region by calling void - /// __kmpc_end_critical(ident_t *loc, kmp_int32 global_tid, kmp_critical_name - /// * \a RegionLock) - /// \param RegionLock The lock object for critical region. - virtual void EmitOMPCriticalRegionEnd(CodeGenFunction &CGF, - llvm::Value *RegionLock, - SourceLocation Loc); + /// \param CriticalOpGen Generator for the statement associated with the given + /// critical region. + virtual void EmitOMPCriticalRegion(CodeGenFunction &CGF, + StringRef CriticalName, + const std::function<void()> &CriticalOpGen, + SourceLocation Loc); /// \brief Emits a barrier for OpenMP threads. /// \param Flags Flags for the barrier. |

