aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ivcanon.c
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde@tbsaunde.org>2021-06-06 20:05:53 -0400
committerTrevor Saunders <tbsaunde@tbsaunde.org>2021-06-17 04:43:26 -0400
commite9681f5725f54a58098678cdea19d1e90d9a36e3 (patch)
treec9a3dec470cdb273a2f7827df0c33050d36d8cbf /gcc/tree-ssa-loop-ivcanon.c
parent3f3ee13959f852de432fa7761a8e50ddee6d6e1b (diff)
downloadgcc-e9681f5725f54a58098678cdea19d1e90d9a36e3.zip
gcc-e9681f5725f54a58098678cdea19d1e90d9a36e3.tar.gz
gcc-e9681f5725f54a58098678cdea19d1e90d9a36e3.tar.bz2
auto_vec copy/move improvements
- Unfortunately using_auto_storage () needs to handle m_vec being null. - Handle self move of an auto_vec to itself. - Make sure auto_vec defines the classes move constructor and assignment operator, as well as ones taking vec<T>, so the compiler does not generate them for us. Per https://en.cppreference.com/w/cpp/language/move_constructor the ones taking vec<T> do not count as the classes move constructor or assignment operator, but we want them as well to assign a plain vec to a auto_vec. - Explicitly delete auto_vec's copy constructor and assignment operator. This prevents unintentional expenssive coppies of the vector and makes it clear when coppies are needed that that is what is intended. When it is necessary to copy a vector copy () can be used. Signed-off-by: Trevor Saunders <tbsaunde@tbsaunde.org> gcc/ChangeLog: * vec.h (vl_ptr>::using_auto_storage): Handle null m_vec. (auto_vec<T, 0>::auto_vec): Define move constructor, and delete copy constructor. (auto_vec<T, 0>::operator=): Define move assignment and delete copy assignment.
Diffstat (limited to 'gcc/tree-ssa-loop-ivcanon.c')
0 files changed, 0 insertions, 0 deletions