clang 24.0.0git
OMPAtomicDirective Class Reference

This represents '#pragma omp atomic' directive. More...

#include "clang/AST/StmtOpenMP.h"

Inheritance diagram for OMPAtomicDirective:
[legend]

Classes

struct  Expressions

Public Member Functions

Expr * getX ()
 Get 'x' part of the associated expression/statement.
const Expr * getX () const
Expr * getUpdateExpr ()
 Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
const Expr * getUpdateExpr () const
bool isXLHSInRHSPart () const
 Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and false if it has form 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
bool isPostfixUpdate () const
 Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated to the new value of 'x'.
bool isFailOnly () const
 Return true if 'v' is updated only when the condition is evaluated false (compare capture only).
Expr * getV ()
 Get 'v' part of the associated expression/statement.
const Expr * getV () const
Expr * getR ()
 Get 'r' part of the associated expression/statement.
const Expr * getR () const
Expr * getExpr ()
 Get 'expr' part of the associated expression/statement.
const Expr * getExpr () const
Expr * getD ()
 Get 'd' part of the associated expression/statement.
Expr * getD () const
Expr * getCondExpr ()
 Get the 'cond' part of the source atomic expression.
Expr * getCondExpr () const

Static Public Member Functions

static OMPAtomicDirectiveCreate (const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expressions Exprs)
 Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see Section 2.12.6, atomic Construct, for detailed description of 'x', 'v' and 'expr').
static OMPAtomicDirectiveCreateEmpty (const ASTContext &C, unsigned NumClauses, EmptyShell)
 Creates an empty directive with the place for NumClauses clauses.
static bool classof (const Stmt *T)

Friends

class ASTStmtReader
class OMPExecutableDirective

Detailed Description

This represents '#pragma omp atomic' directive.

#pragma omp atomic capture

In this example directive '#pragma omp atomic' has clause 'capture'.

Definition at line 3079 of file StmtOpenMP.h.

Member Function Documentation

◆ classof()

bool OMPAtomicDirective::classof ( const Stmt * T)
inlinestatic

Definition at line 3271 of file StmtOpenMP.h.

◆ Create()

OMPAtomicDirective * OMPAtomicDirective::Create ( const ASTContext & C,
SourceLocation StartLoc,
SourceLocation EndLoc,
ArrayRef< OMPClause * > Clauses,
Stmt * AssociatedStmt,
Expressions Exprs )
static

Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see Section 2.12.6, atomic Construct, for detailed description of 'x', 'v' and 'expr').

Parameters
CAST context.
StartLocStarting location of the directive kind.
EndLocEnding Location of the directive.
ClausesList of clauses.
AssociatedStmtStatement, associated with the directive.
ExprsAssociated expressions or statements.

Definition at line 1142 of file StmtOpenMP.cpp.

References clang::C, OMPAtomicDirective::Expressions::Cond, OMPAtomicDirective::Expressions::D, OMPAtomicDirective::Expressions::E, OMPAtomicDirective::Expressions::IsFailOnly, OMPAtomicDirective::Expressions::IsPostfixUpdate, OMPAtomicDirective::Expressions::IsXLHSInRHSPart, OMPAtomicDirective::Expressions::R, OMPAtomicDirective::Expressions::UE, OMPAtomicDirective::Expressions::V, and OMPAtomicDirective::Expressions::X.

Referenced by clang::SemaOpenMP::ActOnOpenMPAtomicDirective().

◆ CreateEmpty()

OMPAtomicDirective * OMPAtomicDirective::CreateEmpty ( const ASTContext & C,
unsigned NumClauses,
EmptyShell  )
static

Creates an empty directive with the place for NumClauses clauses.

Parameters
CAST context.
NumClausesNumber of clauses.

Definition at line 1160 of file StmtOpenMP.cpp.

References clang::C.

◆ getCondExpr() [1/2]

Expr * OMPAtomicDirective::getCondExpr ( )
inline

Get the 'cond' part of the source atomic expression.

Definition at line 3264 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ getCondExpr() [2/2]

Expr * OMPAtomicDirective::getCondExpr ( ) const
inline

Definition at line 3267 of file StmtOpenMP.h.

◆ getD() [1/2]

Expr * OMPAtomicDirective::getD ( )
inline

Get 'd' part of the associated expression/statement.

Definition at line 3257 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ getD() [2/2]

Expr * OMPAtomicDirective::getD ( ) const
inline

Definition at line 3260 of file StmtOpenMP.h.

◆ getExpr() [1/2]

Expr * OMPAtomicDirective::getExpr ( )
inline

Get 'expr' part of the associated expression/statement.

Definition at line 3250 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ getExpr() [2/2]

const Expr * OMPAtomicDirective::getExpr ( ) const
inline

Definition at line 3253 of file StmtOpenMP.h.

◆ getR() [1/2]

Expr * OMPAtomicDirective::getR ( )
inline

Get 'r' part of the associated expression/statement.

Definition at line 3243 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ getR() [2/2]

const Expr * OMPAtomicDirective::getR ( ) const
inline

Definition at line 3246 of file StmtOpenMP.h.

◆ getUpdateExpr() [1/2]

Expr * OMPAtomicDirective::getUpdateExpr ( )
inline

Get helper expression of the form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.

Definition at line 3217 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ getUpdateExpr() [2/2]

const Expr * OMPAtomicDirective::getUpdateExpr ( ) const
inline

Definition at line 3221 of file StmtOpenMP.h.

◆ getV() [1/2]

Expr * OMPAtomicDirective::getV ( )
inline

Get 'v' part of the associated expression/statement.

Definition at line 3236 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ getV() [2/2]

const Expr * OMPAtomicDirective::getV ( ) const
inline

Definition at line 3239 of file StmtOpenMP.h.

◆ getX() [1/2]

Expr * OMPAtomicDirective::getX ( )
inline

Get 'x' part of the associated expression/statement.

Definition at line 3208 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ getX() [2/2]

const Expr * OMPAtomicDirective::getX ( ) const
inline

Definition at line 3211 of file StmtOpenMP.h.

◆ isFailOnly()

bool OMPAtomicDirective::isFailOnly ( ) const
inline

Return true if 'v' is updated only when the condition is evaluated false (compare capture only).

Definition at line 3234 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ isPostfixUpdate()

bool OMPAtomicDirective::isPostfixUpdate ( ) const
inline

Return true if 'v' expression must be updated to original value of 'x', false if 'v' must be updated to the new value of 'x'.

Definition at line 3231 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ isXLHSInRHSPart()

bool OMPAtomicDirective::isXLHSInRHSPart ( ) const
inline

Return true if helper update expression has form 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and false if it has form 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.

Definition at line 3228 of file StmtOpenMP.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective().

◆ ASTStmtReader

friend class ASTStmtReader
friend

Definition at line 3080 of file StmtOpenMP.h.

References ASTStmtReader.

Referenced by ASTStmtReader.

◆ OMPExecutableDirective

friend class OMPExecutableDirective
friend

Definition at line 3081 of file StmtOpenMP.h.

References OMPExecutableDirective, and uint8_t.

Referenced by OMPExecutableDirective.


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