#
ae9fd557 |
| 03-Dec-2020 |
Sean Silva <silvasean@google.com> |
[SmallVector] Allow SmallVector<T>
This patch adds a capability to SmallVector to decide a number of inlined elements automatically. The policy is:
- A minimum of 1 inlined elements, with more as l
[SmallVector] Allow SmallVector<T>
This patch adds a capability to SmallVector to decide a number of inlined elements automatically. The policy is:
- A minimum of 1 inlined elements, with more as long as sizeof(SmallVector<T>) <= 64. - If sizeof(T) is "too big", then trigger a static_assert: this dodges the more pathological cases
This is expected to systematically improve SmallVector use in the LLVM codebase, which has historically been plagued by semi-arbitrary / cargo culted N parameters, often leading to bad outcomes due to excessive sizeof(SmallVector<T, N>). This default also makes programming more convenient by avoiding edit/rebuild cycles due to forgetting to type the N parameter.
Differential Revision: https://reviews.llvm.org/D92522
show more ...
|
#
40e87726 |
| 20-Nov-2020 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Weaken SmallVector::resize assertion from 5abf76fbe37380874a88cc9aa02164800e4e10f3
There's no need to check for reference invalidation when `SmallVector::resize` is shrinking; the parameter isn
ADT: Weaken SmallVector::resize assertion from 5abf76fbe37380874a88cc9aa02164800e4e10f3
There's no need to check for reference invalidation when `SmallVector::resize` is shrinking; the parameter isn't accessed.
Differential Revision: https://reviews.llvm.org/D91832
show more ...
|
#
5abf76fb |
| 13-Nov-2020 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Add assertions to SmallVector::insert, etc., for reference invalidation
2c196bbc6bd897b3dcc1d87a3baac28e1e88df41 asserted that `SmallVector::push_back` doesn't invalidate the parameter when it
ADT: Add assertions to SmallVector::insert, etc., for reference invalidation
2c196bbc6bd897b3dcc1d87a3baac28e1e88df41 asserted that `SmallVector::push_back` doesn't invalidate the parameter when it needs to grow. Do the same for `resize`, `append`, `assign`, `insert`, and `emplace_back`.
Differential Revision: https://reviews.llvm.org/D91744
show more ...
|
#
97e8da45 |
| 03-Nov-2020 |
Nathan James <n.james93@hotmail.co.uk> |
[ADT] Add SmallVector::pop_back_n
Adds a method called pop_back_n to SmallVector. This is more readable and less error prone than the alternatives of using ```lang=c++ Vector.resize(Vector.size() -
[ADT] Add SmallVector::pop_back_n
Adds a method called pop_back_n to SmallVector. This is more readable and less error prone than the alternatives of using ```lang=c++ Vector.resize(Vector.size() - N); Vector.erase(Vector.end() - N, Vector.end()); for (unsigned I = 0;I<N;++I) Vector.pop_back(); ```
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D90576
show more ...
|
Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1 |
|
#
78e21bac |
| 26-Mar-2019 |
Fangrui Song <maskray@google.com> |
[ADT] Update SmallVectorTest.EmplaceBack tests after rL356312
rL356312 changed the return type of emplace_back from void to reference. Update the tests to check the behavior.
Reviewers: dblaikie
R
[ADT] Update SmallVectorTest.EmplaceBack tests after rL356312
rL356312 changed the return type of emplace_back from void to reference. Update the tests to check the behavior.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59809
llvm-svn: 356980
show more ...
|
Revision tags: llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1 |
|
#
2946cd70 |
| 19-Jan-2019 |
Chandler Carruth <chandlerc@gmail.com> |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license.
We understand that people may be surprised that we're moving the header entirely to discuss the ne
Update the file headers across all of the LLVM projects in the monorepo 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
show more ...
|
Revision tags: llvmorg-7.0.1, llvmorg-7.0.1-rc3, llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2, llvmorg-5.0.1-rc1, llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3 |
|
#
41b4f1aa |
| 12-Jun-2017 |
Francis Ricci <francisjricci@gmail.com> |
[ADT] Don't use __used__ attribute on struct members in unit test
On some compilers, __used__ can only be applied to variables or functions.
llvm-svn: 305188
|
#
dcfc0413 |
| 11-Jun-2017 |
Francis Ricci <francisjricci@gmail.com> |
[ADT] Use LLVM_ATTRIBUTE_USED instead of __attribute__ for unit test
llvm-svn: 305168
|
#
a5b61572 |
| 11-Jun-2017 |
Francis Ricci <francisjricci@gmail.com> |
[ADT] Suppress unused attribute warning in unit test
llvm-svn: 305166
|
#
d87d9e90 |
| 10-Jun-2017 |
Davide Italiano <davide@freebsd.org> |
[SmallVector] Reinstate the typedefs.
They're unused with recent versions of libstdc++ but older ones (e.g. libstdc++ 4.9 still requires them). Maybe we should bump the requirements on the minimum v
[SmallVector] Reinstate the typedefs.
They're unused with recent versions of libstdc++ but older ones (e.g. libstdc++ 4.9 still requires them). Maybe we should bump the requirements on the minimum version to make GCC 7 happy, but in the meanwhile we need to live with the warning.
llvm-svn: 305158
show more ...
|
#
77485bc8 |
| 10-Jun-2017 |
Davide Italiano <davide@freebsd.org> |
[SmallVector] Remove unused typedefs, spotted by GCC 7. NFCI.
llvm-svn: 305157
|
#
e22b6969 |
| 09-Jun-2017 |
Francis Ricci <francisjricci@gmail.com> |
[ADT] Make iterable SmallVector template overrides more specific
Summary: This prevents the iterator overrides from being selected in the case where non-iterator types are used as arguments, which i
[ADT] Make iterable SmallVector template overrides more specific
Summary: This prevents the iterator overrides from being selected in the case where non-iterator types are used as arguments, which is of particular importance in cases where other overrides with identical types exist.
Reviewers: dblaikie, bkramer, rafael
Subscribers: llvm-commits, efriedma
Differential Revision: https://reviews.llvm.org/D33919
llvm-svn: 305105
show more ...
|
#
9a67b073 |
| 06-Jun-2017 |
Chandler Carruth <chandlerc@gmail.com> |
Re-sort #include lines for unittests. This uses a slightly modified clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consi
Re-sort #include lines for unittests. This uses a slightly modified 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
show more ...
|
#
b6b42e01 |
| 02-Jun-2017 |
David Blaikie <dblaikie@gmail.com> |
Tidy up a bit of r304516, use SmallVector::assign rather than for loop
This might give a few better opportunities to optimize these to memcpy rather than loops - also a few minor cleanups (StringRef
Tidy up a bit of r304516, use SmallVector::assign rather than for loop
This might give a few better opportunities to optimize these to memcpy rather than loops - also a few minor cleanups (StringRef-izing, templating (to avoid std::function indirection), etc).
The SmallVector::assign(iter, iter) could be improved with the use of SFINAE, but the (iter, iter) ctor and append(iter, iter) need it to and don't have it - so, workaround it for now rather than bothering with the added complexity.
(also, as noted in the added FIXME, these assign ops could potentially be optimized better at least for non-trivially-copyable types)
llvm-svn: 304566
show more ...
|
Revision tags: llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1, llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1, llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1 |
|
#
91d3cfed |
| 05-Apr-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes."
This reverts commit r265454 since it broke the build. E.g.:
http://lab.llvm.org:8080/green/jo
Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes."
This reverts commit r265454 since it broke the build. E.g.:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/22413/
llvm-svn: 265459
show more ...
|
#
1760dc2a |
| 05-Apr-2016 |
Eugene Zelenko <eugene.zelenko@gmail.com> |
Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes.
Some Include What You Use suggestions were used too.
Use anonymous namespaces in source files.
Different
Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes.
Some Include What You Use suggestions were used too.
Use anonymous namespaces in source files.
Differential revision: http://reviews.llvm.org/D18778
llvm-svn: 265454
show more ...
|
#
6ae4bc89 |
| 24-Mar-2016 |
David Blaikie <dblaikie@gmail.com> |
[ADT] C++11ify SmallVector::erase's arguments from iterator to const_iterator
llvm-svn: 264330
|
Revision tags: llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1, llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1 |
|
#
f817c1cb |
| 11-Apr-2015 |
Alexander Kornienko <alexfh@google.com> |
Use 'override/final' instead of 'virtual' for overridden methods
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/r
Use 'override/final' instead of 'virtual' for overridden methods
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format
http://reviews.llvm.org/D8925
llvm-svn: 234679
show more ...
|
Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1 |
|
#
a6d7acc0 |
| 02-Mar-2015 |
Benjamin Kramer <benny.kra@googlemail.com> |
SmallVector: Allow initialization and assignment from initializer_list.
Modeled after std::vector.
llvm-svn: 231015
|
Revision tags: llvmorg-3.6.0, llvmorg-3.6.0-rc4 |
|
#
f9a1897c |
| 15-Feb-2015 |
Aaron Ballman <aaron@aaronballman.com> |
Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
llvm-svn: 229340
|
Revision tags: llvmorg-3.6.0-rc3 |
|
#
1d563f40 |
| 07-Feb-2015 |
Benjamin Kramer <benny.kra@googlemail.com> |
SmallVector: Move emplace_back to SmallVectorImpl.
This resolves the strange effect that emplace_back is only available when the type contained in the vector is not trivially copyable.
llvm-svn: 22
SmallVector: Move emplace_back to SmallVectorImpl.
This resolves the strange effect that emplace_back is only available when the type contained in the vector is not trivially copyable.
llvm-svn: 228496
show more ...
|
Revision tags: llvmorg-3.6.0-rc2 |
|
#
ac92bfc5 |
| 23-Jan-2015 |
Lang Hames <lhames@gmail.com> |
[ADT] Add move operations to SmallVector<T,N> from SmallVectorImpl<T>.
This makes it possible to move between SmallVectors of different sizes.
Thanks to Dave Blaikie and Duncan Smith for patch feed
[ADT] Add move operations to SmallVector<T,N> from SmallVectorImpl<T>.
This makes it possible to move between SmallVectors of different sizes.
Thanks to Dave Blaikie and Duncan Smith for patch feedback.
llvm-svn: 226899
show more ...
|
Revision tags: llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1 |
|
#
7ce5a497 |
| 03-Dec-2014 |
Aaron Ballman <aaron@aaronballman.com> |
Silencing several "multiple copy constructors" warnings from MSVC; NFC.
llvm-svn: 223238
|
#
f2396e65 |
| 03-Dec-2014 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Add SmallVector<>::emplace_back()
llvm-svn: 223201
|
Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1 |
|
#
11e0876b |
| 11-Jun-2014 |
David Blaikie <dblaikie@gmail.com> |
SmallVectorTest: Make the deleted member functions private to help MSVC users.
llvm-svn: 210665
|