From 75bd5a1db9c6c967878fc8a466ce504a1f6ee96b Mon Sep 17 00:00:00 2001 From: bstarynk Date: Thu, 3 Jan 2013 09:01:56 +0000 Subject: 2013-01-03 Basile Starynkevitch MELT branch merged with trunk rev 194833 using svnmerge.py git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@194835 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/gogo.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gcc/go/gofrontend/gogo.h') 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 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. -- cgit v1.2.1