public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@golang.org>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
		"gofrontend-dev@googlegroups.com"
	<gofrontend-dev@googlegroups.com>
Subject: Go patch committed: Mark concurrent calls
Date: Thu, 28 Apr 2016 19:43:00 -0000	[thread overview]
Message-ID: <CAOyqgcXWPaRMRRSxjG+WFef10EBjba0tvq=fs28asXkHTbm+6w@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

This patch by Chris Manghane marks concurrent calls in the Go
frontend.  This is a small change that prepares for future patches.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2921 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 235602)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@
-b17e404f5b8954e008b512741296d238ab7b2ef9
+50b2b468a85045c66d60112dc094c31ec4897123
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: gcc/go/gofrontend/expressions.h
===================================================================
--- gcc/go/gofrontend/expressions.h	(revision 235602)
+++ gcc/go/gofrontend/expressions.h	(working copy)
@@ -1985,8 +1985,8 @@ class Call_expression : public Expressio
       fn_(fn), args_(args), type_(NULL), results_(NULL), call_(NULL),
       call_temp_(NULL), expected_result_count_(0), is_varargs_(is_varargs),
       varargs_are_lowered_(false), types_are_determined_(false),
-      is_deferred_(false), issued_error_(false), is_multi_value_arg_(false),
-      is_flattened_(false)
+      is_deferred_(false), is_concurrent_(false), issued_error_(false),
+      is_multi_value_arg_(false), is_flattened_(false)
   { }
 
   // The function to call.
@@ -2057,6 +2057,16 @@ class Call_expression : public Expressio
   set_is_deferred()
   { this->is_deferred_ = true; }
 
+  // Whether this call is concurrently executed.
+  bool
+  is_concurrent() const
+  { return this->is_concurrent_; }
+
+  // Note that the call is concurrently executed.
+  void
+  set_is_concurrent()
+  { this->is_concurrent_ = true; }
+
   // We have found an error with this call expression; return true if
   // we should report it.
   bool
@@ -2170,6 +2180,8 @@ class Call_expression : public Expressio
   bool types_are_determined_;
   // True if the call is an argument to a defer statement.
   bool is_deferred_;
+  // True if the call is an argument to a go statement.
+  bool is_concurrent_;
   // True if we reported an error about a mismatch between call
   // results and uses.  This is to avoid producing multiple errors
   // when there are multiple Call_result_expressions.
Index: gcc/go/gofrontend/statements.cc
===================================================================
--- gcc/go/gofrontend/statements.cc	(revision 234304)
+++ gcc/go/gofrontend/statements.cc	(working copy)
@@ -2532,7 +2532,9 @@ Thunk_statement::build_thunk(Gogo* gogo,
 
   gogo->flatten_block(function, b);
 
-  if (may_call_recover || recover_arg != NULL)
+  if (may_call_recover
+      || recover_arg != NULL
+      || this->classification() == STATEMENT_GO)
     {
       // Dig up the call expression, which may have been changed
       // during lowering.
@@ -2546,6 +2548,8 @@ Thunk_statement::build_thunk(Gogo* gogo,
 	{
 	  if (may_call_recover)
 	    ce->set_is_deferred();
+	  if (this->classification() == STATEMENT_GO)
+	    ce->set_is_concurrent();
 	  if (recover_arg != NULL)
 	    ce->set_recover_arg(recover_arg);
 	}

                 reply	other threads:[~2016-04-28 19:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOyqgcXWPaRMRRSxjG+WFef10EBjba0tvq=fs28asXkHTbm+6w@mail.gmail.com' \
    --to=iant@golang.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gofrontend-dev@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).