[LLVMbugs] [Bug 14673] New: Mismatchs between Datalayout documentation and code.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 20 13:08:09 PST 2012


             Bug #: 14673
           Summary: Mismatchs between Datalayout documentation and code.
           Product: Documentation
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: General docs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: stephen.mcgruer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 9746
  --> http://llvm.org/bugs/attachment.cgi?id=9746
Patch for data layout documentation.

When implementing a new backend for LLVM, I discovered that there seems to be a
number of discrepancies between the default alignments in the documentation for
Datalayout (http://llvm.org/docs/LangRef.html#data-layout) and in the code
at time of writing). These are:

1. Aggregates are specified in the documentation as defaulting to a0:0:1, but
are set as a0:0:64 by the code.

2. The documentation specifies that "p1:32:32:32" and "p2:16:16:16" are set as
defaults for pointers in address space 1 and 2, but this doesn't seem to be
backed by the code (which has only a single reference to
"setPointerAlignment(0, 8, 8, 8)", i.e. the "p0:64:64:64" case.)

3. The documentation specifies that "s0:64:64" is set as the default for the
stack, but this doesn't seem to be backed by the code.

4. Two additional float size/alignments are specified in the code,
corresponding to "f16:16:16" and "f128:128:128".

Dumping the data layout in DataLayout.init() before the target-specific string
is parsed shows these differences:


I'm unsure if it would be considered that the documentation or the code would
be incorrect, but I have attached a documentation patch for the differences,
since that is far simpler to correct.

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