DebugInfo: Add forwarding getFilename() accessor to new hierarchy

Add forwarding `getFilename()` and `getDirectory()` accessors to nodes
in the new hierarchy that define a `getFile()`.  Use that to
re-implement existing functionality in the `DIDescriptor` hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234671 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-11 00:39:43 +00:00
parent ff49ef7838
commit 5fc3fbd3ca
3 changed files with 47 additions and 20 deletions

View File

@@ -143,20 +143,6 @@ StringRef DIScope::getName() const {
return StringRef();
}
StringRef DIScope::getFilename() const {
if (auto *N = get())
if (auto *F = N->getFile())
return F->getFilename();
return "";
}
StringRef DIScope::getDirectory() const {
if (auto *N = get())
if (auto *F = N->getFile())
return F->getDirectory();
return "";
}
void DICompileUnit::replaceSubprograms(DIArray Subprograms) {
get()->replaceSubprograms(MDSubprogramArray(Subprograms));
}