diff options
author | dim <dim@FreeBSD.org> | 2015-09-06 18:36:24 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-09-06 18:36:24 +0000 |
commit | 4238dc458ed9a048965af111b979fd51d288f22c (patch) | |
tree | 3d3ed1e1987dbe6444294b1b4e249814b97b97a5 /include/clang/AST | |
parent | 6416b56f5a3923c6c264b46365e16718ccabf081 (diff) | |
download | FreeBSD-src-4238dc458ed9a048965af111b979fd51d288f22c.zip FreeBSD-src-4238dc458ed9a048965af111b979fd51d288f22c.tar.gz |
Import clang 3.7.0 release (r246257).
Diffstat (limited to 'include/clang/AST')
-rw-r--r-- | include/clang/AST/ASTVector.h | 17 | ||||
-rw-r--r-- | include/clang/AST/NSAPI.h | 8 | ||||
-rw-r--r-- | include/clang/AST/StmtOpenMP.h | 25 |
3 files changed, 37 insertions, 13 deletions
diff --git a/include/clang/AST/ASTVector.h b/include/clang/AST/ASTVector.h index 6ec0545..79453bf 100644 --- a/include/clang/AST/ASTVector.h +++ b/include/clang/AST/ASTVector.h @@ -384,14 +384,15 @@ void ASTVector<T>::grow(const ASTContext &C, size_t MinSize) { T *NewElts = new (C, llvm::alignOf<T>()) T[NewCapacity]; // Copy the elements over. - if (std::is_class<T>::value) { - std::uninitialized_copy(Begin, End, NewElts); - // Destroy the original elements. - destroy_range(Begin, End); - } - else { - // Use memcpy for PODs (std::uninitialized_copy optimizes to memmove). - memcpy(NewElts, Begin, CurSize * sizeof(T)); + if (Begin != End) { + if (std::is_class<T>::value) { + std::uninitialized_copy(Begin, End, NewElts); + // Destroy the original elements. + destroy_range(Begin, End); + } else { + // Use memcpy for PODs (std::uninitialized_copy optimizes to memmove). + memcpy(NewElts, Begin, CurSize * sizeof(T)); + } } // ASTContext never frees any memory. diff --git a/include/clang/AST/NSAPI.h b/include/clang/AST/NSAPI.h index ce2c7ce..583f9d9 100644 --- a/include/clang/AST/NSAPI.h +++ b/include/clang/AST/NSAPI.h @@ -16,6 +16,7 @@ namespace clang { class ASTContext; + class ObjCInterfaceDecl; class QualType; class Expr; @@ -35,11 +36,10 @@ public: ClassId_NSMutableDictionary, ClassId_NSNumber, ClassId_NSMutableSet, - ClassId_NSCountedSet, ClassId_NSMutableOrderedSet, ClassId_NSValue }; - static const unsigned NumClassIds = 11; + static const unsigned NumClassIds = 10; enum NSStringMethodKind { NSStr_stringWithString, @@ -220,6 +220,10 @@ public: /// \brief Returns \c true if \p Id is currently defined as a macro. bool isMacroDefined(StringRef Id) const; + /// \brief Returns \c true if \p InterfaceDecl is subclass of \p NSClassKind + bool isSubclassOfNSClass(ObjCInterfaceDecl *InterfaceDecl, + NSClassIdKindKind NSClassKind) const; + private: bool isObjCTypedef(QualType T, StringRef name, IdentifierInfo *&II) const; bool isObjCEnumerator(const Expr *E, diff --git a/include/clang/AST/StmtOpenMP.h b/include/clang/AST/StmtOpenMP.h index b412daa..708b866 100644 --- a/include/clang/AST/StmtOpenMP.h +++ b/include/clang/AST/StmtOpenMP.h @@ -312,18 +312,26 @@ class OMPLoopDirective : public OMPExecutableDirective { } /// \brief Get the updates storage. - MutableArrayRef<Expr *> getUpdates() { + MutableArrayRef<Expr *> getInits() { Expr **Storage = reinterpret_cast<Expr **>( &*std::next(child_begin(), getArraysOffset(getDirectiveKind()) + CollapsedNum)); return MutableArrayRef<Expr *>(Storage, CollapsedNum); } + /// \brief Get the updates storage. + MutableArrayRef<Expr *> getUpdates() { + Expr **Storage = reinterpret_cast<Expr **>( + &*std::next(child_begin(), + getArraysOffset(getDirectiveKind()) + 2 * CollapsedNum)); + return MutableArrayRef<Expr *>(Storage, CollapsedNum); + } + /// \brief Get the final counter updates storage. MutableArrayRef<Expr *> getFinals() { Expr **Storage = reinterpret_cast<Expr **>( &*std::next(child_begin(), - getArraysOffset(getDirectiveKind()) + 2 * CollapsedNum)); + getArraysOffset(getDirectiveKind()) + 3 * CollapsedNum)); return MutableArrayRef<Expr *>(Storage, CollapsedNum); } @@ -358,7 +366,7 @@ protected: static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind) { return getArraysOffset(Kind) + - 3 * CollapsedNum; // Counters, Updates and Finals + 4 * CollapsedNum; // Counters, Inits, Updates and Finals } void setIterationVariable(Expr *IV) { @@ -414,6 +422,7 @@ protected: *std::next(child_begin(), NextUpperBoundOffset) = NUB; } void setCounters(ArrayRef<Expr *> A); + void setInits(ArrayRef<Expr *> A); void setUpdates(ArrayRef<Expr *> A); void setFinals(ArrayRef<Expr *> A); @@ -453,6 +462,8 @@ public: Expr *NUB; /// \brief Counters Loop counters. SmallVector<Expr *, 4> Counters; + /// \brief Expressions for loop counters inits for CodeGen. + SmallVector<Expr *, 4> Inits; /// \brief Expressions for loop counters update for CodeGen. SmallVector<Expr *, 4> Updates; /// \brief Final loop counter values for GodeGen. @@ -484,10 +495,12 @@ public: NLB = nullptr; NUB = nullptr; Counters.resize(Size); + Inits.resize(Size); Updates.resize(Size); Finals.resize(Size); for (unsigned i = 0; i < Size; ++i) { Counters[i] = nullptr; + Inits[i] = nullptr; Updates[i] = nullptr; Finals[i] = nullptr; } @@ -584,6 +597,12 @@ public: return const_cast<OMPLoopDirective *>(this)->getCounters(); } + ArrayRef<Expr *> inits() { return getInits(); } + + ArrayRef<Expr *> inits() const { + return const_cast<OMPLoopDirective *>(this)->getInits(); + } + ArrayRef<Expr *> updates() { return getUpdates(); } ArrayRef<Expr *> updates() const { |