aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/embed.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
committerIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
commitaa1e672b5d99102b03eb5fb9c51609c45f62bff7 (patch)
tree886212591b1c9d127eaaf234a4a2e22452ea384a /gcc/go/gofrontend/embed.cc
parent97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (diff)
parent3a39a31b8ae9c6465434aefa657f7fcc86f905c0 (diff)
downloadgcc-devel/gccgo.zip
gcc-devel/gccgo.tar.gz
gcc-devel/gccgo.tar.bz2
Merge from trunk revision 3a39a31b8ae9c6465434aefa657f7fcc86f905c0.devel/gccgo
Diffstat (limited to 'gcc/go/gofrontend/embed.cc')
-rw-r--r--gcc/go/gofrontend/embed.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/embed.cc b/gcc/go/gofrontend/embed.cc
index 0584f70..6dada5e 100644
--- a/gcc/go/gofrontend/embed.cc
+++ b/gcc/go/gofrontend/embed.cc
@@ -19,8 +19,8 @@
// Read a file into *DATA. Returns false on error.
-static bool
-read_file(const char* filename, Location loc, std::string* data)
+bool
+Gogo::read_file(const char* filename, Location loc, std::string* data)
{
int fd = open(filename, O_RDONLY | O_BINARY);
if (fd < 0)
@@ -346,7 +346,8 @@ Gogo::read_embedcfg(const char *filename)
bool
Embedcfg_reader::initialize_from_file()
{
- if (!read_file(this->filename_, Linemap::unknown_location(), &this->data_))
+ if (!Gogo::read_file(this->filename_, Linemap::unknown_location(),
+ &this->data_))
return false;
if (this->data_.empty())
{
@@ -849,7 +850,7 @@ Gogo::initializer_for_embeds(Type* type,
}
std::string data;
- if (!read_file(this->embed_files_[paths[0]].c_str(), loc, &data))
+ if (!Gogo::read_file(this->embed_files_[paths[0]].c_str(), loc, &data))
return Expression::make_error(loc);
Expression* e = Expression::make_string(data, loc);
@@ -909,7 +910,7 @@ Gogo::initializer_for_embeds(Type* type,
std::string data;
if ((*pp)[pp->size() - 1] != '/')
{
- if (!read_file(this->embed_files_[*pp].c_str(), loc, &data))
+ if (!Gogo::read_file(this->embed_files_[*pp].c_str(), loc, &data))
return Expression::make_error(loc);
}