diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-19 05:27:19 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-19 05:27:19 +0000 |
commit | 9ca8281f597bc7d9f235424b667371280b9a9a18 (patch) | |
tree | cb0f3e4c8b179c8a4b73ed69005a7b2e283a36cd /gcc/go/gofrontend/types.h | |
parent | 2e4c148b20224b76dcec221ae033ce0a0ab38936 (diff) | |
download | gcc-9ca8281f597bc7d9f235424b667371280b9a9a18.tar.gz |
compiler: Fix multiple types with same name in function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191461 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/gofrontend/types.h')
-rw-r--r-- | gcc/go/gofrontend/types.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h index a542bf71738..7b879240e3a 100644 --- a/gcc/go/gofrontend/types.h +++ b/gcc/go/gofrontend/types.h @@ -2623,8 +2623,8 @@ class Named_type : public Type public: Named_type(Named_object* named_object, Type* type, Location location) : Type(TYPE_NAMED), - named_object_(named_object), in_function_(NULL), type_(type), - local_methods_(NULL), all_methods_(NULL), + named_object_(named_object), in_function_(NULL), in_function_index_(0), + type_(type), local_methods_(NULL), all_methods_(NULL), interface_method_tables_(NULL), pointer_interface_method_tables_(NULL), location_(location), named_btype_(NULL), dependencies_(), is_visible_(true), is_error_(false), is_placeholder_(false), @@ -2651,13 +2651,19 @@ class Named_type : public Type // Return the function in which this type is defined. This will // return NULL for a type defined in global scope. const Named_object* - in_function() const - { return this->in_function_; } + in_function(unsigned int *pindex) const + { + *pindex = this->in_function_index_; + return this->in_function_; + } // Set the function in which this type is defined. void - set_in_function(Named_object* f) - { this->in_function_ = f; } + set_in_function(Named_object* f, unsigned int index) + { + this->in_function_ = f; + this->in_function_index_ = index; + } // Return the name of the type. const std::string& @@ -2865,6 +2871,8 @@ class Named_type : public Type // If this type is defined in a function, a pointer back to the // function in which it is defined. Named_object* in_function_; + // The index of this type in IN_FUNCTION_. + unsigned int in_function_index_; // The actual type. Type* type_; // The list of methods defined for this type. Any named type can |