aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h')
-rw-r--r--contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h b/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h
index 4aa5bde92e12..73725e6e8566 100644
--- a/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h
+++ b/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h
@@ -34,7 +34,7 @@ template <typename U> class OMPDeclarativeDirective : public U {
/// Get the clauses storage.
MutableArrayRef<OMPClause *> getClauses() {
if (!Data)
- return llvm::None;
+ return std::nullopt;
return Data->getClauses();
}
@@ -90,7 +90,7 @@ public:
ArrayRef<OMPClause *> clauses() const {
if (!Data)
- return llvm::None;
+ return std::nullopt;
return Data->getClauses();
}
};
@@ -118,12 +118,12 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective<Decl> {
ArrayRef<const Expr *> getVars() const {
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
- return llvm::makeArrayRef(Storage, Data->getNumChildren());
+ return llvm::ArrayRef(Storage, Data->getNumChildren());
}
MutableArrayRef<Expr *> getVars() {
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
- return llvm::makeMutableArrayRef(Storage, Data->getNumChildren());
+ return llvm::MutableArrayRef(Storage, Data->getNumChildren());
}
void setVars(ArrayRef<Expr *> VL);
@@ -158,6 +158,12 @@ public:
static bool classofKind(Kind K) { return K == OMPThreadPrivate; }
};
+enum class OMPDeclareReductionInitKind {
+ Call, // Initialized by function call.
+ Direct, // omp_priv(<expr>)
+ Copy // omp_priv = <expr>
+};
+
/// This represents '#pragma omp declare reduction ...' directive.
/// For example, in the following, declared reduction 'foo' for types 'int' and
/// 'float':
@@ -171,14 +177,7 @@ public:
class OMPDeclareReductionDecl final : public ValueDecl, public DeclContext {
// This class stores some data in DeclContext::OMPDeclareReductionDeclBits
// to save some space. Use the provided accessors to access it.
-public:
- enum InitKind {
- CallInit, // Initialized by function call.
- DirectInit, // omp_priv(<expr>)
- CopyInit // omp_priv = <expr>
- };
-private:
friend class ASTDeclReader;
/// Combiner for declare reduction construct.
Expr *Combiner = nullptr;
@@ -239,8 +238,9 @@ public:
Expr *getInitializer() { return Initializer; }
const Expr *getInitializer() const { return Initializer; }
/// Get initializer kind.
- InitKind getInitializerKind() const {
- return static_cast<InitKind>(OMPDeclareReductionDeclBits.InitializerKind);
+ OMPDeclareReductionInitKind getInitializerKind() const {
+ return static_cast<OMPDeclareReductionInitKind>(
+ OMPDeclareReductionDeclBits.InitializerKind);
}
/// Get Orig variable of the initializer.
Expr *getInitOrig() { return Orig; }
@@ -249,9 +249,9 @@ public:
Expr *getInitPriv() { return Priv; }
const Expr *getInitPriv() const { return Priv; }
/// Set initializer expression for the declare reduction construct.
- void setInitializer(Expr *E, InitKind IK) {
+ void setInitializer(Expr *E, OMPDeclareReductionInitKind IK) {
Initializer = E;
- OMPDeclareReductionDeclBits.InitializerKind = IK;
+ OMPDeclareReductionDeclBits.InitializerKind = llvm::to_underlying(IK);
}
/// Set initializer Orig and Priv vars.
void setInitializerData(Expr *OrigE, Expr *PrivE) {
@@ -481,12 +481,12 @@ class OMPAllocateDecl final : public OMPDeclarativeDirective<Decl> {
ArrayRef<const Expr *> getVars() const {
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
- return llvm::makeArrayRef(Storage, Data->getNumChildren());
+ return llvm::ArrayRef(Storage, Data->getNumChildren());
}
MutableArrayRef<Expr *> getVars() {
auto **Storage = reinterpret_cast<Expr **>(Data->getChildren().data());
- return llvm::makeMutableArrayRef(Storage, Data->getNumChildren());
+ return llvm::MutableArrayRef(Storage, Data->getNumChildren());
}
void setVars(ArrayRef<Expr *> VL);