DebugInfo: Reimplement DIRef<>::resolve() using TypedDebugNodeRef<>
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 22:27:37 +0000 (22:27 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 22:27:37 +0000 (22:27 +0000)
commita10307bf9543b8ff09a1469ca36bf500a465a73b
tree573b7f2b09da10fd232d26965acb702823adcbc6
parent93d8e23940924ca078e9b85e25e0e6ad96a8d8f7
DebugInfo: Reimplement DIRef<>::resolve() using TypedDebugNodeRef<>

Gut `DIRef<>::resolve()`, reimplementing it using
`TypedDebugNodeRef<>::resolve()`.  Use three separate functions rather
than some sort of type traits, since the latter (i.e., mapping `DIScope`
=> `MDScope`) seems heavy-handed.  I don't expect `DIRef<>` to last much
longer in tree anyway.

As a drive-by fix, make `TypedDebugNodeRef<>::resolve()` do the right
thing with `nullptr`.

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