clang  12.0.0git
Public Member Functions | Public Attributes | Friends | List of all members
OMPTraitInfo Class Reference

Helper data structure representing the traits in a match clause of an declare variant or metadirective. More...

#include "clang/AST/OpenMPClause.h"

Collaboration diagram for OMPTraitInfo:
Collaboration graph
[legend]

Public Member Functions

 OMPTraitInfo (StringRef MangledName)
 Reconstruct a (partial) OMPTraitInfo object from a mangled name. More...
 
bool anyScoreOrCondition (llvm::function_ref< bool(Expr *&, bool)> Cond)
 
void getAsVariantMatchInfo (ASTContext &ASTCtx, llvm::omp::VariantMatchInfo &VMI) const
 Create a variant match info object from this trait info object. More...
 
std::string getMangledName () const
 Return a string representation identifying this context selector. More...
 
void print (llvm::raw_ostream &OS, const PrintingPolicy &Policy) const
 Print a human readable representation into OS. More...
 

Public Attributes

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

Friends

class ASTContext
 

Detailed 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.

Definition at line 7654 of file OpenMPClause.h.

Constructor & Destructor Documentation

◆ OMPTraitInfo()

OMPTraitInfo::OMPTraitInfo ( StringRef  MangledName)

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

Definition at line 2240 of file OpenMPClause.cpp.

References OMPTraitProperty::Kind, OMPTraitSelector::Kind, OMPTraitSet::Kind, OMPTraitSelector::Properties, clang::Property, and OMPTraitSet::Selectors.

Member Function Documentation

◆ anyScoreOrCondition()

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

Definition at line 7666 of file OpenMPClause.h.

References clang::operator<<(), print(), and OMPTraitSet::Selectors.

◆ getAsVariantMatchInfo()

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

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.

Definition at line 2116 of file OpenMPClause.cpp.

References clang::Expr::isIntegerConstantExpr(), OMPTraitProperty::Kind, OMPTraitSelector::Kind, OMPTraitSelector::Properties, clang::Property, and OMPTraitSelector::ScoreOrCondition.

◆ getMangledName()

std::string OMPTraitInfo::getMangledName ( ) const

Return a string representation identifying this context selector.

Definition at line 2216 of file OpenMPClause.cpp.

References OMPTraitProperty::Kind, OMPTraitSelector::Kind, OMPTraitSelector::Properties, and clang::Property.

Referenced by setPrototype().

◆ print()

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

Friends And Related Function Documentation

◆ ASTContext

friend class ASTContext
friend

Definition at line 7657 of file OpenMPClause.h.

Member Data Documentation

◆ Sets

llvm::SmallVector<OMPTraitSet, 2> OMPTraitInfo::Sets

The outermost level of selector sets.

Definition at line 7664 of file OpenMPClause.h.

Referenced by clang::ASTRecordReader::readOMPTraitInfo(), and clang::ASTRecordWriter::writeOMPTraitInfo().


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