clang 22.0.0git
clang::AtomicScopeModel Class Referenceabstract

Defines the interface for sync scope model. More...

#include "clang/Basic/SyncScope.h"

Inheritance diagram for clang::AtomicScopeModel:
[legend]

Public Member Functions

virtual ~AtomicScopeModel ()
virtual SyncScope map (unsigned S) const =0
 Maps language specific sync scope values to internal SyncScope enum.
virtual bool isValid (unsigned S) const =0
 Check if the compile-time constant sync scope value is valid.
virtual ArrayRef< unsignedgetRuntimeValues () const =0
 Get all possible sync scope values that might be encountered at runtime for the current language.
virtual unsigned getFallBackValue () const =0
 If atomic builtin function is called with invalid sync scope value at runtime, it will fall back to a valid sync scope value returned by this function.

Static Public Member Functions

static std::unique_ptr< AtomicScopeModelcreate (AtomicScopeModelKind K)
 Create an atomic scope model by AtomicScopeModelKind.

Detailed Description

Defines the interface for sync scope model.

Definition at line 98 of file SyncScope.h.

Constructor & Destructor Documentation

◆ ~AtomicScopeModel()

virtual clang::AtomicScopeModel::~AtomicScopeModel ( )
inlinevirtual

Definition at line 100 of file SyncScope.h.

Member Function Documentation

◆ create()

std::unique_ptr< AtomicScopeModel > clang::AtomicScopeModel::create ( AtomicScopeModelKind K)
inlinestatic

Create an atomic scope model by AtomicScopeModelKind.

Returns
an empty std::unique_ptr for AtomicScopeModelKind::None.

Definition at line 273 of file SyncScope.h.

References clang::Generic, clang::HIP, clang::None, and clang::OpenCL.

Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), and clang::AtomicExpr::getScopeModel().

◆ getFallBackValue()

virtual unsigned clang::AtomicScopeModel::getFallBackValue ( ) const
pure virtual

If atomic builtin function is called with invalid sync scope value at runtime, it will fall back to a valid sync scope value returned by this function.

Implemented in clang::AtomicScopeGenericModel, clang::AtomicScopeHIPModel, and clang::AtomicScopeOpenCLModel.

◆ getRuntimeValues()

virtual ArrayRef< unsigned > clang::AtomicScopeModel::getRuntimeValues ( ) const
pure virtual

Get all possible sync scope values that might be encountered at runtime for the current language.

Implemented in clang::AtomicScopeGenericModel, clang::AtomicScopeHIPModel, and clang::AtomicScopeOpenCLModel.

◆ isValid()

virtual bool clang::AtomicScopeModel::isValid ( unsigned S) const
pure virtual

Check if the compile-time constant sync scope value is valid.

Implemented in clang::AtomicScopeGenericModel, clang::AtomicScopeHIPModel, and clang::AtomicScopeOpenCLModel.

◆ map()

virtual SyncScope clang::AtomicScopeModel::map ( unsigned S) const
pure virtual

Maps language specific sync scope values to internal SyncScope enum.

Implemented in clang::AtomicScopeGenericModel, clang::AtomicScopeHIPModel, and clang::AtomicScopeOpenCLModel.


The documentation for this class was generated from the following file: