llvm-mirror/include/llvm/ADT
Joel E. Denny ab225e9daf [APSInt][OpenMP] Fix isNegative, etc. for unsigned types
Without this patch, APSInt inherits APInt::isNegative, which merely
checks the sign bit without regard to whether the type is actually
signed.  isNonNegative and isStrictlyPositive call isNegative and so
are also affected.

This patch adjusts APSInt to override isNegative, isNonNegative, and
isStrictlyPositive with implementations that consider whether the type
is signed.

A large set of Clang OpenMP tests are affected.  Without this patch,
these tests assume that `true` is not a valid argument for clauses
like `collapse`.  Indeed, `true` fails APInt::isStrictlyPositive but
not APSInt::isStrictlyPositive.  This patch adjusts those tests to
assume `true` should be accepted.

This patch also adds tests revealing various other similar fixes due
to APSInt::isNegative calls in Clang's ExprConstant.cpp and
SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object
size based on `alloc_size`, `<<` and `>>` shift count validation, and
OpenMP array section validation.

Reviewed By: lebedev.ri, ABataev, hfinkel

Differential Revision: https://reviews.llvm.org/D59712

llvm-svn: 359012
2019-04-23 17:04:15 +00:00
..
AllocatorList.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Any.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
APFloat.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
APInt.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
APSInt.h [APSInt][OpenMP] Fix isNegative, etc. for unsigned types 2019-04-23 17:04:15 +00:00
ArrayRef.h [ADT] Fix OwningArrayRef's move ctor 2019-04-13 13:52:11 +00:00
bit.h Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
BitmaskEnum.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BitVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BreadthFirstIterator.h [NFC] Fix typo in comment. 2019-04-06 22:05:24 +00:00
CachedHashString.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DAGDeltaAlgorithm.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeltaAlgorithm.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DenseMap.h Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
DenseMapInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DenseSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DepthFirstIterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
edit_distance.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EpochTracker.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EquivalenceClasses.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
fallible_iterator.h [ADT] Add a fallible_iterator wrapper. 2019-02-05 23:17:11 +00:00
FoldingSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionExtras.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GraphTraits.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Hashing.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_base.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_iterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_node_base.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_node_options.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_node.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist.h [ADT] Notify ilist traits about in-list transfers 2019-01-23 22:59:52 +00:00
ImmutableList.h Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
ImmutableMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImmutableSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IndexedMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntEqClasses.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntervalMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntrusiveRefCntPtr.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
iterator_range.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
iterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MapVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
None.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Optional.h Speculative buildfix for Mac 2019-02-20 14:56:31 +00:00
PackedVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerEmbeddedInt.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerIntPair.h Fix llvm::is_trivially_copyable portability issues 2019-01-22 13:48:55 +00:00
PointerSumType.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerUnion.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PostOrderIterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PriorityQueue.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PriorityWorklist.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SCCIterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScopedHashTable.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScopeExit.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sequence.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SetOperations.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SetVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
simple_ilist.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallBitVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallPtrSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallString.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallVector.h [ADT] Make SmallVector emplace_back return a reference 2019-03-16 02:41:45 +00:00
SparseBitVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SparseMultiSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SparseSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Statistic.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
STLExtras.h STLExtras: add stable_sort wrappers 2019-04-22 15:19:13 +00:00
StringExtras.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StringMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StringRef.h [ADT] Move away from __attribute__((always_inline)). 2019-01-22 22:40:35 +00:00
StringSet.h [tblgen] Track CodeInit origins when possible 2019-03-02 00:12:57 +00:00
StringSwitch.h [ADT] Move away from __attribute__((always_inline)). 2019-01-22 22:40:35 +00:00
TinyPtrVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Triple.h [WebAssembly] Add Emscripten OS definition + small_printf 2019-04-03 01:08:35 +00:00
Twine.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
UniqueVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
VariadicFunction.h Fix misspelled filenames in file headers 2019-02-07 14:38:25 +00:00