diff options
author | Ian Lance Taylor <iant@google.com> | 2013-08-29 00:49:36 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-08-29 00:49:36 +0000 |
commit | 2ec974d90fb0920d58ed5f987e738f7d069eb3f4 (patch) | |
tree | 9e5b80ee7e73d7be2c52c7410fe6ac10e012dcf6 | |
parent | 652974f2aa68b6fee12dfbc1f89abbe6a225e455 (diff) | |
download | gcc-2ec974d90fb0920d58ed5f987e738f7d069eb3f4.zip gcc-2ec974d90fb0920d58ed5f987e738f7d069eb3f4.tar.gz gcc-2ec974d90fb0920d58ed5f987e738f7d069eb3f4.tar.bz2 |
go-gcc.cc (Gcc_backend::immutable_struct): Set TREE_PUBLIC if the struct is not hidden.
* go-gcc.cc (Gcc_backend::immutable_struct): Set TREE_PUBLIC if
the struct is not hidden.
(Gcc_backend::immutable_struct_set_init): Don't set TREE_PUBLIC.
From-SVN: r202065
-rw-r--r-- | gcc/go/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/go/go-gcc.cc | 16 |
2 files changed, 12 insertions, 10 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index d2997de..c730eca 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,9 @@ +2013-08-28 Ian Lance Taylor <iant@google.com> + + * go-gcc.cc (Gcc_backend::immutable_struct): Set TREE_PUBLIC if + the struct is not hidden. + (Gcc_backend::immutable_struct_set_init): Don't set TREE_PUBLIC. + 2013-08-06 Ian Lance Taylor <iant@google.com> * go-gcc.cc (Gcc_backend::immutable_struct_set_init): Use diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 1ecfaff..025bb2b 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -1475,8 +1475,8 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock, // Create a named immutable initialized data structure. Bvariable* -Gcc_backend::immutable_struct(const std::string& name, bool, bool, - Btype* btype, Location location) +Gcc_backend::immutable_struct(const std::string& name, bool is_hidden, + bool, Btype* btype, Location location) { tree type_tree = btype->get_tree(); if (type_tree == error_mark_node) @@ -1490,6 +1490,8 @@ Gcc_backend::immutable_struct(const std::string& name, bool, bool, TREE_CONSTANT(decl) = 1; TREE_USED(decl) = 1; DECL_ARTIFICIAL(decl) = 1; + if (!is_hidden) + TREE_PUBLIC(decl) = 1; // We don't call rest_of_decl_compilation until we have the // initializer. @@ -1503,8 +1505,7 @@ Gcc_backend::immutable_struct(const std::string& name, bool, bool, void Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&, - bool is_hidden, bool is_common, Btype*, - Location, + bool, bool is_common, Btype*, Location, Bexpression* initializer) { tree decl = var->get_tree(); @@ -1515,12 +1516,7 @@ Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&, DECL_INITIAL(decl) = init_tree; // We can't call make_decl_one_only until we set DECL_INITIAL. - if (!is_common) - { - if (!is_hidden) - TREE_PUBLIC(decl) = 1; - } - else + if (is_common) make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl)); // These variables are often unneeded in the final program, so put |