compiler, reflect: Quote package path with tabs.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 14 Jun 2012 05:04:04 +0000 (05:04 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 14 Jun 2012 05:04:04 +0000 (05:04 +0000)
From-SVN: r188548

gcc/go/gofrontend/types.cc
libgo/go/reflect/type.go

index ff6b5bddbd2787045976ce905e46cf668716b867..228f3faa4a4f3a8a3798f83334ccb55d1f605622 100644 (file)
@@ -8340,16 +8340,16 @@ Named_type::do_reflection(Gogo* gogo, std::string* ret) const
       // -fgo-pkgpath was introduced.  When -fgo-pkgpath is specified,
       // we use it to make a unique reflection string, so that the
       // type canonicalization in the reflect package will work.  In
-      // order to be compatible with the gc compiler, we quote the
-      // package path, so that the reflect methods can discard it.
+      // order to be compatible with the gc compiler, we put tabs into
+      // the package path, so that the reflect methods can discard it.
       const Package* package = this->named_object_->package();
       if (gogo->pkgpath_from_option())
        {
-         ret->push_back('"');
+         ret->push_back('\t');
          ret->append(package != NULL
                      ? package->pkgpath_symbol()
                      : gogo->pkgpath_symbol());
-         ret->push_back('"');
+         ret->push_back('\t');
        }
       ret->append(package != NULL
                  ? package->package_name()
index a264ef1e08248304d3b129e70f267c673057f9b9..93021bae26327678296f3d63e84457422ee22408 100644 (file)
@@ -444,7 +444,7 @@ func (t *commonType) String() string {
        r := make([]byte, len(s))
        j := 0
        for i := 0; i < len(s); i++ {
-               if s[i] == '"' {
+               if s[i] == '\t' {
                        q = !q
                } else if !q {
                        r[j] = s[i]