summaryrefslogtreecommitdiff
path: root/gcc/vec.h
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-22 14:58:36 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-22 14:58:36 +0000
commitcfea6514a4b6ced0930593ebb48d0037e9716d87 (patch)
treeeeccf866e18463f7dc7ea882ea944247d4ed1010 /gcc/vec.h
parent9456798d72d0e81a2a553287f436dcb05cff175a (diff)
downloadgcc-cfea6514a4b6ced0930593ebb48d0037e9716d87.tar.gz
[./]
2013-11-22 Basile Starynkevitch <basile@starynkevitch.net> {{merge with trunk GCC 4.9 svn rev 205247 now in stage 3}} [gcc/] 2013-11-22 Basile Starynkevitch <basile@starynkevitch.net> {{merge with trunk GCC 4.9 svn rev 205247 now in stage 3}} * Makefile.in (MELT_GCC_VERSION_NUM): New make variable. (melt-run-md5.h, melt-run.h): Use it. * melt-runtime.cc: With GCC 4.9 include print-tree.h, gimple-iterator.h, gimple-walk.h. (meltgc_start_all_new_modules, meltgc_start_flavored_module) (meltgc_do_initial_mode, meltgc_set_user_options) (meltgc_load_modules_and_do_mode): Improve debugprintf... (melt_gt_ggc_mx_gimple_seq_d): Handle GCC 4.9 specifically. * melt-runtime.h (gt_ggc_mx_gimple_statement_d): Temporarily define this macro. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@205264 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/vec.h')
-rw-r--r--gcc/vec.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/vec.h b/gcc/vec.h
index b1ebda44f5e..03455851b0f 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1184,6 +1184,17 @@ public:
};
+/* auto_vec is a sub class of vec whose storage is released when it is
+ destroyed. */
+template<typename T>
+class auto_vec : public vec<T, va_heap>
+{
+public:
+ auto_vec () { this->m_vec = NULL; }
+ auto_vec (size_t n) { this->create (n); }
+ ~auto_vec () { this->release (); }
+};
+
/* stack_vec is a subclass of vec containing N elements of internal storage.
You probably only want to allocate this on the stack because if the array
ends up being larger or much smaller than N it will be wasting space. */