August 02, 2017
https://bugzilla.gdcproject.org/show_bug.cgi?id=270

            Bug ID: 270
           Summary: Weird ctor / dtor function names
           Product: GDC
           Version: development
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw@gdcproject.org
          Reporter: johannespfau@gmail.com

We use get_file_function_name to get the name for the ctor/dtor gate function. However, the output is kinda weird:

------------------------------------------
module test;
void foo() {}
------------------------------------------
gdc -fdump-tree-original -c test.d

=>
------------------------------------------
_GLOBAL__I__D4test3fooFZv ()
_GLOBAL__D__D4test3fooFZv ()
------------------------------------------

------------------------------------------
module test;
------------------------------------------
gdc -fdump-tree-original -c test.d

=>
------------------------------------------
_GLOBAL__I__D4test12__ModuleInfoZ ()
_GLOBAL__D__D4test12__ModuleInfoZ ()
------------------------------------------

Seems like it just used the name of the first function it can find. Initially I though this was some kind of incorrectly set flag but it seems to be intentional?

We could easily produce a unique name using the module mangle instead which also has the additional benefit that it produces reproducible names (the symbols are local, so it's not really an ABI issue, but changing names can be annoying when debugging).

-- 
You are receiving this mail because:
You are watching all bug changes.