diff options
author | dim <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
commit | 9dd834653b811ad20382e98a87dff824980c9916 (patch) | |
tree | a764184c2fc9486979b074250b013a0937ee64e5 /lib/Sema/TreeTransform.h | |
parent | bb9760db9b86e93a638ed430d0a14785f7ff9064 (diff) | |
download | FreeBSD-src-9dd834653b811ad20382e98a87dff824980c9916.zip FreeBSD-src-9dd834653b811ad20382e98a87dff824980c9916.tar.gz |
Vendor import of clang trunk r240225:
https://llvm.org/svn/llvm-project/cfe/trunk@240225
Diffstat (limited to 'lib/Sema/TreeTransform.h')
-rw-r--r-- | lib/Sema/TreeTransform.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index f5249fd..73dde7c 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -5386,6 +5386,17 @@ QualType TreeTransform<Derived>::TransformAttributedType( = getDerived().TransformType(oldType->getEquivalentType()); if (equivalentType.isNull()) return QualType(); + + // Check whether we can add nullability; it is only represented as + // type sugar, and therefore cannot be diagnosed in any other way. + if (auto nullability = oldType->getImmediateNullability()) { + if (!modifiedType->canHaveNullability()) { + SemaRef.Diag(TL.getAttrNameLoc(), diag::err_nullability_nonpointer) + << static_cast<unsigned>(*nullability) << false << modifiedType; + return QualType(); + } + } + result = SemaRef.Context.getAttributedType(oldType->getAttrKind(), modifiedType, equivalentType); @@ -6871,6 +6882,17 @@ TreeTransform<Derived>::TransformOMPTaskwaitDirective(OMPTaskwaitDirective *D) { } template <typename Derived> +StmtResult TreeTransform<Derived>::TransformOMPTaskgroupDirective( + OMPTaskgroupDirective *D) { + DeclarationNameInfo DirName; + getDerived().getSema().StartOpenMPDSABlock(OMPD_taskgroup, DirName, nullptr, + D->getLocStart()); + StmtResult Res = getDerived().TransformOMPExecutableDirective(D); + getDerived().getSema().EndOpenMPDSABlock(Res.get()); + return Res; +} + +template <typename Derived> StmtResult TreeTransform<Derived>::TransformOMPFlushDirective(OMPFlushDirective *D) { DeclarationNameInfo DirName; @@ -7950,6 +7972,25 @@ TreeTransform<Derived>::TransformDesignatedInitExpr(DesignatedInitExpr *E) { E->usesGNUSyntax(), Init.get()); } +// Seems that if TransformInitListExpr() only works on the syntactic form of an +// InitListExpr, then a DesignatedInitUpdateExpr is not encountered. +template<typename Derived> +ExprResult +TreeTransform<Derived>::TransformDesignatedInitUpdateExpr( + DesignatedInitUpdateExpr *E) { + llvm_unreachable("Unexpected DesignatedInitUpdateExpr in syntactic form of " + "initializer"); + return ExprError(); +} + +template<typename Derived> +ExprResult +TreeTransform<Derived>::TransformNoInitExpr( + NoInitExpr *E) { + llvm_unreachable("Unexpected NoInitExpr in syntactic form of initializer"); + return ExprError(); +} + template<typename Derived> ExprResult TreeTransform<Derived>::TransformImplicitValueInitExpr( |