clang 24.0.0git
clang::CIRGen::omp Namespace Reference

Classes

struct  Clause
 A tomp clause that remembers the Clang AST clause it came from, so the existing emitters can emit it after the decomposition assigns it to a leaf. More...
struct  DecompositionHelper
 Helper required by ConstructDecompositionT. More...
struct  LeafWithClauses

Typedefs

using TypeTy = const clang::Type *
using IdTy = const clang::ValueDecl *
using ExprTy = const clang::Expr *
using Object = tomp::ObjectT<IdTy, ExprTy>
using ObjectList = tomp::ObjectListT<IdTy, ExprTy>
using ClauseBase = tomp::ClauseT<TypeTy, IdTy, ExprTy>
using ConstructQueue = llvm::SmallVector<LeafWithClauses>

Functions

const clang::ValueDecl * getBaseValueDecl (const clang::Expr *e)
Object makeObject (const clang::Expr *e)
 Build a tomp Object whose identity is the base variable's canonical decl.
template<typename ClangClause>
ObjectList makeObjects (const ClangClause &c)
 Build the tomp object list from a Clang var-list clause.
template<typename Specific>
Clause makeClause (llvm::omp::Clause id, Specific &&specific, const clang::OMPClause &original)
 Wrap a tomp clause payload into a Clause, remembering its AST origin.
bool needsSpecificHandling (llvm::omp::Clause kind)
 Clause kinds that need a dedicated conversion: they either have a specific applyClause() overload (so the payload type selects it) or their contents feed the algorithm.
bool isEmittableClause (llvm::omp::Clause kind)
 Clause kinds CIR is able to emit today.
Clause makeGeneric (llvm::omp::Clause id, const clang::OMPClause &orig)
 Represent a clause by kind only, using an inert empty payload that routes through the algorithm's generic applyClause() path (which reads just the clause id).
Clause convertClause (const clang::OMPClause &c)
 Convert a single Clang clause to its tomp representation.
const clang::OMPClause * findOriginalIfClause (const OMPExecutableDirective &s, const Clause &c)
 The decomposition algorithm resolves a directive-name-modifier on an if clause (e.g.
ConstructQueue buildConstructQueue (unsigned openmpVersion, const OMPExecutableDirective &s)
 Given a potentially compound directive with a list of clauses that apply to it, break it up into individual leaf constructs each with the subset of applicable clauses (plus implicit clauses, if any).
bool isLastItemInQueue (ConstructQueue::const_iterator item, const ConstructQueue &queue)

Typedef Documentation

◆ ClauseBase

Definition at line 62 of file CIRGenOpenMPConstructDecomposition.h.

◆ ConstructQueue

◆ ExprTy

◆ IdTy

◆ Object

using clang::CIRGen::omp::Object = tomp::ObjectT<IdTy, ExprTy>

Definition at line 60 of file CIRGenOpenMPConstructDecomposition.h.

◆ ObjectList

using clang::CIRGen::omp::ObjectList = tomp::ObjectListT<IdTy, ExprTy>

Definition at line 61 of file CIRGenOpenMPConstructDecomposition.h.

◆ TypeTy

Function Documentation

◆ buildConstructQueue()

ConstructQueue clang::CIRGen::omp::buildConstructQueue ( unsigned openmpVersion,
const OMPExecutableDirective & s )
inline

Given a potentially compound directive with a list of clauses that apply to it, break it up into individual leaf constructs each with the subset of applicable clauses (plus implicit clauses, if any).

From that create a work queue, ordered outermost to innermost, where each work item corresponds to the leaf construct with its clauses. Implicit clauses are synthesized by the decomposition and have no Clang AST node, so they are listed separately.

Definition at line 325 of file CIRGenOpenMPConstructDecomposition.h.

References clang::CIRGen::omp::LeafWithClauses::clauses, convertClause(), findOriginalIfClause(), clang::CIRGen::omp::LeafWithClauses::id, clang::CIRGen::omp::Clause::original, and clang::CIRGen::omp::LeafWithClauses::synthesized.

Referenced by clang::CIRGen::CIRGenFunction::emitOMPParallelDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetDirective(), and clang::CIRGen::CIRGenFunction::emitOMPTargetParallelDirective().

◆ convertClause()

Clause clang::CIRGen::omp::convertClause ( const clang::OMPClause & c)
inline

Convert a single Clang clause to its tomp representation.

Every kind is handled; contents are populated only where the algorithm reads them.

Definition at line 167 of file CIRGenOpenMPConstructDecomposition.h.

References clang::OMPClause::getClauseKind(), kind, makeClause(), makeGeneric(), and makeObjects().

Referenced by buildConstructQueue().

◆ findOriginalIfClause()

const clang::OMPClause * clang::CIRGen::omp::findOriginalIfClause ( const OMPExecutableDirective & s,
const Clause & c )
inline

The decomposition algorithm resolves a directive-name-modifier on an if clause (e.g.

if(parallel: cond)) by synthesizing a fresh clause with the modifier stripped – reusing the same condition expression – and assigning it to the leaf named by the modifier. That synthesized clause has no Clang AST node of its own (original is null), but it shares its condition expression's identity with the clause it was derived from. Use that to recover the original OMPIfClause so a resolved if clause is routed to its leaf like any other clause, instead of being reported as an unimplemented synthesized clause.

Definition at line 308 of file CIRGenOpenMPConstructDecomposition.h.

References condition.

Referenced by buildConstructQueue().

◆ getBaseValueDecl()

const clang::ValueDecl * clang::CIRGen::omp::getBaseValueDecl ( const clang::Expr * e)
inline

Definition at line 73 of file CIRGenOpenMPConstructDecomposition.h.

References clang::Expr::IgnoreParenImpCasts().

Referenced by makeObject().

◆ isEmittableClause()

bool clang::CIRGen::omp::isEmittableClause ( llvm::omp::Clause kind)
inline

Clause kinds CIR is able to emit today.

Definition at line 146 of file CIRGenOpenMPConstructDecomposition.h.

References kind.

Referenced by makeGeneric().

◆ isLastItemInQueue()

bool clang::CIRGen::omp::isLastItemInQueue ( ConstructQueue::const_iterator item,
const ConstructQueue & queue )
inline

Definition at line 358 of file CIRGenOpenMPConstructDecomposition.h.

Referenced by emitParallelOp(), and emitTargetOp().

◆ makeClause()

template<typename Specific>
Clause clang::CIRGen::omp::makeClause ( llvm::omp::Clause id,
Specific && specific,
const clang::OMPClause & original )
inline

Wrap a tomp clause payload into a Clause, remembering its AST origin.

Definition at line 110 of file CIRGenOpenMPConstructDecomposition.h.

References clang::CIRGen::omp::Clause::original.

Referenced by convertClause(), and makeGeneric().

◆ makeGeneric()

Clause clang::CIRGen::omp::makeGeneric ( llvm::omp::Clause id,
const clang::OMPClause & orig )
inline

Represent a clause by kind only, using an inert empty payload that routes through the algorithm's generic applyClause() path (which reads just the clause id).

Valid for any clause with no specific applyClause() overload.

Definition at line 159 of file CIRGenOpenMPConstructDecomposition.h.

References isEmittableClause(), makeClause(), and needsSpecificHandling().

Referenced by convertClause().

◆ makeObject()

Object clang::CIRGen::omp::makeObject ( const clang::Expr * e)
inline

Build a tomp Object whose identity is the base variable's canonical decl.

Definition at line 95 of file CIRGenOpenMPConstructDecomposition.h.

References getBaseValueDecl().

Referenced by makeObjects().

◆ makeObjects()

template<typename ClangClause>
ObjectList clang::CIRGen::omp::makeObjects ( const ClangClause & c)
inline

Build the tomp object list from a Clang var-list clause.

Definition at line 101 of file CIRGenOpenMPConstructDecomposition.h.

References makeObject().

Referenced by convertClause().

◆ needsSpecificHandling()

bool clang::CIRGen::omp::needsSpecificHandling ( llvm::omp::Clause kind)
inline

Clause kinds that need a dedicated conversion: they either have a specific applyClause() overload (so the payload type selects it) or their contents feed the algorithm.

Guards the generic fallback in makeGeneric.

Definition at line 120 of file CIRGenOpenMPConstructDecomposition.h.

References kind.

Referenced by makeGeneric().