runtime: don't stat a NULL filename
[official-gcc.git] / libgo / runtime / go-unsafe-pointer.c
blob5afd0112fe2a2c51ee665a7b31c101ca19705bf6
1 /* go-unsafe-pointer.c -- unsafe.Pointer type descriptor for Go.
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
7 #include <stddef.h>
9 #include "runtime.h"
10 #include "go-type.h"
12 /* This file provides the type descriptor for the unsafe.Pointer type.
13 The unsafe package is defined by the compiler itself, which means
14 that there is no package to compile to define the type
15 descriptor. */
17 extern const struct __go_type_descriptor unsafe_Pointer
18 __asm__ (GOSYM_PREFIX "unsafe.Pointer..d");
20 extern const byte unsafe_Pointer_gc[]
21 __asm__ (GOSYM_PREFIX "unsafe.Pointer..g");
23 /* Used to determine the field alignment. */
24 struct field_align
26 char c;
27 void *p;
30 /* The reflection string. */
31 #define REFLECTION "unsafe.Pointer"
32 static const String reflection_string =
34 (const byte *) REFLECTION,
35 sizeof REFLECTION - 1
38 const byte unsafe_Pointer_gc[] = { 1 };
40 extern const FuncVal runtime_pointerhash_descriptor
41 __asm__ (GOSYM_PREFIX "runtime.pointerhash..f");
42 extern const FuncVal runtime_pointerequal_descriptor
43 __asm__ (GOSYM_PREFIX "runtime.pointerequal..f");
45 const struct __go_type_descriptor unsafe_Pointer =
47 /* __size */
48 sizeof (void *),
49 /* __ptrdata */
50 sizeof (void *),
51 /* __hash */
52 78501163U,
53 /* __code */
54 GO_UNSAFE_POINTER | GO_DIRECT_IFACE,
55 /* __align */
56 __alignof (void *),
57 /* __field_align */
58 offsetof (struct field_align, p) - 1,
59 /* __hashfn */
60 &runtime_pointerhash_descriptor,
61 /* __equalfn */
62 &runtime_pointerequal_descriptor,
63 /* __gcdata */
64 unsafe_Pointer_gc,
65 /* __reflection */
66 &reflection_string,
67 /* __uncommon */
68 NULL,
69 /* __pointer_to_this */
70 NULL
73 /* We also need the type descriptor for the pointer to unsafe.Pointer,
74 since any package which refers to that type descriptor will expect
75 it to be defined elsewhere. */
77 extern const struct __go_ptr_type pointer_unsafe_Pointer
78 __asm__ (GOSYM_PREFIX "type...1unsafe.Pointer");
80 /* The reflection string. */
81 #define PREFLECTION "*unsafe.Pointer"
82 static const String preflection_string =
84 (const byte *) PREFLECTION,
85 sizeof PREFLECTION - 1,
88 extern const byte pointer_unsafe_Pointer_gc[]
89 __asm__ (GOSYM_PREFIX "type...1unsafe.Pointer..g");
91 const byte pointer_unsafe_Pointer_gc[] = { 1 };
93 const struct __go_ptr_type pointer_unsafe_Pointer =
95 /* __common */
97 /* __size */
98 sizeof (void *),
99 /* __ptrdata */
100 sizeof (void *),
101 /* __hash */
102 1256018616U,
103 /* __code */
104 GO_PTR | GO_DIRECT_IFACE,
105 /* __align */
106 __alignof (void *),
107 /* __field_align */
108 offsetof (struct field_align, p) - 1,
109 /* __hashfn */
110 &runtime_pointerhash_descriptor,
111 /* __equalfn */
112 &runtime_pointerequal_descriptor,
113 /* __gcdata */
114 pointer_unsafe_Pointer_gc,
115 /* __reflection */
116 &preflection_string,
117 /* __uncommon */
118 NULL,
119 /* __pointer_to_this */
120 NULL
122 /* __element_type */
123 &unsafe_Pointer