diff options
Diffstat (limited to 'include/clang/AST/DeclOpenMP.h')
-rw-r--r-- | include/clang/AST/DeclOpenMP.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/clang/AST/DeclOpenMP.h b/include/clang/AST/DeclOpenMP.h index 7f0616f..598f418 100644 --- a/include/clang/AST/DeclOpenMP.h +++ b/include/clang/AST/DeclOpenMP.h @@ -33,8 +33,12 @@ class Expr; /// }; /// \endcode /// -class OMPThreadPrivateDecl : public Decl { +class OMPThreadPrivateDecl final + : public Decl, + private llvm::TrailingObjects<OMPThreadPrivateDecl, Expr *> { friend class ASTDeclReader; + friend TrailingObjects; + unsigned NumVars; virtual void anchor(); @@ -43,14 +47,11 @@ class OMPThreadPrivateDecl : public Decl { Decl(DK, DC, L), NumVars(0) { } ArrayRef<const Expr *> getVars() const { - return llvm::makeArrayRef(reinterpret_cast<const Expr * const *>(this + 1), - NumVars); + return llvm::makeArrayRef(getTrailingObjects<Expr *>(), NumVars); } MutableArrayRef<Expr *> getVars() { - return MutableArrayRef<Expr *>( - reinterpret_cast<Expr **>(this + 1), - NumVars); + return MutableArrayRef<Expr *>(getTrailingObjects<Expr *>(), NumVars); } void setVars(ArrayRef<Expr *> VL); |