diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-03 22:56:09 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-03 22:56:09 +0000 |
commit | aa5ae5757ffe8a3efa80a966801a73f6e534f046 (patch) | |
tree | ba1dd2b0b5d5bd16e9bc5c7dce503f320e8a896a /libgo/runtime/go-unsafe-pointer.c | |
parent | a3f448f02f99dd76c2e2ce51fa04e2d58878d1ac (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214894 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/runtime/go-unsafe-pointer.c')
-rw-r--r-- | libgo/runtime/go-unsafe-pointer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libgo/runtime/go-unsafe-pointer.c b/libgo/runtime/go-unsafe-pointer.c index b71804ac741d..67b2999df5db 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 */ |