summaryrefslogtreecommitdiff
path: root/gcc/genrecog.c
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-14 00:38:35 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-14 00:38:35 +0000
commit6d443cda9e2d8ed68353963fcb2b4052d98fbe08 (patch)
tree0234dc61e7e025e37e28cf53905d52df3be73340 /gcc/genrecog.c
parent3ef8774177f4612d5cea5dac0de2d8ec10d3cd17 (diff)
downloadgcc-6d443cda9e2d8ed68353963fcb2b4052d98fbe08.tar.gz
allow constructing a auto_vec with a preallocation, and a possibly larger actual allocation size
This allows us to set the capacity of the vector when we construct it, and still use a stack buffer when the size is small enough. gcc/ChangeLog: 2017-05-13 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * genrecog.c (int_set::int_set): Explicitly construct our auto_vec base class. * vec.h (auto_vec::auto_vec): New constructor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248019 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r--gcc/genrecog.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 6a9e610e7a0..b69043f0d02 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -1407,14 +1407,16 @@ struct int_set : public auto_vec <uint64_t, 1>
iterator end ();
};
-int_set::int_set () {}
+int_set::int_set () : auto_vec<uint64_t, 1> () {}
-int_set::int_set (uint64_t label)
+int_set::int_set (uint64_t label) :
+ auto_vec<uint64_t, 1> ()
{
safe_push (label);
}
-int_set::int_set (const int_set &other)
+int_set::int_set (const int_set &other) :
+ auto_vec<uint64_t, 1> ()
{
safe_splice (other);
}