diff options
Diffstat (limited to 'gcc/go/gofrontend/gogo.h')
-rw-r--r-- | gcc/go/gofrontend/gogo.h | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h index 8b79116..cd4e38f 100644 --- a/gcc/go/gofrontend/gogo.h +++ b/gcc/go/gofrontend/gogo.h @@ -598,15 +598,21 @@ class Gogo return p != this->var_deps_.end() ? p->second : NULL; } - // Queue up a type-specific function to be written out. This is - // used when a type-specific function is needed when not at the top - // level. + // Queue up a type-specific hash function to be written out. This + // is used when a type-specific hash function is needed when not at + // top level. void - queue_specific_type_function(Type* type, Named_type* name, int64_t size, - const std::string& hash_name, - Function_type* hash_fntype, - const std::string& equal_name, - Function_type* equal_fntype); + queue_hash_function(Type* type, Named_type* name, int64_t size, + const std::string& hash_name, + Function_type* hash_fntype); + + // Queue up a type-specific equal function to be written out. This + // is used when a type-specific equal function is needed when not at + // top level. + void + queue_equal_function(Type* type, Named_type* name, int64_t size, + const std::string& equal_name, + Function_type* equal_fntype); // Write out queued specific type functions. void @@ -871,11 +877,13 @@ class Gogo std::string stub_method_name(const Package*, const std::string& method_name); - // Return the names of the hash and equality functions for TYPE. - void - specific_type_function_names(const Type*, const Named_type*, - std::string* hash_name, - std::string* equal_name); + // Return the name of the hash function for TYPE. + std::string + hash_function_name(const Type*, const Named_type*); + + // Return the name of the equal function for TYPE. + std::string + equal_function_name(const Type*, const Named_type*); // Return the assembler name to use for a global variable. std::string @@ -1059,22 +1067,21 @@ class Gogo // Type used to queue writing a type specific function. struct Specific_type_function { + enum Specific_type_function_kind { SPECIFIC_HASH, SPECIFIC_EQUAL }; + Type* type; Named_type* name; int64_t size; - std::string hash_name; - Function_type* hash_fntype; - std::string equal_name; - Function_type* equal_fntype; + Specific_type_function_kind kind; + std::string fnname; + Function_type* fntype; Specific_type_function(Type* atype, Named_type* aname, int64_t asize, - const std::string& ahash_name, - Function_type* ahash_fntype, - const std::string& aequal_name, - Function_type* aequal_fntype) - : type(atype), name(aname), size(asize), hash_name(ahash_name), - hash_fntype(ahash_fntype), equal_name(aequal_name), - equal_fntype(aequal_fntype) + Specific_type_function_kind akind, + const std::string afnname, + Function_type* afntype) + : type(atype), name(aname), size(asize), kind(akind), + fnname(afnname), fntype(afntype) { } }; |