aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/backend.h
diff options
context:
space:
mode:
authorChris Manghane <cmang@google.com>2014-05-06 00:11:29 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-05-06 00:11:29 +0000
commitfb930306ba4cbb6fd54d1cbfa013cb6c8f92ad4f (patch)
treef3a9e000cbf0028296817998178ce156cf0715e6 /gcc/go/gofrontend/backend.h
parent3e7b0938f13f937df971a1bc42f1dd32ca8a81bb (diff)
downloadgcc-fb930306ba4cbb6fd54d1cbfa013cb6c8f92ad4f.zip
gcc-fb930306ba4cbb6fd54d1cbfa013cb6c8f92ad4f.tar.gz
gcc-fb930306ba4cbb6fd54d1cbfa013cb6c8f92ad4f.tar.bz2
compiler: Use backend interface for slice construction.
* go-gcc.cc (Gcc_backend::implicit_variable): Rename from gc_root_variable. Add name and is_constant parameters. From-SVN: r210088
Diffstat (limited to 'gcc/go/gofrontend/backend.h')
-rw-r--r--gcc/go/gofrontend/backend.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/backend.h b/gcc/go/gofrontend/backend.h
index e49cedf..95f494a 100644
--- a/gcc/go/gofrontend/backend.h
+++ b/gcc/go/gofrontend/backend.h
@@ -536,11 +536,16 @@ class Backend
bool address_is_taken, Location location,
Bstatement** pstatement) = 0;
- // Create a GC root variable. TYPE is the __go_gc_root_list struct described
- // in Gogo::register_gc_vars. INIT is the composite literal consisting of a
- // pointer to the next GC root and the global variables registered.
+ // 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.
virtual Bvariable*
- gc_root_variable(Btype* type, Bexpression* init) = 0;
+ implicit_variable(const std::string& name, Btype* type, Bexpression* init,
+ bool is_constant) = 0;
// Create a named immutable initialized data structure. This is
// used for type descriptors, map descriptors, and function