DebugInfo: Allow isa<> on DIDescriptor and subclasses
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 22:32:20 +0000 (22:32 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 22:32:20 +0000 (22:32 +0000)
commit44804c3f13c5922cdf1e478090d8275b6a953e8e
tree2531a78fb624e8510530e81c5523584561f198d6
parentd58de064b8eb041efab796c37986718311d0ee7a
DebugInfo: Allow isa<> on DIDescriptor and subclasses

Allow LLVM-style casting on `DIDescriptor` and its subclasses so they
can behave more like raw pointers.  I haven't bothered with tests since
I have a follow-up commit coming shortly that uses them extensively in
tree, and I'm hoping to kill `DIDescriptor` entirely before too long (so
they won't have time to bitrot).

Usage examples:

    DIDescriptor D = foo();
    if (DICompileUnit CU = dyn_cast<MDCompileUnit>(D))
      return bar(CU);
    else if (auto *SP = dyn_cast<MDSubprogram>(D))
      return baz(SP);
    return other(D);

llvm-svn: 234250
llvm/include/llvm/IR/DebugInfo.h