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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]
            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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to