class OMPTraitInfo

Declaration

class OMPTraitInfo { /* full declaration omitted */ };

Description

Helper data structure representing the traits in a match clause of an `declare variant` or `metadirective`. The outer level is an ordered collection of selector sets, each with an associated kind and an ordered collection of selectors. A selector has a kind, an optional score/condition, and an ordered collection of properties.

Declared at: clang/include/clang/AST/OpenMPClause.h:8814

Member Variables

public llvm::SmallVector<OMPTraitSet, 2> Sets
The outermost level of selector sets.

Method Overview

Methods

OMPTraitInfo()

Description

Private constructor accesible only by ASTContext.

Declared at: clang/include/clang/AST/OpenMPClause.h:8816

OMPTraitInfo(llvm::StringRef MangledName)

Description

Reconstruct a (partial) OMPTraitInfo object from a mangled name.

Declared at: clang/include/clang/AST/OpenMPClause.h:8821

Parameters

llvm::StringRef MangledName

bool anyScoreOrCondition(
    llvm::function_ref<bool(Expr*&, bool)> Cond)

Declared at: clang/include/clang/AST/OpenMPClause.h:8826

Parameters

llvm::function_ref<bool(Expr*&, bool)> Cond

void getAsVariantMatchInfo(
    clang::ASTContext& ASTCtx,
    llvm::omp::VariantMatchInfo& VMI) const

Description

Create a variant match info object from this trait info object. While the former is a flat representation the actual main difference is that the latter uses clang::Expr to store the score/condition while the former is independent of clang. Thus, expressions and conditions are evaluated in this method.

Declared at: clang/include/clang/AST/OpenMPClause.h:8843

Parameters

clang::ASTContext& ASTCtx
llvm::omp::VariantMatchInfo& VMI

std::string getMangledName() const

Description

Return a string representation identifying this context selector.

Declared at: clang/include/clang/AST/OpenMPClause.h:8847

bool isExtensionActive(
    llvm::omp::TraitProperty TP)

Description

Check the extension trait \p TP is active.

Declared at: clang/include/clang/AST/OpenMPClause.h:8850

Parameters

llvm::omp::TraitProperty TP

void print(
    llvm::raw_ostream& OS,
    const clang::PrintingPolicy& Policy) const

Description

Print a human readable representation into \p OS.

Declared at: clang/include/clang/AST/OpenMPClause.h:8867

Parameters

llvm::raw_ostream& OS
const clang::PrintingPolicy& Policy