[llvm-bugs] [Bug 51384] New: Demangled name of dynamic initializer in PDB doesn't match demangled name produced by MSVC

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 6 07:11:58 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51384

            Bug ID: 51384
           Summary: Demangled name of dynamic initializer in PDB doesn't
                    match demangled name produced by MSVC
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: stefan.reinalter at molecular-matters.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

When compiling the following code, the compiler will emit a dynamic initializer
into the executable:

class CompilerSegmentTest
{
public:
  CompilerSegmentTest(void)
  {
    printf("CompilerSegmentTest CTR called\n");
  }

  ~CompilerSegmentTest(void)
  {
    printf("CompilerSegmentTest DTR called\n");
  }
};

namespace customNamespace
{
#pragma warning (disable:4074)
#pragma init_seg(compiler)

static CompilerSegmentTest g_compilerSegmentTestInstance;

#pragma warning (default:4074)
}


In the .obj file, this symbol is named
??__Eg_compilerSegmentTestInstance at customNamespace@@YAXXZ.

In the PDB file, this symbol will appear with its demangled name only, because
it is private and not contained in the public symbol stream.

When using MSVC, the demangled name in the PDB will be:
customNamespace::`dynamic initializer for 'g_compilerSegmentTestInstance''

When using lld, the demangled name in the PDB is slightly different however:
customNamespace::`dynamic initializer for 'g_compilerSegmentTestInstance'
(note the last missing ')

I've noticed this with a few symbols, and it seems that lld (or clang?) doesn't
like to emit two consecutive '' in demangled names.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210806/6616bd01/attachment-0001.html>


More information about the llvm-bugs mailing list