aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-08-10 00:46:35 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-08-10 00:46:35 +0000
commita36cb5b1d411315e2f2b565151e648056d0ae7bb (patch)
tree262f26e7b252dbfe1b56a2bc1de810c258753936 /gcc
parent143d49f313785eaa9e06d0f41506b4782549a4d8 (diff)
downloadgcc-a36cb5b1d411315e2f2b565151e648056d0ae7bb.zip
gcc-a36cb5b1d411315e2f2b565151e648056d0ae7bb.tar.gz
gcc-a36cb5b1d411315e2f2b565151e648056d0ae7bb.tar.bz2
compiler: implement go:noinline and go:nosplit directives
Reviewed-on: https://go-review.googlesource.com/26652 From-SVN: r239315
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/gogo.cc8
-rw-r--r--gcc/go/gofrontend/lex.cc2
3 files changed, 9 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index d4c7a90..72d8f1e 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-85a9c6992d9660e36972c279a5252fd9591bb765
+8da2129a005cc1f44d4d993b0b7312b64c0d68a4
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index a72ef95..0bbf6ac 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -5083,11 +5083,19 @@ Function::get_or_make_decl(Gogo* gogo, Named_object* no)
if (this->calls_defer_retaddr_)
is_inlinable = false;
+ // Check the //go:noinline compiler directive.
+ if ((this->pragmas_ & GOPRAGMA_NOINLINE) != 0)
+ is_inlinable = false;
+
// If this is a thunk created to call a function which calls
// the predeclared recover function, we need to disable
// stack splitting for the thunk.
bool disable_split_stack = this->is_recover_thunk_;
+ // Check the //go:nosplit compiler directive.
+ if ((this->pragmas_ & GOPRAGMA_NOSPLIT) != 0)
+ disable_split_stack = true;
+
// This should go into a unique section if that has been
// requested elsewhere, or if this is a nointerface function.
// We want to put a nointerface function into a unique section
diff --git a/gcc/go/gofrontend/lex.cc b/gcc/go/gofrontend/lex.cc
index 9498c7d..692aa50 100644
--- a/gcc/go/gofrontend/lex.cc
+++ b/gcc/go/gofrontend/lex.cc
@@ -1842,13 +1842,11 @@ Lex::skip_cpp_comment()
{
// Applies to the next function. Do not split the stack when
// entering the function.
- // FIXME: Not implemented.
this->pragmas_ |= GOPRAGMA_NOSPLIT;
}
else if (verb == "go:noinline")
{
// Applies to the next function. Do not inline the function.
- // FIXME: Not implemented.
this->pragmas_ |= GOPRAGMA_NOINLINE;
}
else if (verb == "go:systemstack")