]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: New module mangling ABI
authorNathan Sidwell <nathan@acm.org>
Thu, 3 Mar 2022 00:13:43 +0000 (19:13 -0500)
committerNathan Sidwell <nathan@acm.org>
Fri, 4 Mar 2022 15:15:18 +0000 (10:15 -0500)
This implements a new module mangling ABI as the original one has a
few issues:

a) it was not demangleable (oops)

b) implemented a weak ownership model.

This implements a strong ownership model, so that exported entities
from named modules are mangled to include their module attachment.
This gives more informative linker diagnostics and better module
isolation.  Weak ownership was hoped to allow backwards compatibility
with non-modular code, but in practice was very brittle, and C++20
added new semantics for linkage declarations that cover the needed
functionality.

FAOD Clang is also moving to this ABI and documentation will be added
to the Itanium ABI specification.

gcc/cp/
* cp-tree.h (mangle_identifier): Replace with ...
(mangle_module_component): ... this.
* mangle.cc (dump_substitution_candidates): Adjust.
(add_substitution): Likewise.
(find_substitution): Likewise.
(unmangled_name_p): Likewise.
(mangle_module_substitution): Reimplement.
(mangle_module_component): New.
(write_module, maybe_write_module): Adjust.
(write_name): Drop modules here.
(write_unqualified): Do them here instead.
(mangle_global_init): Adjust.
* module.cc (module_state::mangle): Adjust.
(mangle_module): Likewise.
(get_originating_module): Adjust.

gcc/testsuite/
* g++.dg/modules/fn-inline-1_b.C: Adjust.
* g++.dg/modules/fn-inline-1_c.C: Adjust.
* g++.dg/modules/imp-inline-1_a.C: Adjust.
* g++.dg/modules/imp-inline-1_b.C: Adjust.
* g++.dg/modules/init-2_a.C: Adjust.
* g++.dg/modules/init-2_b.C: Adjust.
* g++.dg/modules/init-2_c.C: Adjust.
* g++.dg/modules/member-def-2_d.C: Adjust.
* g++.dg/modules/mod-sym-1.C: Adjust.
* g++.dg/modules/mod-sym-2.C: Adjust.
* g++.dg/modules/mod-sym-3.C: Adjust.
* g++.dg/modules/sym-subst-1.C: Adjust.
* g++.dg/modules/sym-subst-2_b.C: Adjust.
* g++.dg/modules/sym-subst-3_a.C: Adjust.
* g++.dg/modules/sym-subst-3_b.C: Adjust.
* g++.dg/modules/sym-subst-4.C: Adjust.
* g++.dg/modules/sym-subst-5.C: Adjust.
* g++.dg/modules/sym-subst-6.C: Adjust.
* g++.dg/modules/tpl-spec-1_a.C: Adjust.
* g++.dg/modules/tpl-spec-2_b.C: Adjust.
* g++.dg/modules/tpl-spec-2_d.C: Adjust.
* g++.dg/modules/tpl-spec-3_a.C: Adjust.
* g++.dg/modules/virt-1_a.C: Adjust.
* g++.dg/modules/virt-2_a.C: Adjust.
* g++.dg/modules/virt-2_b.C: Adjust.
* g++.dg/modules/virt-2_c.C: Adjust.
* g++.dg/modules/vtt-1_a.C: Adjust.
* g++.dg/modules/vtt-1_b.C: Adjust.

31 files changed:
gcc/cp/cp-tree.h
gcc/cp/mangle.cc
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/fn-inline-1_b.C
gcc/testsuite/g++.dg/modules/fn-inline-1_c.C
gcc/testsuite/g++.dg/modules/imp-inline-1_a.C
gcc/testsuite/g++.dg/modules/imp-inline-1_b.C
gcc/testsuite/g++.dg/modules/init-2_a.C
gcc/testsuite/g++.dg/modules/init-2_b.C
gcc/testsuite/g++.dg/modules/init-2_c.C
gcc/testsuite/g++.dg/modules/member-def-2_d.C
gcc/testsuite/g++.dg/modules/mod-sym-1.C
gcc/testsuite/g++.dg/modules/mod-sym-2.C
gcc/testsuite/g++.dg/modules/mod-sym-3.C
gcc/testsuite/g++.dg/modules/sym-subst-1.C
gcc/testsuite/g++.dg/modules/sym-subst-2_b.C
gcc/testsuite/g++.dg/modules/sym-subst-3_a.C
gcc/testsuite/g++.dg/modules/sym-subst-3_b.C
gcc/testsuite/g++.dg/modules/sym-subst-4.C
gcc/testsuite/g++.dg/modules/sym-subst-5.C
gcc/testsuite/g++.dg/modules/sym-subst-6.C
gcc/testsuite/g++.dg/modules/tpl-spec-1_a.C
gcc/testsuite/g++.dg/modules/tpl-spec-2_b.C
gcc/testsuite/g++.dg/modules/tpl-spec-2_d.C
gcc/testsuite/g++.dg/modules/tpl-spec-3_a.C
gcc/testsuite/g++.dg/modules/virt-1_a.C
gcc/testsuite/g++.dg/modules/virt-2_a.C
gcc/testsuite/g++.dg/modules/virt-2_b.C
gcc/testsuite/g++.dg/modules/virt-2_c.C
gcc/testsuite/g++.dg/modules/vtt-1_a.C
gcc/testsuite/g++.dg/modules/vtt-1_b.C

index 80994e9479336d366b72001bad210536c901354f..cf08e16e17277903030779b71b44fb9528dea0f1 100644 (file)
@@ -2829,6 +2829,12 @@ struct GTY(()) lang_decl_base {
 
   /* The following apply to VAR, FUNCTION, TYPE, CONCEPT, & NAMESPACE
      decls.  */
+  // FIXME: Purview and Attachment are not the same thing, due to
+  // linkage-declarations.  The modules code presumes they are the
+  // same.  (For context, linkage-decl semantics was a very late
+  // change). We need a module_attachment_p flag, and this will allow
+  // some simplification of how we handle header unit entities.
+  // Hurrah!
   unsigned module_purview_p : 1;          /* in module purview (not GMF) */
   unsigned module_import_p : 1;           /* from an import */
   unsigned module_entity_p : 1;                   /* is in the entitity ary &
@@ -8180,7 +8186,7 @@ extern char *get_mangled_vtable_map_var_name    (tree);
 extern bool mangle_return_type_p               (tree);
 extern tree mangle_decomp                      (tree, vec<tree> &);
 extern void mangle_module_substitution         (int);
-extern void mangle_identifier                  (char, tree);
+extern int mangle_module_component             (tree id, bool partition);
 extern tree mangle_module_global_init          (int);
 
 /* in dump.cc */
index a20f0e003291c24eac1e7c146d0ec541541feb12..6657ce4d983447c53017264766cdfd9d34fc5e57 100644 (file)
@@ -102,7 +102,8 @@ along with GCC; see the file COPYING3.  If not see
 /* Things we only need one of.  This module is not reentrant.  */
 struct GTY(()) globals {
   /* An array of the current substitution candidates, in the order
-     we've seen them.  */
+     we've seen them.  Contains NULLS, which correspond to module
+     substitutions.  */
   vec<tree, va_gc> *substitutions;
 
   /* The entity that is being mangled.  */
@@ -318,20 +319,26 @@ dump_substitution_candidates (void)
 
       if (i > 0)
        fprintf (stderr, "                    ");
-      if (DECL_P (el))
+      if (!el)
+       name = "module";
+      else if (DECL_P (el))
        name = IDENTIFIER_POINTER (DECL_NAME (el));
       else if (TREE_CODE (el) == TREE_LIST)
        name = IDENTIFIER_POINTER (DECL_NAME (TREE_VALUE (el)));
       else if (TYPE_NAME (el))
        name = TYPE_NAME_STRING (el);
       fprintf (stderr, " S%d_ = ", i - 1);
-      if (TYPE_P (el) &&
-         (CP_TYPE_RESTRICT_P (el)
-          || CP_TYPE_VOLATILE_P (el)
-          || CP_TYPE_CONST_P (el)))
-       fprintf (stderr, "CV-");
-      fprintf (stderr, "%s (%s at %p)\n",
-              name, get_tree_code_name (TREE_CODE (el)), (void *) el);
+      if (el)
+       {
+         if (TYPE_P (el) &&
+             (CP_TYPE_RESTRICT_P (el)
+              || CP_TYPE_VOLATILE_P (el)
+              || CP_TYPE_CONST_P (el)))
+           fprintf (stderr, "CV-");
+         fprintf (stderr, "%s (%s at %p)",
+                  name, get_tree_code_name (TREE_CODE (el)), (void *) el);
+       }
+      fprintf (stderr, "\n");
     }
 }
 
@@ -443,11 +450,12 @@ add_substitution (tree node)
       tree candidate;
 
       FOR_EACH_VEC_SAFE_ELT (G.substitutions, i, candidate)
-       {
-         gcc_assert (!(DECL_P (node) && node == candidate));
-         gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
-                     && same_type_p (node, candidate)));
-       }
+       if (candidate)
+         {
+           gcc_assert (!(DECL_P (node) && node == candidate));
+           gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
+                         && same_type_p (node, candidate)));
+         }
     }
 
   /* Put the decl onto the varray of substitution candidates.  */
@@ -669,20 +677,21 @@ find_substitution (tree node)
     tags = get_abi_tags (type);
   /* Now check the list of available substitutions for this mangling
      operation.  */
-  if (!abbr || tags) for (i = 0; i < size; ++i)
-    {
-      tree candidate = (*G.substitutions)[i];
-      /* NODE is a matched to a candidate if it's the same decl node or
-        if it's the same type.  */
-      if (decl == candidate
-         || (TYPE_P (candidate) && type && TYPE_P (node)
-             && same_type_p (type, candidate))
-         || NESTED_TEMPLATE_MATCH (node, candidate))
+  if (!abbr || tags)
+    for (i = 0; i < size; ++i)
+      if (tree candidate = (*G.substitutions)[i])
        {
-         write_substitution (i);
-         return 1;
+         /* NODE is a matched to a candidate if it's the same decl node or
+            if it's the same type.  */
+         if (decl == candidate
+             || (TYPE_P (candidate) && type && TYPE_P (node)
+                 && same_type_p (type, candidate))
+             || NESTED_TEMPLATE_MATCH (node, candidate))
+           {
+             write_substitution (i);
+             return 1;
+           }
        }
-    }
 
   if (!abbr)
     /* No substitution found.  */
@@ -735,6 +744,10 @@ unmangled_name_p (const tree decl)
       if (get_abi_tags (decl))
        return false;
 
+      // Declarations attached to a named module are mangled
+      if (modules_p () && get_originating_module (decl, true) >= 0)
+       return false;
+
       /* The names of non-static global variables aren't mangled.  */
       return true;
     }
@@ -853,51 +866,49 @@ write_encoding (const tree decl)
 void
 mangle_module_substitution (int v)
 {
-  if (v < 10)
-    {
-      write_char ('_');
-      write_char ('0' + v);
-    }
-  else
-    {
-      write_char ('W');
-      write_unsigned_number (v - 10);
-      write_char ('_');
-    }
+  write_substitution (v - 1);
 }
 
-void
-mangle_identifier (char c, tree id)
+int
+mangle_module_component (tree comp, bool partition_p)
 {
-  if (c)
-    write_char (c);
-  write_source_name (id);
+  write_char ('W');
+  if (partition_p)
+    write_char ('P');
+  write_source_name (comp);
+
+  // Module substitutions use the same number-space as entity
+  // substitutions, but are orthogonal.
+  vec_safe_push (G.substitutions, NULL_TREE);
+  return G.substitutions->length ();
 }
 
 /* If the outermost non-namespace context (including DECL itself) is
    a module-linkage decl, mangle the module information.  For module
    global initializers we need to include the partition part.
 
-   <module-name> ::= W <module-id>+ E
-   <module-id> :: <unqualified-name>
-               || _ <digit>  ;; short backref
-              || W <number> _  ;; long backref
-               || P <module-id> ;; partition introducer
+   <module-name> ::= <module-sub>
+                || <subst>
+                 || <module-name> <module-sub>
+   <module-sub> :: W [P] <unqualified-name>
 */
 
 static void
 write_module (int m, bool include_partition)
 {
   G.mod = true;
-
-  write_char ('W');
   mangle_module (m, include_partition);
-  write_char ('E');
 }
 
 static void
 maybe_write_module (tree decl)
 {
+  if (!DECL_NAMESPACE_SCOPE_P (decl))
+    return;
+
+  if (TREE_CODE (decl) == NAMESPACE_DECL && DECL_NAME (decl))
+    return;
+
   int m = get_originating_module (decl, true);
   if (m >= 0)
     write_module (m, false);
@@ -965,9 +976,6 @@ write_name (tree decl, const int ignore_local_scope)
       decl = TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (decl)));
     }
 
-  if (modules_p ())
-    maybe_write_module (decl);
-
   context = decl_mangling_context (decl);
 
   gcc_assert (context != NULL_TREE);
@@ -1356,10 +1364,10 @@ find_decomp_unqualified_name (tree decl, size_t *len)
 /* We don't need to handle thunks, vtables, or VTTs here.  Those are
    mangled through special entry points.
 
-    <unqualified-name>  ::= <operator-name>
+    <unqualified-name>  ::= [<module-name>] <operator-name>
                        ::= <special-name>
-                       ::= <source-name>
-                       ::= <unnamed-type-name>
+                       ::= [<module-name>] <source-name>
+                       ::= [<module-name>] <unnamed-type-name>
                        ::= <local-source-name> 
 
     <local-source-name>        ::= L <source-name> <discriminator> */
@@ -1385,6 +1393,9 @@ write_unqualified_name (tree decl)
 {
   MANGLE_TRACE_TREE ("unqualified-name", decl);
 
+  if (modules_p ())
+    maybe_write_module (decl);
+
   if (identifier_p (decl))
     {
       write_unqualified_id (decl);
@@ -3996,7 +4007,6 @@ mangle_module_global_init (int module)
 
   write_string ("_ZGI");
   write_module (module, true);
-  write_char ('v');
 
   return finish_mangling_get_identifier ();
 }
index 6e6b008b3a5c2b5d55cdeec9a56a7b75d49fb70b..ddaf9c292c183e364c0af0403b8b2b857e258e48 100644 (file)
@@ -13893,20 +13893,18 @@ void
 module_state::mangle (bool include_partition)
 {
   if (subst)
-    mangle_module_substitution (subst - 1);
+    mangle_module_substitution (subst);
   else
     {
       if (parent)
        parent->mangle (include_partition);
-      if (include_partition || !is_partition ())
+      if (include_partition || !is_partition ()) 
        {
-         char p = 0;
-         // Partitions are significant for global initializer functions
-         if (is_partition () && !parent->is_partition ())
-           p = 'P';
+         // Partitions are significant for global initializer
+         // functions
+         bool partition = is_partition () && !parent->is_partition ();
+         subst = mangle_module_component (name, partition);
          substs.safe_push (this);
-         subst = substs.length ();
-         mangle_identifier (p, name);
        }
     }
 }
@@ -13916,6 +13914,8 @@ mangle_module (int mod, bool include_partition)
 {
   module_state *imp = (*modules)[mod];
 
+  gcc_checking_assert (!imp->is_header ());
+
   if (!imp->name)
     /* Set when importing the primary module interface.  */
     imp = imp->parent;
@@ -18391,14 +18391,15 @@ get_originating_module (tree decl, bool for_mangle)
   if (!DECL_LANG_SPECIFIC (not_tmpl))
     return for_mangle ? -1 : 0;
 
-  if (for_mangle
-      && (DECL_MODULE_EXPORT_P (owner) || !DECL_MODULE_PURVIEW_P (not_tmpl)))
+  if (for_mangle && !DECL_MODULE_PURVIEW_P (not_tmpl))
     return -1;
 
-  if (!DECL_MODULE_IMPORT_P (not_tmpl))
-    return 0;
+  int mod = !DECL_MODULE_IMPORT_P (not_tmpl) ? 0 : get_importing_module (owner);
 
-  return get_importing_module (owner);
+  if (for_mangle && (*modules)[mod]->is_header ())
+    return -1;
+
+  return mod;
 }
 
 unsigned
index 72de1a9a51443caaa828ccd65dbb0b9def014c7c..4890a15d98e93ba7a126b24e0b1eb4135e13af19 100644 (file)
@@ -6,6 +6,6 @@ int Frob (int n, int a)
   return frob (n, a);
 }
 
-// { dg-final { scan-assembler "_ZW3bobE4frobii:" } }
-// { dg-final { scan-assembler ".weak(_definition)?\[\t ]*_?_ZW3bobE4frobii" } }
-// { dg-final { scan-assembler "_Z4Frobii:" } }
+// { dg-final { scan-assembler "_ZW3bob4frobii:" } }
+// { dg-final { scan-assembler ".weak(_definition)?\[\t ]*_?_ZW3bob4frobii" } }
+// { dg-final { scan-assembler "_ZW3bob4Frobii:" } }
index 2b8bbdcd1af96b30483be01c2de61d5e9c15f055..96afc89756783732bbbed6c2d0865d9aa5470632 100644 (file)
@@ -12,5 +12,5 @@ int main ()
   return 0;
 }
 
-// { dg-final { scan-assembler "_Z4frobi:" } }
-// { dg-final { scan-assembler ".weak(_definition)?\[\t ]*_?_Z4frobi" } }
+// { dg-final { scan-assembler "_ZW3bob4frobi:" } }
+// { dg-final { scan-assembler ".weak(_definition)?\[\t ]*_?_ZW3bob4frobi" } }
index 56bbbdd0456bed3dfa686c5930a03da0807d6c95..de12b8e376c4ffd973371b34e21836bf113042b7 100644 (file)
@@ -33,5 +33,5 @@ export inline auto GMF ()
 }
 
 // { dg-final { scan-assembler-not {_ZN3Bob4frobEv:} } }
-// { dg-final { scan-assembler-not {_ZN4Bill4frobEv:} } }
-// { dg-final { scan-assembler {_ZN4Bill3dobEv:} } }
+// { dg-final { scan-assembler-not {_ZNW3Foo4Bill4frobEv:} } }
+// { dg-final { scan-assembler {_ZNW3Foo4Bill3dobEv:} } }
index c127f7005a3ab8ffb87254dc36aedc7cfa826936..c0d371a531d917140e79dc470e1965e82ba48944 100644 (file)
@@ -12,11 +12,11 @@ int main ()
 }
 
 // { dg-final { scan-assembler {_ZN3Bob4frobEv:} } }
-// { dg-final { scan-assembler {_ZN4Bill4frobEv:} } }
-// { dg-final { scan-assembler-not {_ZN4Bill3dobEv:} } }
-// { dg-final { scan-assembler {_Z3GMFv:} } }
+// { dg-final { scan-assembler {_ZNW3Foo4Bill4frobEv:} } }
+// { dg-final { scan-assembler-not {_ZNW3Foo4Bill3dobEv:} } }
+// { dg-final { scan-assembler {_ZW3Foo3GMFv:} } }
 
 // { dg-final { scan-assembler {call[ \t]+_?_ZN3Bob4frobEv} { target i?86-*-* x86_64-*-* } } }
-// { dg-final { scan-assembler {call[ \t]+_?_Z3GMFv} { target i?86-*-* x86_64-*-* } } }
-// { dg-final { scan-assembler {call[ \t]+_?_ZN4Bill3dobEv} { target i?86-*-* x86_64-*-* } } }
-// { dg-final { scan-assembler {call[ \t]+_?_ZN4Bill4frobEv} { target i?86-*-* x86_64-*-* } } }
+// { dg-final { scan-assembler {call[ \t]+_?_ZW3Foo3GMFv} { target i?86-*-* x86_64-*-* } } }
+// { dg-final { scan-assembler {call[ \t]+_?_ZNW3Foo4Bill3dobEv} { target i?86-*-* x86_64-*-* } } }
+// { dg-final { scan-assembler {call[ \t]+_?_ZNW3Foo4Bill4frobEv} { target i?86-*-* x86_64-*-* } } }
index 1e9093ef13d4c20ad53b5082f46589ef7476a789..c0390a1b56e2032a291e69ebeb189f59cd430e2d 100644 (file)
@@ -2,4 +2,4 @@
 export module Foo;
 // { dg-module-cmi Foo }
 
-// { dg-final { scan-assembler {_ZGIW3FooEv:} } }
+// { dg-final { scan-assembler {_ZGIW3Foo:} } }
index b9692ca862cb0e5f1801a02f62db734b51257d96..912ee406931d563c1d2aef51266077e924784b3c 100644 (file)
@@ -4,5 +4,5 @@ export module Bar;
 
 import Foo;
 
-// { dg-final { scan-assembler {_?_ZGIW3BarEv:} } }
-// { dg-final { scan-assembler {call[ \t]+_?_ZGIW3FooEv} { target i?86-*-* x86_64-*-* } } }
+// { dg-final { scan-assembler {_?_ZGIW3Bar:} } }
+// { dg-final { scan-assembler {call[ \t]+_?_ZGIW3Foo} { target i?86-*-* x86_64-*-* } } }
index c1fa5d80cd46dbfb997f847737644a6625f20b9c..4ca880df771827329e11d3bde2aba4c753c58a79 100644 (file)
@@ -4,5 +4,5 @@ import Foo;
 import Bar;
 
 // We know Bar imports Foo, so only call Bar's Global Init
-// { dg-final { scan-assembler {call[ \t]+_?_ZGIW3BarEv} { target i?86-*-* x86_64-*-* } } }
-// { dg-final { scan-assembler-not {call[ \t]+_?_ZGIW3FooEv} { target i?86-*-* x86_64-*-* } } }
+// { dg-final { scan-assembler {call[ \t]+_?_ZGIW3Bar} { target i?86-*-* x86_64-*-* } } }
+// { dg-final { scan-assembler-not {call[ \t]+_?_ZGIW3Foo} { target i?86-*-* x86_64-*-* } } }
index c2b9c3e655b0f568570d891c57cbade9c8a5031d..e096bd9daa9edd5d20475e0b74f876803292785a 100644 (file)
@@ -10,4 +10,4 @@ int main ()
 
 // { dg-final { scan-lang-dump {Reading function definition '::frob@foo:1::member@foo:1'} module } }
 
-// { dg-final { scan-assembler {_ZN4frob6memberEv:} } }
+// { dg-final { scan-assembler {_ZNW3foo4frob6memberEv:} } }
index b20710189d130c6ea0297c7b09f70f7b5c516500..8f22d174cac6e3f86beecd68220bd59824163630 100644 (file)
@@ -24,11 +24,10 @@ namespace Inner
   export inline void Baz2 () { Foo2 (); Bink2 (); }
 }
 
-// These fail until namespace hack is removed
-// { dg-final { scan-assembler "_ZW7linkageE3Foov:" } }
-// { dg-final { scan-assembler "_ZW7linkageE4Binkv:" } }
-// { dg-final { scan-assembler "_ZW7linkageEN5Inner4Foo2Ev:" } }
-// { dg-final { scan-assembler "_ZW7linkageEN5Inner5Bink2Ev:" } }
-// { dg-final { scan-assembler "_Z3Bazv:" } }
-// { dg-final { scan-assembler "_ZN5Inner4Baz2Ev:" } }
+// { dg-final { scan-assembler "_ZW7linkage3Foov:" } }
+// { dg-final { scan-assembler "_ZW7linkage4Binkv:" } }
+// { dg-final { scan-assembler "_ZN5InnerW7linkage4Foo2Ev:" } }
+// { dg-final { scan-assembler "_ZN5InnerW7linkage5Bink2Ev:" } }
+// { dg-final { scan-assembler "_ZW7linkage3Bazv:" } }
+// { dg-final { scan-assembler "_ZN5InnerW7linkage4Baz2Ev:" } }
 // { dg-final { scan-assembler "cfunc:" } }
index ef0c3f03317a6bd2fad1fb18ea9b75330ab1fa42..99c9f1b565d0418eeb88f5d33b73427d3ef39190 100644 (file)
@@ -19,5 +19,5 @@ namespace One {
 }
 
 // { dg-final { scan-assembler "_Z3Foov:" } }
-// { dg-final { scan-assembler "_ZW5okely6dokelyEN3One3Two5Three4Foo2Ev:" } }
-// { dg-final { scan-assembler "_ZN3One3Two5Three4Baz2Ev:" } }
+// { dg-final { scan-assembler "_ZN3One3Two5ThreeW5okelyW6dokely4Foo2Ev:" } }
+// { dg-final { scan-assembler "_ZN3One3Two5ThreeW5okelyW6dokely4Baz2Ev:" } }
index 9481ad1e719cdbd061b7e45dcb42e632d9561830..d280f08b697737e42769717c5ac816a9945c0e74 100644 (file)
@@ -20,7 +20,7 @@ namespace X
 inline void X::Foo () {}
 inline void X::Baz () {}
 
-// { dg-final { scan-assembler "_ZW3bobEN1X3FooEv:" } }
-// { dg-final { scan-assembler "_ZN1X3BazEv:" } }
-// { dg-final { scan-assembler "_ZW3bobEN1X1Y4QuuxEv:" } }
-// { dg-final { scan-assembler "_ZN1X1Y3BarEv:" } }
+// { dg-final { scan-assembler "_ZN1XW3bob3FooEv:" } }
+// { dg-final { scan-assembler "_ZN1XW3bob3BazEv:" } }
+// { dg-final { scan-assembler "_ZN1X1YW3bob4QuuxEv:" } }
+// { dg-final { scan-assembler "_ZN1X1YW3bob3BarEv:" } }
index 96ee25c65b560cda25fd309e367687d49b4de1df..6f638624a615805e0c81cf5068856b3d5a659188 100644 (file)
@@ -10,4 +10,4 @@ void frob (mytype &)
 {
 }
 
-// { dg-final { scan-assembler {_ZW3bob6stuart5kevinE4frobRW_2E6mytype:} } }
+// { dg-final { scan-assembler {_ZW3bobW6stuartW5kevin4frobRS1_6mytype:} } }
index fc3db0ac5f8aa0cda9ab51e52cad6820894d8cff..261f14588bcdc2cae50fcbe0f43408e0e5b981f5 100644 (file)
@@ -14,5 +14,5 @@ void bar (mytype &m)
   foo (m);
 }
 
-// { dg-final { scan-assembler {_ZW3bob5kevinE3barRW_1E6mytype:} } }
-// { dg-final { scan-assembler {_ZW3bob6stuartE5innerIW_05kevinE6mytypeEvRT_:} } }
+// { dg-final { scan-assembler {_ZW3bobW5kevin3barRS0_6mytype:} } }
+// { dg-final { scan-assembler {_ZW3bobW6stuart5innerIS_W5kevin6mytypeEvRT_:} } }
index bd958dc0dc3eaca6fa4abe232f48266184e2ebe2..a18947a5410d8cb84ebd341e6ad8d580fc6ede26 100644 (file)
@@ -6,4 +6,4 @@ struct s;
 
 export s *S;
 
-// { dg-final { scan-assembler {.globa?l[ \t]*_?S\n} } }
+// { dg-final { scan-assembler {.globa?l[ \t]*_?_ZW1tW1s1S\n} } }
index 9ae3f8f7816ba1956ef39b93bf50e3db9fcfb02b..6caa0509b24c799e107fc6ddda1812ec90ea654e 100644 (file)
@@ -4,4 +4,4 @@ export module t;
 import t.s;
 struct t;
 export void f (t*, decltype (S)){}
-// { dg-final { scan-assembler {_Z1fPW1tE1tPW_01sE1s:} } }
+// { dg-final { scan-assembler {_ZW1t1fPS_1tPS_W1s1s:} } }
index d2266c407f4fd47dd7d58254c38b5e4289cc1a6e..7faae00a8e2ea7fa959d53059efb4486f760f51d 100644 (file)
@@ -11,4 +11,4 @@ void frob (mytype &)
 {
 }
 
-// { dg-final { scan-assembler {_ZW4zero4eins4zwei4drei4vier4funf5sechs6sieben4acht4neunE4frobRW_9E6mytype:} } }
+// { dg-final { scan-assembler {_ZW4zeroW4einsW4zweiW4dreiW4vierW4funfW5sechsW6siebenW4achtW4neun4frobRS8_6mytype:} } }
index 1e26e7594efe87e6e8f32b806edff00e11f305ab..9883c13940ac76936697a4b3181ad398b8c38c0d 100644 (file)
@@ -11,4 +11,4 @@ void frob (mytype &)
 {
 }
 
-// { dg-final { scan-assembler {_ZW4zero4eins4zwei4drei4vier4funf5sechs6sieben4acht4neun4zehnE4frobRWW0_E6mytype:} } }
+// { dg-final { scan-assembler {_ZW4zeroW4einsW4zweiW4dreiW4vierW4funfW5sechsW6siebenW4achtW4neunW4zehn4frobRS9_6mytype:} } }
index 0a9ac6d8f384adecad804da933803629a5c93bad..e68c8e070bb343facc4579209e0d7c2f4cf7bfa5 100644 (file)
@@ -11,4 +11,4 @@ void frob (mytype &)
 {
 }
 
-// { dg-final { scan-assembler {_ZW4zero4eins4zwei4drei4vier4funf5sechs6sieben4acht4neun4zehn3elfE4frobRWW1_E6mytype:} } }
+// { dg-final { scan-assembler {_ZW4zeroW4einsW4zweiW4dreiW4vierW4funfW5sechsW6siebenW4achtW4neunW4zehnW3elf4frobRSA_6mytype:} } }
index 3bfb6394d565d7d448e73ca41298866a92f251a3..e7e6f97f8befa0fc53dbd5abfd52e5120144bea6 100644 (file)
@@ -19,4 +19,4 @@ template <> int foo<int> (int y)
 // { dg-final { scan-lang-dump {Cluster members:\n  \[0\]=specialization declaration '::foo<int>'} module } }
 // { dg-final { scan-lang-dump {Pending specialization '::foo<int>' entity:[0-9]* section:. keyed to '::foo'} module } }
 
-// { dg-final { scan-assembler {_Z3fooIiEiT_:} } }
+// { dg-final { scan-assembler {_ZW3TPL3fooIiEiT_:} } }
index a8b40caf91219aead26f544c440aae492c47a5bc..b6bf7d7946fadad61ae3dd9d6dee3db3a9354fee 100644 (file)
@@ -15,4 +15,4 @@ template <> int foo<int> (int y)
 // { dg-final { scan-lang-dump {Cluster members:\n  \[0\]=specialization declaration '::foo<int>'} module } }
 // { dg-final { scan-lang-dump {Pending specialization '::foo<int>' entity:[0-9]* section:. keyed to '::foo'} module } }
 
-// { dg-final { scan-assembler {_Z3fooIiEiT_:} } }
+// { dg-final { scan-assembler {_ZW3TPL3fooIiEiT_:} } }
index f8aae310b31e1cc2156b025e2acd3a079c2ce01f..4c707ae290d40f3e0c104acc86bfb04a9c1b3213 100644 (file)
@@ -23,5 +23,5 @@ int two ()
 // { dg-final { scan-lang-dump {Reading 1 pending entities keyed to '::foo'} module } }
 // { dg-final { scan-lang-dump-not {Reading definition function_decl '::foo@TPL:.<int>'} module } }
 
-// { dg-final { scan-assembler-not {_Z3fooIiEiT_:} } }
-// { dg-final { scan-assembler {_Z3fooIfEiT_:} } }
+// { dg-final { scan-assembler-not {_ZW3TPL3fooIiEiT_:} } }
+// { dg-final { scan-assembler {_ZW3TPL3fooIfEiT_:} } }
index 1e677fc42dff9570daa71939a5ad26a1fb126d58..521c0091b2deef2d94bd83e637d0388101586f6c 100644 (file)
@@ -24,4 +24,4 @@ template <> void frob::store (int i_)
 // { dg-final { scan-lang-dump {Cluster members:\n  \[0\]=specialization declaration '::frob::store<int>'} module } }
 // { dg-final { scan-lang-dump {Pending specialization '::frob::store<int>' entity:[0-9]* section:. keyed to '::frob'} module } }
 
-// { dg-final { scan-assembler {_ZN4frob5storeIiEEvT_:} } }
+// { dg-final { scan-assembler {_ZNW3TPL4frob5storeIiEEvT_:} } }
index 7719a28770923ae629ff3b7386d09fec4e287428..4081ff5969f60da1465d63f998c39081af4feeda 100644 (file)
@@ -20,6 +20,7 @@ export int Visit (Visitor *v)
   return v->Visit ();
 }
 
-// { dg-final { scan-assembler {_ZTV7Visitor:} } }
-// { dg-final { scan-assembler {_ZTI7Visitor:} } }
-// { dg-final { scan-assembler {_ZTS7Visitor:} } }
+// { dg-final { scan-assembler {_ZTVW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZTIW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZTSW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZW3foo5VisitPS_7Visitor:} } }
index 9115cc19cc28615455412aa14e3899133e6b07e3..580552be5a0d845904f6d9914050333f460ad9ca 100644 (file)
@@ -22,6 +22,6 @@ export int Visit (Visitor *v)
 }
 
 // Emit here
-// { dg-final { scan-assembler {_ZTV7Visitor:} } }
-// { dg-final { scan-assembler {_ZTI7Visitor:} } }
-// { dg-final { scan-assembler {_ZTS7Visitor:} } }
+// { dg-final { scan-assembler {_ZTVW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZTIW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZTSW3foo7Visitor:} } }
index 543218956e97d1157626e1167e6f2087e9dee750..e041f0721f9c861f42a391d40c385094cd55b287 100644 (file)
@@ -23,6 +23,6 @@ int main ()
 
 // We do not emit Visitor vtable
 // but we do emit rtti here
-// { dg-final { scan-assembler-not {_ZTV7Visitor:} } }
-// { dg-final { scan-assembler {_ZTI7Visitor:} } }
-// { dg-final { scan-assembler {_ZTS7Visitor:} } }
+// { dg-final { scan-assembler-not {_ZTVW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZTIW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZTSW3foo7Visitor:} } }
index 1ac7f994792db41292a7a38b0fd95529b1bea036..7b3eeebe5089bcfb2e5d2deb9aed26104e190824 100644 (file)
@@ -11,6 +11,6 @@ int Foo ()
 
 // We do emit Visitor vtable
 // andl also we do emit rtti here
-// { dg-final { scan-assembler {_ZTV7Visitor:} } }
-// { dg-final { scan-assembler {_ZTI7Visitor:} } }
-// { dg-final { scan-assembler {_ZTS7Visitor:} } }
+// { dg-final { scan-assembler {_ZTVW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZTIW3foo7Visitor:} } }
+// { dg-final { scan-assembler {_ZTSW3foo7Visitor:} } }
index 11a1f6fb161dfbdb6e5cb9d0586152e0b8c060fb..bef2c864525d6acaa0526d821da1dba41649f7a0 100644 (file)
@@ -31,6 +31,6 @@ export void make_foo ()
   derived d;
 }
 
-// { dg-final {scan-assembler "_ZTV4base:" } }
-// { dg-final {scan-assembler "_ZTV7derived:" } }
-// { dg-final {scan-assembler "_ZTT7derived:" } }
+// { dg-final {scan-assembler "_ZTVW3foo4base:" } }
+// { dg-final {scan-assembler "_ZTVW3foo7derived:" } }
+// { dg-final {scan-assembler "_ZTTW3foo7derived:" } }
index 2f1b9659a56986e273c33ea7bb23b27c36ad8ca3..87df9c272a871fd3120bb59fa4c1e60378eb90ba 100644 (file)
@@ -21,8 +21,8 @@ export inline void make_bar ()
   mine m;
 }
 
-// { dg-final {scan-assembler-not "_ZTV4base:" } }
-// { dg-final {scan-assembler-not "_ZTV7derived:" } }
-// { dg-final {scan-assembler-not "_ZTT7derived:" } }
-// { dg-final {scan-assembler "_ZTV4mine:" } }
-// { dg-final {scan-assembler "_ZTT4mine:" } }
+// { dg-final {scan-assembler-not "_ZTVW3foo4base:" } }
+// { dg-final {scan-assembler-not "_ZTVW3foo7derived:" } }
+// { dg-final {scan-assembler-not "_ZTTW3foo7derived:" } }
+// { dg-final {scan-assembler "_ZTVW3bar4mine:" } }
+// { dg-final {scan-assembler "_ZTTW3bar4mine:" } }