From 5fe80a0d486b0276a2181d179af83a62e6590f34 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 26 Aug 2011 17:05:05 -0700 Subject: rt: Allow closures to be logged --- src/rt/rust_shape.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/rt/rust_shape.cpp') diff --git a/src/rt/rust_shape.cpp b/src/rt/rust_shape.cpp index 6a586860cd6..f56aa0251ce 100644 --- a/src/rt/rust_shape.cpp +++ b/src/rt/rust_shape.cpp @@ -42,7 +42,17 @@ type_param::make(const type_desc **tydescs, unsigned n_tydescs, return ptrs; } -// Constructs type parameters from an object shape. This is a bit messy, +// Constructs type parameters from a function shape. This is a bit messy, +// because it requires that the function shape have a specific format. +type_param * +type_param::from_fn_shape(const uint8_t *sp, ptr dp, arena &arena) { + const type_desc *tydesc = bump_dp(dp); + const type_desc **descs = (const type_desc **)(dp + tydesc->size); + unsigned n_tydescs = tydesc->n_obj_params & 0x7fffffff; + return make(descs, n_tydescs, arena); +} + +// Constructs type parameters from an object shape. This is also a bit messy, // because it requires that the object shape have a specific format. type_param * type_param::from_obj_shape(const uint8_t *sp, ptr dp, arena &arena) { @@ -460,12 +470,6 @@ log::walk_vec(bool align, bool is_pod, const std::pair &data) { out << "]"; } -void -log::walk_obj(bool align) { - out << "obj"; - data::walk_obj_contents(align, dp); -} - void log::walk_variant(bool align, tag_info &tinfo, uint32_t variant_id, const std::pair -- cgit 1.4.1-3-g733a5