IR: Extract macros from DILocation, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 20 Feb 2015 02:28:49 +0000 (02:28 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 20 Feb 2015 02:28:49 +0000 (02:28 +0000)
commit1ba7281189050ebbbb56b7a0ee1625f4ad0bd1bd
treeef504f64e8e8dad428b2ff519be313bee9e3f38b
parent90b8e791ac8d299caf3d8e44245dfabbc37a84de
IR: Extract macros from DILocation, NFC

`DILocation` is a lightweight wrapper.  Its accessors check for null and
the correct type, and then forward to `MDLocation`.

Extract a couple of macros to do the `dyn_cast_or_null<>` and default
return logic.  I'll be using these to minimize error-prone boilerplate
when I move the new hierarchy into place -- since all the other
subclasses of `DIDescriptor` will similarly become lightweight wrappers.

(Note that I hope to obsolete these wrappers fairly quickly, with the
goal of renaming the underlying types (e.g., I'll rename `MDLocation` to
`DILocation` once the name is free).)

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