[Issue 12440] New: Implement whole-program analysis

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 22 13:01:32 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12440

           Summary: Implement whole-program analysis
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bugzilla at digitalmars.com


--- Comment #0 from Walter Bright <bugzilla at digitalmars.com> 2014-03-22 13:01:28 PDT ---
The idea is to examine the whole program's class hierarchies to determine which
classes can be made final. Final classes can then benefit from non-virtual
dispatch of its virtual functions, and even inline them.

Normally, such is not possible because a linked-in object file that the
compiler doesn't know about could derive from a class.

Hence, to work, this would have to add a flag to the compiler, such as
-wholeprogram, that causes the compiler to make the assumption that all classes
defined in files supplied to the compiler on the command line (not imports) are
never derived from from other object files or DLLs.

This could be implemented as a pass inserted before the inliner runs.

Note that if the user throws this flag, and the assumption is not true, the
resulting program will behave badly in unpredictable ways.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list