[LLVMbugs] [Bug 11936] New: Move TargetData to a new VMCore DataLayout class

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 6 12:40:58 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=11936

             Bug #: 11936
           Summary: Move TargetData to a new VMCore DataLayout class
           Product: libraries
           Version: 1.0
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


TargetData is a weird class, and it isn't like any of the other Target*
classes.  First, it is used extensively by the mid-level optimizer, and only
lightly by the code generator.  Second, it is part of LLVM IR (reflecting the
datalayout string) and not part of the code generator.  Third, it causes a
bunch of layering weirdness, because random optimization passes depend on
libtarget.

There is a historical reason for this, but it doesn't make any sense anymore. 
The solution is simple: we should move the functionality of TargetData to a new
(VMCore) "DataLayout" class, and Module should (optionally) have a pointer to a
lazily constructed DataLayout instance.  A call of Module::getDataLayout()
should lazily construct the DataLayout instance, and
Module::setDataLayout(string) should free it if it has been allocated.  The
lifetime of StructLayout instances should be tied to the lifetime of the
DataLayout instance.

All of the interfaces that TargetData vends should stay the same of course.

-Chris

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list