summaryrefslogtreecommitdiff
path: root/gcc/context.c
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-20 00:48:14 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-20 00:48:14 +0000
commit9e1adc64622ceef35e977961aa107816c89c904b (patch)
tree080c5e5b18d9fa59fc4dff4c0c22fc13ee53b87c /gcc/context.c
parent714a75873ef0edb53559480e93eabbf12d7971be (diff)
downloadgcc-9e1adc64622ceef35e977961aa107816c89c904b.tar.gz
Make gcc::context be GC-managed
* Makefile.in (GTFILES): Add context.h. * context.c (gcc::context::operator new): New. (gcc::context::gt_ggc_mx): New. (gcc::context::gt_pch_nx): New. (gcc::context::gt_pch_nx): New. * context.h (gcc::context): Add GTY((user)) marking. (gcc::context::operator new): New. (gcc::context::gt_ggc_mx): New. (gcc::context::gt_pch_nx): New. (gcc::context::gt_pch_nx): New. (g): Add GTY marking. (gt_ggc_mx (gcc::context *)): New. (gt_pch_nx (gcc::context *)): New. (gt_pch_nx (gcc::context *ctxt, gt_pointer_operator op, void *cookie)): New. * gengtype.c (open_base_files) <ifiles>: Add context.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201864 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/context.c')
-rw-r--r--gcc/context.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/context.c b/gcc/context.c
index b5152419a97..ba6f3355333 100644
--- a/gcc/context.c
+++ b/gcc/context.c
@@ -27,7 +27,33 @@ along with GCC; see the file COPYING3. If not see
/* The singleton holder of global state: */
gcc::context *g;
+void *
+gcc::context::operator new (std::size_t size)
+{
+ return ggc_internal_cleared_alloc_stat (size MEM_STAT_INFO);
+}
+
gcc::context::context()
{
passes_ = new gcc::pass_manager (this);
}
+
+/* Functions relating to the garbage collector. */
+void
+gcc::context::gt_ggc_mx ()
+{
+ /* Currently a no-op. */
+}
+
+void
+gcc::context::gt_pch_nx ()
+{
+ /* Currently a no-op. */
+}
+
+void
+gcc::context::gt_pch_nx (gt_pointer_operator op ATTRIBUTE_UNUSED,
+ void *cookie ATTRIBUTE_UNUSED)
+{
+ /* Currently a no-op. */
+}