Mercurial > hg > CbC > CbC_gcc
diff gcc/go/gofrontend/go-linemap.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line diff
--- a/gcc/go/gofrontend/go-linemap.h Thu Oct 25 07:37:49 2018 +0900 +++ b/gcc/go/gofrontend/go-linemap.h Thu Feb 13 11:34:05 2020 +0900 @@ -63,7 +63,11 @@ virtual std::string to_string(Location) = 0; - // Return the line number for a given location (for debugging dumps) + // Return the file name for a given location. + virtual std::string + location_file(Location) = 0; + + // Return the line number for a given location. virtual int location_line(Location) = 0; @@ -140,7 +144,15 @@ return Linemap::instance_->to_string(loc); } - // Return line number for location + // Return the file name of a location. + static std::string + location_to_file(Location loc) + { + go_assert(Linemap::instance_ != NULL); + return Linemap::instance_->location_file(loc); + } + + // Return line number of a location. static int location_to_line(Location loc) {