public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-modules] Adjust module-mapper path search behaviour
@ 2020-11-05 13:34 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-11-05 13:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4c56b024984652e955cf6a44126b98fb20fb29ba

commit 4c56b024984652e955cf6a44126b98fb20fb29ba
Author: Nathan Sidwell <nathan@acm.org>
Date:   Thu Nov 5 05:33:47 2020 -0800

    Adjust module-mapper path search behaviour
    
            gcc/cp/
            * mapper-client.cc (spawn_mapper_program): Use @ to indicate
            looking in install dir.
            gcc/
            * doc/invoke.texi (fmodule-mapper): Document behaviour.
            gcc/testsuite/
            * g++.dg/modules/extern-tpl-1_b.C: Adjust options.
            * g++.dg/modules/inc-xlate-1_e.C: Adjust options.
            * g++.dg/modules/legacy-2_b.H: Adjust options.
            * g++.dg/modules/legacy-6_[cdef].C: Adjust options.

Diff:
---
 ChangeLog.modules                             | 13 +++++++++++++
 gcc/cp/mapper-client.cc                       | 15 +++++++++++++--
 gcc/doc/invoke.texi                           |  6 +++++-
 gcc/testsuite/g++.dg/modules/extern-tpl-1_b.C |  2 +-
 gcc/testsuite/g++.dg/modules/inc-xlate-1_e.C  |  2 +-
 gcc/testsuite/g++.dg/modules/legacy-2_b.H     |  2 +-
 gcc/testsuite/g++.dg/modules/legacy-6_c.C     |  2 +-
 gcc/testsuite/g++.dg/modules/legacy-6_d.C     |  2 +-
 gcc/testsuite/g++.dg/modules/legacy-6_e.C     |  2 +-
 gcc/testsuite/g++.dg/modules/legacy-6_f.C     |  2 +-
 10 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/ChangeLog.modules b/ChangeLog.modules
index 6d60eba511f..852cace8dc6 100644
--- a/ChangeLog.modules
+++ b/ChangeLog.modules
@@ -1,3 +1,16 @@
+2020-11-05  Nathan Sidwell  <nathan@acm.org>
+
+	gcc/cp/
+	* mapper-client.cc (spawn_mapper_program): Use @ to indicate
+	looking in install dir.
+	gcc/
+	* doc/invoke.texi (fmodule-mapper): Document behaviour.
+	gcc/testsuite/
+	* g++.dg/modules/extern-tpl-1_b.C: Adjust options.
+	* g++.dg/modules/inc-xlate-1_e.C: Adjust options.
+	* g++.dg/modules/legacy-2_b.H: Adjust options.
+	* g++.dg/modules/legacy-6_[cdef].C: Adjust options.
+
 2020-11-04  Nathan Sidwell  <nathan@acm.org>
 
 	gcc/testsuite/
diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
index de259b0564c..b9b24cdaa7f 100644
--- a/gcc/cp/mapper-client.cc
+++ b/gcc/cp/mapper-client.cc
@@ -50,6 +50,16 @@ spawn_mapper_program (char const **errmsg, std::string &name,
 	ptr++;
       if (!*ptr)
 	break;
+
+      if (!arg_no)
+	{
+	  /* @name means look in the compiler's install dir.  */
+	  if (ptr[0] == '@')
+	    ptr++;
+	  else
+	    full_program_name = nullptr;
+	}
+
       argv[arg_no++] = ptr;
       while (*ptr && *ptr != ' ')
 	ptr++;
@@ -67,10 +77,11 @@ spawn_mapper_program (char const **errmsg, std::string &name,
   else
     {
       int flags = PEX_SEARCH;
-	  
+
       if (full_program_name)
 	{
-	  /* Prepend the invoking path.  */
+	  /* Prepend the invoking path, if the mapper is a simple
+	     file name.  */
 	  size_t dir_len = progname - full_program_name;
 	  std::string argv0;
 	  argv0.reserve (dir_len + name.size ());
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index fd2b7f790cf..e6be6c6b91a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -32453,7 +32453,11 @@ form is non-functional.
 A program to spawn, and communicate with on its stdin/stdout streams.
 Your @var{PATH} environment variable is searched for the program.
 Arguments are separated by space characters, (it is not possible for
-one of the arguments delivered to the program to contain a space).
+one of the arguments delivered to the program to contain a space).  An
+exception is if @var{program} begins with @@.  In that case
+@var{program} (sans @@) is looked for in the compiler's internal
+binary directory.  Thus the default mapper-server can be specified
+with @code{@@mapper-server}.
 
 @item <>@r{[}?@var{ident}@r{]}
 @item <>@var{fdinout}@r{[}?@var{ident}@r{]}
diff --git a/gcc/testsuite/g++.dg/modules/extern-tpl-1_b.C b/gcc/testsuite/g++.dg/modules/extern-tpl-1_b.C
index 969edb5d23c..7839555ca4f 100644
--- a/gcc/testsuite/g++.dg/modules/extern-tpl-1_b.C
+++ b/gcc/testsuite/g++.dg/modules/extern-tpl-1_b.C
@@ -1,4 +1,4 @@
-// { dg-additional-options {-fmodules-ts -fmodule-mapper=|mapper-server} }
+// { dg-additional-options {-fmodules-ts -fmodule-mapper=|@mapper-server} }
 
 // Have to textually include, because we currently get confused about
 // the explicit instantiations and think they conflict
diff --git a/gcc/testsuite/g++.dg/modules/inc-xlate-1_e.C b/gcc/testsuite/g++.dg/modules/inc-xlate-1_e.C
index eaa023c9e3b..05ab7cced9a 100644
--- a/gcc/testsuite/g++.dg/modules/inc-xlate-1_e.C
+++ b/gcc/testsuite/g++.dg/modules/inc-xlate-1_e.C
@@ -1,4 +1,4 @@
-// { dg-additional-options "-fmodules-ts -fmodule-mapper=|mapper-server\\ -t\\ [srcdir]/inc-xlate-1.map" }
+// { dg-additional-options "-fmodules-ts -fmodule-mapper=|@mapper-server\\ -t\\ [srcdir]/inc-xlate-1.map" }
 export module bad;
 #include "inc-xlate-1_a.H"  // { dg-error "not be include-translated" }
 
diff --git a/gcc/testsuite/g++.dg/modules/legacy-2_b.H b/gcc/testsuite/g++.dg/modules/legacy-2_b.H
index bff60b77a21..5155cc04c13 100644
--- a/gcc/testsuite/g++.dg/modules/legacy-2_b.H
+++ b/gcc/testsuite/g++.dg/modules/legacy-2_b.H
@@ -1,4 +1,4 @@
-// { dg-additional-options "-fmodule-header -fmodule-mapper=|mapper-server\\ -mt\\ $srcdir/g++.dg/modules/legacy-2.map" }
+// { dg-additional-options "-fmodule-header -fmodule-mapper=|@mapper-server\\ -mt\\ $srcdir/g++.dg/modules/legacy-2.map" }
 // { dg-module-cmi {} }
 
 #define frob FROB
diff --git a/gcc/testsuite/g++.dg/modules/legacy-6_c.C b/gcc/testsuite/g++.dg/modules/legacy-6_c.C
index c8873e14c53..3a753a2a4f9 100644
--- a/gcc/testsuite/g++.dg/modules/legacy-6_c.C
+++ b/gcc/testsuite/g++.dg/modules/legacy-6_c.C
@@ -1,5 +1,5 @@
 // { dg-do preprocess }
-// { dg-additional-options "-fmodules-ts -fmodule-mapper=|mapper-server\\ -mt\\ [srcdir]/legacy-6.map" }
+// { dg-additional-options "-fmodules-ts -fmodule-mapper=|@mapper-server\\ -mt\\ [srcdir]/legacy-6.map" }
 
 #include "legacy-6_a.H"
 #include "legacy-6_b.H"
diff --git a/gcc/testsuite/g++.dg/modules/legacy-6_d.C b/gcc/testsuite/g++.dg/modules/legacy-6_d.C
index 65b85d4d7e7..fc8d04ee765 100644
--- a/gcc/testsuite/g++.dg/modules/legacy-6_d.C
+++ b/gcc/testsuite/g++.dg/modules/legacy-6_d.C
@@ -1,5 +1,5 @@
 // { dg-do preprocess }
-// { dg-additional-options "-fmodules-ts -fmodule-mapper=|mapper-server\\ -mt\\ [srcdir]/legacy-6.map" }
+// { dg-additional-options "-fmodules-ts -fmodule-mapper=|@mapper-server\\ -mt\\ [srcdir]/legacy-6.map" }
 
 #include "legacy-6_a.H"
 int i;
diff --git a/gcc/testsuite/g++.dg/modules/legacy-6_e.C b/gcc/testsuite/g++.dg/modules/legacy-6_e.C
index 2e92970205a..9d4dd9218dd 100644
--- a/gcc/testsuite/g++.dg/modules/legacy-6_e.C
+++ b/gcc/testsuite/g++.dg/modules/legacy-6_e.C
@@ -1,4 +1,4 @@
-// { dg-additional-options "-fmodule-mapper=|mapper-server\\ -f\\ [srcdir]/legacy-6.map" }
+// { dg-additional-options "-fmodule-mapper=|@mapper-server\\ -f\\ [srcdir]/legacy-6.map" }
 
 #include "legacy-6_a.H"
 #include "legacy-6_b.H"
diff --git a/gcc/testsuite/g++.dg/modules/legacy-6_f.C b/gcc/testsuite/g++.dg/modules/legacy-6_f.C
index 4669e3925c4..c15eadec6da 100644
--- a/gcc/testsuite/g++.dg/modules/legacy-6_f.C
+++ b/gcc/testsuite/g++.dg/modules/legacy-6_f.C
@@ -1,4 +1,4 @@
-// { dg-additional-options "-fmodule-mapper=|mapper-server\\ -f\\ [srcdir]/legacy-6.map" }
+// { dg-additional-options "-fmodule-mapper=|@mapper-server\\ -f\\ [srcdir]/legacy-6.map" }
 
 #include "legacy-6_a.H"
 int i;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-05 13:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 13:34 [gcc/devel/c++-modules] Adjust module-mapper path search behaviour Nathan Sidwell

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).