IR: Specialize MDScope::getFile() for MDFile
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 28 Feb 2015 21:47:02 +0000 (21:47 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 28 Feb 2015 21:47:02 +0000 (21:47 +0000)
commit5bcf130056eeeea49a51a40fe088dc85f85bcb1d
treeb3b7ca00c1237722152b96140ce73dad1afd17b1
parent80f65ca7eed6398db23118a36c975ea8854163f3
IR: Specialize MDScope::getFile() for MDFile

Fix `MDScope::getFile()` so that it correctly returns a valid `MDFile`
even when it's an instance of `MDFile`.  This logic is necessary because
of r230057.  I'm working on moving the new hierarchy into place
out-of-tree (on track to commit Monday morning, BTW), and this was
exposed by a few failing tests.

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