clang 22.0.0git
clang::OMPMessageClause Class Referencefinal

This represents the 'message' clause in the '#pragma omp error' and the '#pragma omp parallel' directives. More...

#include "clang/AST/OpenMPClause.h"

Inheritance diagram for clang::OMPMessageClause:
[legend]

Public Member Functions

 OMPMessageClause (Expr *MS, Stmt *HelperMS, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
 Build 'message' clause with message string argument.
 OMPMessageClause ()
 Build an empty clause.
ExprgetMessageString () const
 Returns message string of the clause.
std::optional< std::string > tryEvaluateString (ASTContext &Ctx) const
 Try to evaluate the message string at compile time.
Public Member Functions inherited from clang::OMPOneStmtClause< llvm::omp::OMPC_message, OMPClause >
 OMPOneStmtClause (Stmt *S, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
TgetStmtAs () const
 Return the associated statement, potentially casted to T.
void setLParenLoc (SourceLocation Loc)
 Sets the location of '('.
SourceLocation getLParenLoc () const
 Returns the location of '('.
child_range children ()
child_range used_children ()
Public Member Functions inherited from clang::OMPClause
SourceLocation getBeginLoc () const
 Returns the starting location of the clause.
SourceLocation getEndLoc () const
 Returns the ending location of the clause.
void setLocStart (SourceLocation Loc)
 Sets the starting location of the clause.
void setLocEnd (SourceLocation Loc)
 Sets the ending location of the clause.
OpenMPClauseKind getClauseKind () const
 Returns kind of OpenMP clause (private, shared, reduction, etc.).
bool isImplicit () const
child_range children ()
const_child_range children () const
child_range used_children ()
 Get the iterator range for the expressions used in the clauses.
const_child_range used_children () const
Public Member Functions inherited from clang::OMPClauseWithPreInit
const StmtgetPreInitStmt () const
 Get pre-initialization statement for the clause.
StmtgetPreInitStmt ()
 Get pre-initialization statement for the clause.
OpenMPDirectiveKind getCaptureRegion () const
 Get capture region for the stmt in the clause.

Friends

class OMPClauseReader

Additional Inherited Members

Public Types inherited from clang::OMPOneStmtClause< llvm::omp::OMPC_message, OMPClause >
using child_iterator
using const_child_iterator
using child_range
using const_child_range
Public Types inherited from clang::OMPClause
using child_iterator = StmtIterator
using const_child_iterator = ConstStmtIterator
using child_range = llvm::iterator_range<child_iterator>
using const_child_range = llvm::iterator_range<const_child_iterator>
Static Public Member Functions inherited from clang::OMPOneStmtClause< llvm::omp::OMPC_message, OMPClause >
static bool classof (const OMPClause *T)
Static Public Member Functions inherited from clang::OMPClause
static bool classof (const OMPClause *)
Static Public Member Functions inherited from clang::OMPClauseWithPreInit
static OMPClauseWithPreInitget (OMPClause *C)
static const OMPClauseWithPreInitget (const OMPClause *C)
Protected Member Functions inherited from clang::OMPOneStmtClause< llvm::omp::OMPC_message, OMPClause >
void setStmt (Stmt *S)
Protected Member Functions inherited from clang::OMPClause
 OMPClause (OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
Protected Member Functions inherited from clang::OMPClauseWithPreInit
 OMPClauseWithPreInit (const OMPClause *This)
void setPreInitStmt (Stmt *S, OpenMPDirectiveKind ThisRegion=llvm::omp::OMPD_unknown)
 Set pre-initialization statement for the clause.

Detailed Description

This represents the 'message' clause in the '#pragma omp error' and the '#pragma omp parallel' directives.

#pragma omp error message("GNU compiler required.")

In this example directive '#pragma omp error' has simple 'message' clause with user error message of "GNU compiler required.".

Definition at line 1888 of file OpenMPClause.h.

Constructor & Destructor Documentation

◆ OMPMessageClause() [1/2]

clang::OMPMessageClause::OMPMessageClause ( Expr * MS,
Stmt * HelperMS,
OpenMPDirectiveKind CaptureRegion,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc )
inline

Build 'message' clause with message string argument.

Parameters
MSArgument of the clause (message string).
HelperMSHelper statement for the construct.
CaptureRegionInnermost OpenMP region where expressions in this clause must be captured.
StartLocStarting location of the clause.
LParenLocLocation of '('.
EndLocEnding location of the clause.

Definition at line 1906 of file OpenMPClause.h.

References clang::OMPClauseWithPreInit::OMPClauseWithPreInit(), clang::OMPOneStmtClause< llvm::omp::OMPC_message, OMPClause >::OMPOneStmtClause(), and clang::OMPClauseWithPreInit::setPreInitStmt().

◆ OMPMessageClause() [2/2]

clang::OMPMessageClause::OMPMessageClause ( )
inline

Member Function Documentation

◆ getMessageString()

◆ tryEvaluateString()

std::optional< std::string > clang::OMPMessageClause::tryEvaluateString ( ASTContext & Ctx) const
inline

Try to evaluate the message string at compile time.

Definition at line 1921 of file OpenMPClause.h.

References getMessageString().

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

◆ OMPClauseReader

friend class OMPClauseReader
friend

Definition at line 1891 of file OpenMPClause.h.

References OMPClauseReader.

Referenced by OMPClauseReader.


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