1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/Demangle
Zachary Turner 2b73642244 [MS Demangler] Demangle symbols in function scopes.
There are a couple of issues you run into when you start getting into
more complex names, especially with regards to function local statics.
When you've got something like:

    int x() {
      static int n = 0;
      return n;
    }

Then this needs to demangle to something like

    int `int __cdecl x()'::`1'::n

The nested mangled symbols (e.g. `int __cdecl x()` in the above
example) also share state with regards to back-referencing, so
we need to be able to re-use the demangler in the middle of
demangling a symbol while sharing back-ref state.

To make matters more complicated, there are a lot of ambiguities
when demangling a symbol's qualified name, because a function local
scope pattern (usually something like `?1??name?`) looks suspiciously
like many other possible things that can occur, such as `?1` meaning
the second back-ref and disambiguating these cases is rather
interesting.  The `?1?` in a local scope pattern is actually a special
case of the more general pattern of `? + <encoded number> + ?`, where
"encoded number" can itself have embedded `@` symbols, which is a
common delimeter in mangled names.  So we have to take care during the
disambiguation, which is the reason for the overly complicated
`isLocalScopePattern` function in this patch.

I've added some pretty obnoxious tests to exercise all of this, which
exposed several other problems related to back-referencing, so those
are fixed here as well. Finally, I've uncommented some tests that were
previously marked as `FIXME`, since now these work.

Differential Revision: https://reviews.llvm.org/D49965

llvm-svn: 338226
2018-07-30 03:12:34 +00:00
..
ms-arg-qualifiers.test [MS Demangler] Print calling convention inside parentheses. 2018-07-26 20:33:48 +00:00
ms-back-references.test [MS Demangler] Properly handle function parameter back-refs. 2018-07-26 22:13:39 +00:00
ms-basic.test [MS Demangler] Print calling convention inside parentheses. 2018-07-26 20:33:48 +00:00
ms-mangle.test [MS Demangler] Demangle symbols in function scopes. 2018-07-30 03:12:34 +00:00
ms-nested-scopes.test [MS Demangler] Demangle symbols in function scopes. 2018-07-30 03:12:34 +00:00
ms-windows.test Add a Microsoft Demangler. 2018-07-20 17:27:48 +00:00