aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/backend.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2014-06-04 23:15:33 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-06-04 23:15:33 +0000
commitbae90c989cb020d17a24919ec84c0b8dd2fae2da (patch)
tree89766166feb4ceca2d983169c5360e3f6f521b12 /gcc/go/gofrontend/backend.h
parent82b3da6a714493644a4333bfd8205e3341ed3b8e (diff)
downloadgcc-bae90c989cb020d17a24919ec84c0b8dd2fae2da.zip
gcc-bae90c989cb020d17a24919ec84c0b8dd2fae2da.tar.gz
gcc-bae90c989cb020d17a24919ec84c0b8dd2fae2da.tar.bz2
libgo: Merge from revision 18783:00cce3a34d7e of master library.
This revision was committed January 7, 2014. The next revision deleted runtime/mfinal.c. That will be done in a subsequent merge. This merge changes type descriptors to add a zero field, pointing to a zero value for that type. This is implemented as a common variable. * go-gcc.cc (Gcc_backend::implicit_variable): Add is_common and alignment parameters. Permit init parameter to be NULL. From-SVN: r211249
Diffstat (limited to 'gcc/go/gofrontend/backend.h')
-rw-r--r--gcc/go/gofrontend/backend.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/gcc/go/gofrontend/backend.h b/gcc/go/gofrontend/backend.h
index fdcfd28..323ac2e 100644
--- a/gcc/go/gofrontend/backend.h
+++ b/gcc/go/gofrontend/backend.h
@@ -544,16 +544,24 @@ class Backend
bool address_is_taken, Location location,
Bstatement** pstatement) = 0;
- // Create an implicit variable that is compiler-defined. This is used when
- // generating GC root variables and storing the values of a slice constructor.
- // NAME is the name of the variable, either gc# for GC roots or C# for slice
- // initializers. TYPE is the type of the implicit variable with an initial
- // value INIT. IS_CONSTANT is true if the implicit variable should be treated
- // like it is immutable. For slice initializers, if the values must be copied
- // to the heap, the variable IS_CONSTANT.
+ // Create an implicit variable that is compiler-defined. This is
+ // used when generating GC root variables, when storing the values
+ // of a slice constructor, and for the zero value of types. NAME is
+ // the name of the variable, either gc# for GC roots or C# for slice
+ // initializers. TYPE is the type of the implicit variable with an
+ // initial value INIT. IS_CONSTANT is true if the implicit variable
+ // should be treated like it is immutable. For slice initializers,
+ // if the values must be copied to the heap, the variable
+ // IS_CONSTANT. IS_COMMON is true if the implicit variable should
+ // be treated as a common variable (multiple definitions with
+ // different sizes permitted in different object files, all merged
+ // into the largest definition at link time); this will be true for
+ // the zero value. If IS_COMMON is true, INIT will be NULL, and the
+ // variable should be initialized to all zeros. If ALIGNMENT is not
+ // zero, it is the desired alignment of the variable.
virtual Bvariable*
implicit_variable(const std::string& name, Btype* type, Bexpression* init,
- bool is_constant) = 0;
+ bool is_constant, bool is_common, size_t alignment) = 0;
// Create a named immutable initialized data structure. This is
// used for type descriptors, map descriptors, and function