aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/lex.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-06-23 16:03:49 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-06-23 16:03:49 +0000
commit5f0b897b2ee47bf3845d924dd5bc3beb949bc78b (patch)
tree3f8b464d9ac9de6affa319ea9639ee19ef983302 /gcc/go/gofrontend/lex.h
parentef2361cbd8462374b28e9e8becf8710a9b30d125 (diff)
downloadgcc-5f0b897b2ee47bf3845d924dd5bc3beb949bc78b.zip
gcc-5f0b897b2ee47bf3845d924dd5bc3beb949bc78b.tar.gz
gcc-5f0b897b2ee47bf3845d924dd5bc3beb949bc78b.tar.bz2
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
Diffstat (limited to 'gcc/go/gofrontend/lex.h')
-rw-r--r--gcc/go/gofrontend/lex.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/lex.h b/gcc/go/gofrontend/lex.h
index 0a7a842..a8b7091 100644
--- a/gcc/go/gofrontend/lex.h
+++ b/gcc/go/gofrontend/lex.h
@@ -64,7 +64,8 @@ enum GoPragma
GOPRAGMA_NOWRITEBARRIER = 1 << 6, // No write barriers.
GOPRAGMA_NOWRITEBARRIERREC = 1 << 7, // No write barriers here or callees.
GOPRAGMA_CGOUNSAFEARGS = 1 << 8, // Pointer to arg is pointer to all.
- GOPRAGMA_UINTPTRESCAPES = 1 << 9 // uintptr(p) escapes.
+ GOPRAGMA_UINTPTRESCAPES = 1 << 9, // uintptr(p) escapes.
+ GOPRAGMA_NOTINHEAP = 1 << 10 // type is not in heap.
};
// A token returned from the lexer.