aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-unsafe-pointer.c
diff options
context:
space:
mode:
authorChris Manghane <cmang@google.com>2014-09-03 22:56:09 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-09-03 22:56:09 +0000
commitf1d2ac4f84b4b5354779b3b0a0e125b8302ebb49 (patch)
treeba1dd2b0b5d5bd16e9bc5c7dce503f320e8a896a /libgo/runtime/go-unsafe-pointer.c
parentd2e4feca24b91fd1a3e4e42f8ef82b19d0df5853 (diff)
downloadgcc-f1d2ac4f84b4b5354779b3b0a0e125b8302ebb49.zip
gcc-f1d2ac4f84b4b5354779b3b0a0e125b8302ebb49.tar.gz
gcc-f1d2ac4f84b4b5354779b3b0a0e125b8302ebb49.tar.bz2
compiler: Add precise type information on the heap.
* go-gcc.cc (Gcc_backend::implicit_variable): Remove init parameter. Add is_hidden parameter. (Gcc_backend::implicit_variable_set_init): New method. (Gcc_backend::implicit_variable_reference): New method. From-SVN: r214894
Diffstat (limited to 'libgo/runtime/go-unsafe-pointer.c')
-rw-r--r--libgo/runtime/go-unsafe-pointer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgo/runtime/go-unsafe-pointer.c b/libgo/runtime/go-unsafe-pointer.c
index b71804a..67b2999 100644
--- a/libgo/runtime/go-unsafe-pointer.c
+++ b/libgo/runtime/go-unsafe-pointer.c
@@ -8,6 +8,7 @@
#include "runtime.h"
#include "go-type.h"
+#include "mgc0.h"
/* A pointer with a zero value. */
static void *zero_pointer;
@@ -20,6 +21,9 @@ static void *zero_pointer;
extern const struct __go_type_descriptor unsafe_Pointer
__asm__ (GOSYM_PREFIX "__go_tdn_unsafe.Pointer");
+extern const uintptr unsafe_Pointer_gc[]
+ __asm__ (GOSYM_PREFIX "__go_tdn_unsafe.Pointer$gc");
+
/* Used to determine the field alignment. */
struct field_align
{
@@ -35,6 +39,8 @@ static const String reflection_string =
sizeof REFLECTION - 1
};
+const uintptr unsafe_Pointer_gc[] = {8, GC_APTR, 0, GC_END};
+
const struct __go_type_descriptor unsafe_Pointer =
{
/* __code */
@@ -51,6 +57,8 @@ const struct __go_type_descriptor unsafe_Pointer =
__go_type_hash_identity,
/* __equalfn */
__go_type_equal_identity,
+ /* __gc */
+ unsafe_Pointer_gc,
/* __reflection */
&reflection_string,
/* __uncommon */
@@ -94,6 +102,8 @@ const struct __go_ptr_type pointer_unsafe_Pointer =
__go_type_hash_identity,
/* __equalfn */
__go_type_equal_identity,
+ /* __gc */
+ unsafe_Pointer_gc,
/* __reflection */
&preflection_string,
/* __uncommon */