summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/PointerIntPairTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...>Serge Guelton2019-01-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As noted in https://bugs.llvm.org/show_bug.cgi?id=36651, the specialization for isPodLike<std::pair<...>> did not match the expectation of std::is_trivially_copyable which makes the memcpy optimization invalid. This patch renames the llvm::isPodLike trait into llvm::is_trivially_copyable. Unfortunately std::is_trivially_copyable is not portable across compiler / STL versions. So a portable version is provided too. Note that the following specialization were invalid: std::pair<T0, T1> llvm::Optional<T> Tests have been added to assert that former specialization are respected by the standard usage of llvm::is_trivially_copyable, and that when a decent version of std::is_trivially_copyable is available, llvm::is_trivially_copyable is compared to std::is_trivially_copyable. As of this patch, llvm::Optional is no longer considered trivially copyable, even if T is. This is to be fixed in a later patch, as it has impact on a long-running bug (see r347004) Note that GCC warns about this UB, but this got silented by https://reviews.llvm.org/D50296. Differential Revision: https://reviews.llvm.org/D54472 llvm-svn: 351701
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. llvm-svn: 304786
* Fix PointerIntPair so that it can use an enum class as its integer template ↵Michael Gottesman2016-01-131-0/+27
| | | | | | | | | | | | | | | | | | | | argument. Summary: The problem here is that an enum class can not be implicitly converted to an integer. That assumption snuck back into PointerIntPair. This commit fixes the issue and more importantly adds some unittests to make sure that we do not break this again. rdar://23594806 Reviewers: gribozavr Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16131 llvm-svn: 257574
* [ADT] Use a nonce type with at least 4 byte alignment.Chandler Carruth2015-12-291-0/+1
| | | | | | | | | We didn't actually statically check this, and so it worked 25% of the time for me. =/ Really sorry it took so long to fix, I shouldn't leave the commit log editor window open without saving and landing the commit. =[ llvm-svn: 256528
* [ADT] Don't use a fixture just to get a nonce type for this unittest.Chandler Carruth2015-12-281-12/+12
| | | | | | | Instead, actually produce a nonce type in the test and use that. This makes the test, IMO, both simpler and more clear. llvm-svn: 256518
* ADT/PointerIntPairTest.cpp: Prune obsolete #if. We don't support msc17 anymore.NAKAMURA Takumi2015-02-171-2/+0
| | | | llvm-svn: 229501
* ADT/PointerIntPairTest.cpp: Appease msc17.NAKAMURA Takumi2014-03-101-1/+3
| | | | | | | - Use constructor instead of initializer list. - Disable ManyUnusedBits for now. llvm-svn: 203436
* Fix EXPECT_* to not produce a compile warning.Eli Bendersky2014-03-071-2/+2
| | | | | | EXPECT_TRUE/FALSE is also more idiomatic for booleans than EXPECT_EQ llvm-svn: 203284
* [ADT] Update PointerIntPair to handle pointer types with more than 31 bits free.Jordan Rose2014-03-071-0/+74
Previously, the assertions in PointerIntPair would try to calculate the value (1 << NumLowBitsAvailable); the inferred type here is 'int', so if there were more than 31 bits available we'd get a shift overflow. Also, add a rudimentary unit test file for PointerIntPair. llvm-svn: 203273
OpenPOWER on IntegriCloud