From 5f0b897b2ee47bf3845d924dd5bc3beb949bc78b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 23 Jun 2017 16:03:49 +0000 Subject: compiler: add go:notinheap magic comment Implement go:notinheap as the gc compiler does. A type marked as go:notinheap may not live in the heap, and does not require a write barrier. Struct and array types that incorporate notinheap types are themselves notinheap. Allocating a value of a notinheap type on the heap is an error. This is not just an optimization. There is code where a write barrier may not occur that was getting a write barrier with gccgo but not gc, because the types in question were notinheap. The case I found was setting the mcache field in exitsyscallfast. Reviewed-on: https://go-review.googlesource.com/46490 From-SVN: r249594 --- gcc/go/gofrontend/parse.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gcc/go/gofrontend/parse.h') diff --git a/gcc/go/gofrontend/parse.h b/gcc/go/gofrontend/parse.h index e13dcc9..e416072 100644 --- a/gcc/go/gofrontend/parse.h +++ b/gcc/go/gofrontend/parse.h @@ -182,14 +182,14 @@ class Parse void method_spec(Typed_identifier_list*); void declaration(); bool declaration_may_start_here(); - void decl(void (Parse::*)(void*), void*); - void list(void (Parse::*)(void*), void*, bool); + void decl(void (Parse::*)(void*, unsigned int), void*, unsigned int pragmas); + void list(void (Parse::*)(void*, unsigned int), void*, bool); void const_decl(); void const_spec(Type**, Expression_list**); - void type_decl(); - void type_spec(void*); + void type_decl(unsigned int pragmas); + void type_spec(void*, unsigned int pragmas); void var_decl(); - void var_spec(void*); + void var_spec(void*, unsigned int pragmas); void init_vars(const Typed_identifier_list*, Type*, Expression_list*, bool is_coloneq, Location); bool init_vars_from_call(const Typed_identifier_list*, Type*, Expression*, @@ -278,7 +278,7 @@ class Parse void goto_stat(); void package_clause(); void import_decl(); - void import_spec(void*); + void import_spec(void*, unsigned int pragmas); void reset_iota(); int iota_value(); -- cgit v1.1