Go to file
Duncan P. N. Exon Smith fee167fcc0 IR: Make MDNode::dump() useful by adding addresses
It's horrible to inspect `MDNode`s in a debugger.  All of their operands
that are `MDNode`s get dumped as `<badref>`, since we can't assign
metadata slots in the context of a `Metadata::dump()`.  (Why not?  Why
not assign numbers lazily?  Because then each time you called `dump()`,
a given `MDNode` could have a different lazily assigned number.)

Fortunately, the C memory model gives us perfectly good identifiers for
`MDNode`.  Add pointer addresses to the dumps, transforming this:

    (lldb) e N->dump()
    !{i32 662302, i32 26, <badref>, null}

    (lldb) e ((MDNode*)N->getOperand(2))->dump()
    !{i32 4, !"foo"}

into:

    (lldb) e N->dump()
    !{i32 662302, i32 26, <0x100706ee0>, null}

    (lldb) e ((MDNode*)0x100706ee0)->dump()
    !{i32 4, !"foo"}

and this:

    (lldb) e N->dump()
    0x101200248 = !{<badref>, <badref>, <badref>, <badref>, <badref>}

    (lldb) e N->getOperand(0)
    (const llvm::MDOperand) $0 = {
      MD = 0x00000001012004e0
    }
    (lldb) e N->getOperand(1)
    (const llvm::MDOperand) $1 = {
      MD = 0x00000001012004e0
    }
    (lldb) e N->getOperand(2)
    (const llvm::MDOperand) $2 = {
      MD = 0x0000000101200058
    }
    (lldb) e N->getOperand(3)
    (const llvm::MDOperand) $3 = {
      MD = 0x00000001012004e0
    }
    (lldb) e N->getOperand(4)
    (const llvm::MDOperand) $4 = {
      MD = 0x0000000101200058
    }
    (lldb) e ((MDNode*)0x00000001012004e0)->dump()
    !{}

    (lldb) e ((MDNode*)0x0000000101200058)->dump()
    !{null}

into:

    (lldb) e N->dump()
    !{<0x1012004e0>, <0x1012004e0>, <0x101200058>, <0x1012004e0>, <0x101200058>}

    (lldb) e ((MDNode*)0x1012004e0)->dump()
    !{}

    (lldb) e ((MDNode*)0x101200058)->dump()
    !{null}

llvm-svn: 224325
2014-12-16 07:09:37 +00:00
clang [OPENMP] Bugfix for processing of global variables in OpenMP regions. 2014-12-16 07:00:22 +00:00
clang-tools-extra Update to match clang r223913. 2014-12-10 03:10:06 +00:00
compiler-rt Add an MACOS_VERSION_UNKNOWN_NEWER enum value for OS X versions above 10.10. 2014-12-16 04:46:15 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Don't include <stddef.h> 2014-11-18 14:19:27 +00:00
libcxx Revert "Fix installheaders target's permissions" 2014-12-16 05:28:07 +00:00
libcxxabi Use the newer python syntax for exceptions 2014-12-13 02:49:27 +00:00
lld Replace ReaderError with DynamicError. 2014-12-15 12:20:13 +00:00
lldb Temporarily disable CompactUnwindInfo::GetCompactUnwindInfoForFunction. 2014-12-16 06:20:30 +00:00
llgo Update to new bindings. 2014-12-13 02:26:00 +00:00
llvm IR: Make MDNode::dump() useful by adding addresses 2014-12-16 07:09:37 +00:00
openmp I apologise in advance for the size of this check-in. At Intel we do 2014-10-07 16:25:50 +00:00
polly Hand-modify a testcase (still PR21532) 2014-12-15 21:43:20 +00:00