Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1 |
|
#
c93709af |
| 04-Apr-2023 |
Nemanja Ivanovic <nemanja.i.ibm@gmail.com> |
[SmallVector] Fix unit test to eliminate failure with -Werror
Commit 475dd6f626ee2679578ed570e9fb78f7e957a36d added a unit test that compares SmallVector::size() (a size_t value) against 42 (an int
[SmallVector] Fix unit test to eliminate failure with -Werror
Commit 475dd6f626ee2679578ed570e9fb78f7e957a36d added a unit test that compares SmallVector::size() (a size_t value) against 42 (an int value). That causes failures with -Werror. This patch just adds the cast to silence the warning.
show more ...
|
#
475dd6f6 |
| 03-Apr-2023 |
Craig Topper <craig.topper@sifive.com> |
[SmallVector] Add an explicit SmallVector(size_t Size) constructor.
Previously we used the SmallVector(size_t Size, const T& Value) constructor with a default constructed Value. That will copy const
[SmallVector] Add an explicit SmallVector(size_t Size) constructor.
Previously we used the SmallVector(size_t Size, const T& Value) constructor with a default constructed Value. That will copy construct every element in the vector, but not all types can be copy constructed.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D147426
show more ...
|
Revision tags: llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7 |
|
#
38818b60 |
| 04-Jan-2023 |
serge-sans-paille <sguelton@mozilla.com> |
Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ part
Use deduction guides instead of helper functions.
The only non-automatic changes have been:
1. ArrayRef(some_uint8_pointer, 0
Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ part
Use deduction guides instead of helper functions.
The only non-automatic changes have been:
1. ArrayRef(some_uint8_pointer, 0) needs to be changed into ArrayRef(some_uint8_pointer, (size_t)0) to avoid an ambiguous call with ArrayRef((uint8_t*), (uint8_t*)) 2. CVSymbol sym(makeArrayRef(symStorage)); needed to be rewritten as CVSymbol sym{ArrayRef(symStorage)}; otherwise the compiler is confused and thinks we have a (bad) function prototype. There was a few similar situation across the codebase. 3. ADL doesn't seem to work the same for deduction-guides and functions, so at some point the llvm namespace must be explicitly stated. 4. The "reference mode" of makeArrayRef(ArrayRef<T> &) that acts as no-op is not supported (a constructor cannot achieve that).
Per reviewers' comment, some useless makeArrayRef have been removed in the process.
This is a follow-up to https://reviews.llvm.org/D140896 that introduced the deduction guides.
Differential Revision: https://reviews.llvm.org/D140955
show more ...
|
Revision tags: llvmorg-15.0.6, llvmorg-15.0.5 |
|
#
6aa050a6 |
| 08-Nov-2022 |
Nathan James <n.james93@hotmail.co.uk> |
Reland "[llvm][NFC] Use c++17 style variable type traits"
This reverts commit 632a389f96355cbe7ed8fa7b8d2ed6267c92457c.
This relands commit 1834a310d060d55748ca38d4ae0482864c2047d8.
Differential R
Reland "[llvm][NFC] Use c++17 style variable type traits"
This reverts commit 632a389f96355cbe7ed8fa7b8d2ed6267c92457c.
This relands commit 1834a310d060d55748ca38d4ae0482864c2047d8.
Differential Revision: https://reviews.llvm.org/D137493
show more ...
|
#
632a389f |
| 08-Nov-2022 |
Nathan James <n.james93@hotmail.co.uk> |
Revert "[llvm][NFC] Use c++17 style variable type traits"
This reverts commit 1834a310d060d55748ca38d4ae0482864c2047d8.
|
#
1834a310 |
| 08-Nov-2022 |
Nathan James <n.james93@hotmail.co.uk> |
[llvm][NFC] Use c++17 style variable type traits
This was done as a test for D137302 and it makes sense to push these changes
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/
[llvm][NFC] Use c++17 style variable type traits
This was done as a test for D137302 and it makes sense to push these changes
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D137493
show more ...
|
Revision tags: llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3 |
|
#
8a17e74c |
| 12-Aug-2022 |
Dawid Jurczak <dawid_jurek@vp.pl> |
[NFC] Introduce llvm::to_vector_of to allow creation of SmallVector<T> from range of items convertible to type T
It's https://reviews.llvm.org/D129565 follow-up.
Differential Revision: https://revi
[NFC] Introduce llvm::to_vector_of to allow creation of SmallVector<T> from range of items convertible to type T
It's https://reviews.llvm.org/D129565 follow-up.
Differential Revision: https://reviews.llvm.org/D129781
show more ...
|
Revision tags: llvmorg-15.0.0-rc2 |
|
#
1bd31a68 |
| 04-Aug-2022 |
Dawid Jurczak <dawid_jurek@vp.pl> |
[NFC] Add SmallVector constructor to allow creation of SmallVector<T> from ArrayRef of items convertible to type T
Extracted from https://reviews.llvm.org/D129781 and address comment: https://review
[NFC] Add SmallVector constructor to allow creation of SmallVector<T> from ArrayRef of items convertible to type T
Extracted from https://reviews.llvm.org/D129781 and address comment: https://reviews.llvm.org/D129781#3655571
Differential Revision: https://reviews.llvm.org/D130268
show more ...
|
#
7d7a712c |
| 04-Aug-2022 |
Dawid Jurczak <dawid_jurek@vp.pl> |
[NFC] Define NumBuiltinElts utility just once at the beginning of SmallVectorTest file
Extracted from: https://reviews.llvm.org/D130268
Differential Revision: https://reviews.llvm.org/D131173
|
#
3d51e272 |
| 03-Aug-2022 |
Dawid Jurczak <dawid_jurek@vp.pl> |
[NFC] Remove some boilerplate from SmallVector unit tests
In SmallVector unit test, referring test suite members every time using 'this' (due to how non-dependent name lookups works) is quite cumber
[NFC] Remove some boilerplate from SmallVector unit tests
In SmallVector unit test, referring test suite members every time using 'this' (due to how non-dependent name lookups works) is quite cumbersome and can be improved with aliases. Some test cases already use this approach, in this change we expand that approach to whole test file.
Differential Revision: https://reviews.llvm.org/D129990
show more ...
|
Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2 |
|
#
8fbf9acc |
| 25-Apr-2022 |
Frederik Gossen <frgossen@google.com> |
Add missing comparison operators to SmallVector
Differential Revision: https://reviews.llvm.org/D124407
|
Revision tags: llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
#
ca451d3f |
| 08-Dec-2021 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Add SmallVectorImpl::truncate() to replace uses of set_size()
Add `SmallVectorImpl::truncate()`, a variant of `resize()` that cannot increase the size.
- Compared to `resize()`, this has no co
ADT: Add SmallVectorImpl::truncate() to replace uses of set_size()
Add `SmallVectorImpl::truncate()`, a variant of `resize()` that cannot increase the size.
- Compared to `resize()`, this has no code path for growing the allocation and can be better optimized. - Compared to `set_size()`, this formally calls destructors, and does not skip any constructors. - Compared to `pop_back_n()`, this takes the new desired size, which in many contexts is more intuitive than the number of elements to remove.
The immediate motivation is to pair this with `resize_for_overwrite()` to remove uses of `set_size()`, which can then be made private.
Differential Revision: https://reviews.llvm.org/D115383
show more ...
|
Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1 |
|
#
05de4b41 |
| 17-May-2021 |
Benjamin Kramer <benny.kra@googlemail.com> |
Put back the trailing commas on TYPED_TEST_SUITE
This avoids a -pedantic warning: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
See also https://github.com/goo
Put back the trailing commas on TYPED_TEST_SUITE
This avoids a -pedantic warning: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
See also https://github.com/google/googletest/issues/2271
show more ...
|
#
d4d80a29 |
| 14-May-2021 |
Benjamin Kramer <benny.kra@googlemail.com> |
Bump googletest to 1.10.0
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init |
|
#
ba5628f2 |
| 22-Jan-2021 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Use 'using' to inherit assign and append in SmallString
Rather than reimplement, use a `using` declaration to bring in `SmallVectorImpl<char>`'s assign and append implementations in `SmallStrin
ADT: Use 'using' to inherit assign and append in SmallString
Rather than reimplement, use a `using` declaration to bring in `SmallVectorImpl<char>`'s assign and append implementations in `SmallString`.
The `SmallString` versions were missing reference invalidation assertions from `SmallVector`. This patch also fixes a bug in `llvm::FileCollector::addFileImpl`, which was a copy/paste from `clang::ModuleDependencyCollector::copyToRoot`, both caught by the no-longer-skipped assertions.
As a drive-by, this also sinks the `const SmallVectorImpl&` versions of these methods down into `SmallVectorImpl`, since I imagine they'd be useful elsewhere.
Differential Revision: https://reviews.llvm.org/D95202
show more ...
|
Revision tags: llvmorg-11.1.0-rc2 |
|
#
d7ff0036 |
| 15-Jan-2021 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Fix reference invalidation in SmallVector::emplace_back and assign(N,V)
This fixes the final (I think?) reference invalidation in `SmallVector` that we need to fix to align with `std::vector`.
ADT: Fix reference invalidation in SmallVector::emplace_back and assign(N,V)
This fixes the final (I think?) reference invalidation in `SmallVector` that we need to fix to align with `std::vector`. (There is still some left in the range insert / append / assign, but the standard calls that UB for `std::vector` so I think we don't care?)
For POD-like types, reimplement `emplace_back()` in terms of `push_back()`, taking a copy even for large `T` rather than lose the realloc optimization in `grow_pod()`.
For other types, split the grow operation in three and construct the new element in the middle.
- `mallocForGrow()` calculates the new capacity and returns the result of `safe_malloc()`. We only need a single definition per `SmallVectorBase` so this is defined in SmallVector.cpp to avoid code size bloat. Moving this part of non-POD grow to the source file also allows the logic to be easily shared with `grow_pod`, and `report_size_overflow()` and `report_at_maximum_capacity()` can move there too. - `moveElementsForGrow()` moves elements from the old to the new allocation. - `takeAllocationForGrow()` frees the old allocation and saves the new allocation and capacity .
`SmallVector:assign(size_type, const T&)` also uses the split-grow operations for non-POD, but it also has a semantic change when not growing. Previously, assign would start with `clear()`, and so the old elements were destructed and all elements of the new vector were copy-constructed (potentially invalidating references). The new implementation skips destruction and uses copy-assignment for the prefix of the new vector that fits. The new semantics match what libc++ does for `std::vector::assign()`.
Note that the following is another possible implementation: ``` void assign(size_type NumElts, ValueParamT Elt) { std::fill_n(this->begin(), std::min(NumElts, this->size()), Elt); this->resize(NumElts, Elt); } ``` The downside of this simpler implementation is that if the vector has to grow there will be `size()` redundant copy operations.
(I had planned on splitting this patch up into three for committing (after getting performance numbers / initial review), but I've realized that if this does for some reason need to be reverted we'll probably want to revert the whole package...)
Differential Revision: https://reviews.llvm.org/D94739
show more ...
|
#
ceaf0110 |
| 15-Jan-2021 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Revert "Revert "ADT: Fix reference invalidation in SmallVector...""
This reverts commit 33be50daa9ce1074c3b423a4ab27c70c0722113a, effectively reapplying:
- 260a856c2abcef49c7cb3bdcd999701db3e2af38
Revert "Revert "ADT: Fix reference invalidation in SmallVector...""
This reverts commit 33be50daa9ce1074c3b423a4ab27c70c0722113a, effectively reapplying:
- 260a856c2abcef49c7cb3bdcd999701db3e2af38 - 3043e5a5c33c4c871f4a1dfd621a8839f9a1f0b3 - 49142991a685bd427d7e877c29c77371dfb7634c
... with a fix to skip a call to `SmallVector::isReferenceToStorage()` when we know the parameter had been taken by value for small, POD-like `T`. See https://reviews.llvm.org/D93779 for the discussion on the revert.
At a high-level, these commits fix reference invalidation in SmallVector's push_back, append, insert (one or N), and resize operations. For more details, please see the original commit messages.
This commit fixes a bug that crept into `SmallVectorTemplateCommon::reserveForAndGetAddress()` during the review process after performance analysis was done. That function is now called `reserveForParamAndGetAddress()`, clarifying that it only works for parameter values. It uses that knowledge to bypass `SmallVector::isReferenceToStorage()` when `TakesParamByValue`. This is `constexpr` and avoids adding overhead for "small enough", trivially copyable `T`.
Performance could potentially be tuned further by increasing the threshold for `TakesParamByValue`, which is currently defined as: ``` bool TakesParamByValue = sizeof(T) <= 2 * sizeof(void *); ``` in the POD-like version of SmallVectorTemplateBase (else, `false`).
Differential Revision: https://reviews.llvm.org/D94800
show more ...
|
#
33be50da |
| 15-Jan-2021 |
Nikita Popov <nikita.ppv@gmail.com> |
Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and single-element insert""
This reverts commit 260a856c2abcef49c7cb3bdcd999701db3e2af38. This reverts commit 3043e5a5c33c4
Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and single-element insert""
This reverts commit 260a856c2abcef49c7cb3bdcd999701db3e2af38. This reverts commit 3043e5a5c33c4c871f4a1dfd621a8839f9a1f0b3. This reverts commit 49142991a685bd427d7e877c29c77371dfb7634c.
This change had a larger than anticipated compile-time impact, possibly because the small value optimization is not working as intended. See D93779.
show more ...
|
Revision tags: llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1 |
|
#
260a856c |
| 20-Nov-2020 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Fix reference invalidation in SmallVector::resize
For small enough, trivially copyable `T`, take the parameter by-value in `SmallVector::resize`. Otherwise, when growing, update the arugment a
ADT: Fix reference invalidation in SmallVector::resize
For small enough, trivially copyable `T`, take the parameter by-value in `SmallVector::resize`. Otherwise, when growing, update the arugment appropriately.
Differential Revision: https://reviews.llvm.org/D93781
show more ...
|
#
3043e5a5 |
| 20-Nov-2020 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Fix reference invalidation in N-element SmallVector::append and insert
For small enough, trivially copyable `T`, take the parameter by-value in `SmallVector::append` and `SmallVector::insert`.
ADT: Fix reference invalidation in N-element SmallVector::append and insert
For small enough, trivially copyable `T`, take the parameter by-value in `SmallVector::append` and `SmallVector::insert`. Otherwise, when growing, update the arugment appropriately.
Differential Revision: https://reviews.llvm.org/D93780
show more ...
|
#
49142991 |
| 14-Jan-2021 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Reapply "ADT: Fix reference invalidation in SmallVector::push_back and single-element insert"
This reverts commit 56d1ffb927d03958a7a31442596df749264a7792, reapplying 9abac60309006db00eca0af406c2e16
Reapply "ADT: Fix reference invalidation in SmallVector::push_back and single-element insert"
This reverts commit 56d1ffb927d03958a7a31442596df749264a7792, reapplying 9abac60309006db00eca0af406c2e16bef26807c, removing insert_one_maybe_copy and using a helper called forward_value_param instead. This avoids use of `std::is_same` (or any SFINAE), so I'm hoping it's more portable and MSVC will be happier.
Original commit message follows:
For small enough, trivially copyable `T`, take the argument by value in `SmallVector::push_back` and copy it when forwarding to `SmallVector::insert_one_impl`. Otherwise, when growing, update the argument appropriately.
Differential Revision: https://reviews.llvm.org/D93779
show more ...
|
#
56d1ffb9 |
| 14-Jan-2021 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Revert "ADT: Fix reference invalidation in SmallVector::push_back and single-element insert"
This reverts commit 9abac60309006db00eca0af406c2e16bef26807c since there are some bot errors on Windows:
Revert "ADT: Fix reference invalidation in SmallVector::push_back and single-element insert"
This reverts commit 9abac60309006db00eca0af406c2e16bef26807c since there are some bot errors on Windows: http://lab.llvm.org:8011/#/builders/127/builds/4489
``` FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/IntervalMap.cpp.obj C:\PROGRA~2\MIB055~1\2017\PROFES~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib\Support -IC:\b\slave\sanitizer-windows\llvm-project\llvm\lib\Support -Iinclude -IC:\b\slave\sanitizer-windows\llvm-project\llvm\include /DWIN32 /D_WINDOWS /Zc:inline /Zc:__cplusplus /Zi /Zc:strictStrings /Oi /Zc:rvalueCast /bigobj /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /Gw /MD /O2 /Ob2 -UNDEBUG -std:c++14 /EHs-c- /GR- /showIncludes /Folib\Support\CMakeFiles\LLVMSupport.dir\IntervalMap.cpp.obj /Fdlib\Support\CMakeFiles\LLVMSupport.dir\LLVMSupport.pdb /FS -c C:\b\slave\sanitizer-windows\llvm-project\llvm\lib\Support\IntervalMap.cpp C:\b\slave\sanitizer-windows\llvm-project\llvm\include\llvm/ADT/SmallVector.h(746): error C2672: 'llvm::SmallVectorImpl<T>::insert_one_maybe_copy': no matching overloaded function found with [ T=llvm::IntervalMapImpl::Path::Entry ] C:\b\slave\sanitizer-windows\llvm-project\llvm\include\llvm/ADT/SmallVector.h(745): note: while compiling class template member function 'llvm::IntervalMapImpl::Path::Entry *llvm::SmallVectorImpl<T>::insert(llvm::IntervalMapImpl::Path::Entry *,T &&)' with [ T=llvm::IntervalMapImpl::Path::Entry ] C:\b\slave\sanitizer-windows\llvm-project\llvm\lib\Support\IntervalMap.cpp(22): note: see reference to function template instantiation 'llvm::IntervalMapImpl::Path::Entry *llvm::SmallVectorImpl<T>::insert(llvm::IntervalMapImpl::Path::Entry *,T &&)' being compiled with [ T=llvm::IntervalMapImpl::Path::Entry ] C:\b\slave\sanitizer-windows\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1136): note: see reference to class template instantiation 'llvm::SmallVectorImpl<T>' being compiled with [ T=llvm::IntervalMapImpl::Path::Entry ] C:\b\slave\sanitizer-windows\llvm-project\llvm\include\llvm/ADT/IntervalMap.h(790): note: see reference to class template instantiation 'llvm::SmallVector<llvm::IntervalMapImpl::Path::Entry,4>' being compiled C:\b\slave\sanitizer-windows\llvm-project\llvm\include\llvm/ADT/SmallVector.h(746): error C2783: 'llvm::IntervalMapImpl::Path::Entry *llvm::SmallVectorImpl<T>::insert_one_maybe_copy(llvm::IntervalMapImpl::Path::Entry *,ArgType &&)': could not deduce template argument for '__formal' with [ T=llvm::IntervalMapImpl::Path::Entry ] C:\b\slave\sanitizer-windows\llvm-project\llvm\include\llvm/ADT/SmallVector.h(727): note: see declaration of 'llvm::SmallVectorImpl<T>::insert_one_maybe_copy' with [ T=llvm::IntervalMapImpl::Path::Entry ] ```
show more ...
|
#
9abac603 |
| 19-Nov-2020 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
ADT: Fix reference invalidation in SmallVector::push_back and single-element insert
For small enough, trivially copyable `T`, take the argument by value in `SmallVector::push_back` and copy it when
ADT: Fix reference invalidation in SmallVector::push_back and single-element insert
For small enough, trivially copyable `T`, take the argument by value in `SmallVector::push_back` and copy it when forwarding to `SmallVector::insert_one_impl`. Otherwise, when growing, update the argument appropriately.
Differential Revision: https://reviews.llvm.org/D93779
show more ...
|
#
f5071489 |
| 22-Dec-2020 |
Nathan James <n.james93@hotmail.co.uk> |
[ADT] Fix some tests after 5d10b8ad
Some bots were failing due to signed/unsigned comparison.
|
#
5d10b8ad |
| 22-Dec-2020 |
Nathan James <n.james93@hotmail.co.uk> |
[ADT] Add resize_for_overwrite method to SmallVector.
Analagous to the std::make_(unqiue|shared)_for_overwrite added in c++20. If T is POD, and the container gets larger, any new values added wont b
[ADT] Add resize_for_overwrite method to SmallVector.
Analagous to the std::make_(unqiue|shared)_for_overwrite added in c++20. If T is POD, and the container gets larger, any new values added wont be initialized. This is useful when using SmallVector as a buffer where its planned to overwrite any potential new values added. If T is not POD, `new (Storage) T` functions identically to `new (Storage) T()` so this will function identically to `resize(size_type)`.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93532
show more ...
|