DebugInfo: Use MDFile instead of accessing operands directly, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 16:43:40 +0000 (16:43 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 16:43:40 +0000 (16:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234175 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DebugInfo.cpp

index 59d1511cc26c2fb8b43f372057dd70f9264964e9..70025c775189fb816269e08286a9dbaeaeb55a0f 100644 (file)
@@ -381,13 +381,15 @@ StringRef DIScope::getName() const {
 
 StringRef DIScope::getFilename() const {
   if (auto *N = get())
-    return ::getStringField(dyn_cast_or_null<MDNode>(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<MDNode>(N->getFile()), 1);
+    if (auto *F = N->getFile())
+      return F->getDirectory();
   return "";
 }