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)
commit2b8aee8cfab4399e94b5530dbadab1a831b564ca
tree65fcec653e87d8abc5b46f48c8e920f3e0238cdd
parent7bdc1cb69019584854c3292263b6c6ddabda1bb2
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);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234250 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DebugInfo.h