diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 59d1511cc26c..70025c775189 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -381,13 +381,15 @@ StringRef DIScope::getName() const { StringRef DIScope::getFilename() const { if (auto *N = get()) - return ::getStringField(dyn_cast_or_null(N->getFile()), 0); + if (auto *F = N->getFile()) + return F->getFilename(); return ""; } StringRef DIScope::getDirectory() const { if (auto *N = get()) - return ::getStringField(dyn_cast_or_null(N->getFile()), 1); + if (auto *F = N->getFile()) + return F->getDirectory(); return ""; }