[LLVMbugs] [Bug 22777] New: Make the debug info hierarchy strict

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 3 16:51:02 PST 2015


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

            Bug ID: 22777
           Summary: Make the debug info hierarchy strict
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: dexonsmith at apple.com
          Reporter: dexonsmith at apple.com
                CC: aprantl at apple.com, dblaikie at gmail.com,
                    echristo at gmail.com, friss at apple.com,
                    llvmbugs at cs.uiuc.edu
            Blocks: 21432
    Classification: Unclassified

After introducing specialized metadata nodes in bug 22464, we can take
advantage of having a real type hierarchy.  There's a lot of looseness in the
debug info IR.  I'll use this bug to track fixing it.

Here's a rough guide of what I think needs doing:

1. Turn on the debug info verifier by default.  This will require cleaning up
some testcase bitrot; I might also have to work through some real bugs that
have crept in.  (You may wonder, why was this turned off in the first place? 
It's way too expensive as a function pass, since many functions transitively
reference the entire type hierarchy.  But r206300 changed it to a module pass
so the overhead should be reasonable (and worth it).)

2. Check types everywhere:
(a) Add type checks to the verifier.  For example, verify that `!dbg` points at
`MDLocation`s and that `MDLocation::getInlinedAt()` returns an `MDLocation`. 
(There are a ton of things like this.)
(b) Change DIDescriptor accessors to `cast<>` or `cast_or_null<>`.
(c) Change the specialized nodes to `cast<>` and `cast_or_null<>` their operand
accessors.

3. Empty out the DIDescriptor wrappers.
(a) Override `operator->()` and `operator*()` for subclasses to point at the
specialized nodes.
(b) Remove wrapping accessors, forcing null checks in the users.

After that, it'll be pretty natural to remove the `DIDescriptor` wrappers
entirely (and use the specialized nodes directly).

-- 
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/20150304/fe771dfb/attachment.html>


More information about the llvm-bugs mailing list