diff options
Diffstat (limited to 'gcc/go/gofrontend/gogo.h')
-rw-r--r-- | gcc/go/gofrontend/gogo.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h index cffdd219118..f96ffcdfdb9 100644 --- a/gcc/go/gofrontend/gogo.h +++ b/gcc/go/gofrontend/gogo.h @@ -377,6 +377,11 @@ class Gogo void add_named_object(Named_object*); + // Add an identifier to the list of names seen in the file block. + void + add_file_block_name(const std::string& name, Location location) + { this->file_block_names_[name] = location; } + // Mark all local variables in current bindings as used. This is // used when there is a parse error to avoid useless errors. void @@ -678,6 +683,10 @@ class Gogo // This is used for initialization dependency analysis. typedef std::map<Variable*, Named_object*> Var_deps; + // Type used to map identifiers in the file block to the location + // where they were defined. + typedef Unordered_map(std::string, Location) File_block_names; + // Type used to queue writing a type specific function. struct Specific_type_function { @@ -710,6 +719,8 @@ class Gogo // The global binding contour. This includes the builtin functions // and the package we are compiling. Bindings* globals_; + // The list of names we have seen in the file block. + File_block_names file_block_names_; // Mapping from import file names to packages. Imports imports_; // Whether the magic unsafe package was imported. @@ -2265,7 +2276,7 @@ class Bindings // Clear all names in file scope from the bindings. void - clear_file_scope(); + clear_file_scope(Gogo*); // Look up a name in this binding contour and in any enclosing // binding contours. This returns NULL if the name is not found. |