diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-08-31 03:01:15 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-08-31 03:01:15 +0000 |
commit | c70ff9f9be0c7360a37519ec68ac4dd41e8d0a3c (patch) | |
tree | 2a189fbed2324d7708bfe231203bd294028057c9 /gcc/go/gofrontend/lex.cc | |
parent | e7c8f75569e792f81a4f4ceee4e1b20f2544e7a4 (diff) | |
download | gcc-c70ff9f9be0c7360a37519ec68ac4dd41e8d0a3c.zip gcc-c70ff9f9be0c7360a37519ec68ac4dd41e8d0a3c.tar.gz gcc-c70ff9f9be0c7360a37519ec68ac4dd41e8d0a3c.tar.bz2 |
compiler, runtime: support and use single argument go:linkname
The gc compiler has started permitting go:linkname comments with a
single argument to mean that a function should be externally visible
outside the package. Implement this in the Go frontend.
Change the libgo runtime package to use it, rather than repeating the
name just to export a function.
Remove a couple of unnecessary go:linkname comments on declarations.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192197
From-SVN: r275239
Diffstat (limited to 'gcc/go/gofrontend/lex.cc')
-rw-r--r-- | gcc/go/gofrontend/lex.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/lex.cc b/gcc/go/gofrontend/lex.cc index 3276de4..f023613 100644 --- a/gcc/go/gofrontend/lex.cc +++ b/gcc/go/gofrontend/lex.cc @@ -1996,7 +1996,7 @@ Lex::skip_cpp_comment() while (ps < pend && *ps != ' ' && *ps != '\t') ++ps; - if (ps < pend) + if (ps <= pend) go_name = std::string(pg, ps - pg); while (ps < pend && (*ps == ' ' || *ps == '\t')) ++ps; @@ -2015,8 +2015,8 @@ Lex::skip_cpp_comment() ext_name.clear(); } } - if (go_name.empty() || ext_name.empty()) - go_error_at(loc, "usage: %<//go:linkname%> localname linkname"); + if (go_name.empty()) + go_error_at(loc, "usage: %<//go:linkname%> localname [linkname]"); else { if (this->linknames_ == NULL) |