[llvm] r234175 - DebugInfo: Use MDFile instead of accessing operands directly, NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Apr 6 09:43:40 PDT 2015


Author: dexonsmith
Date: Mon Apr  6 11:43:40 2015
New Revision: 234175

URL: http://llvm.org/viewvc/llvm-project?rev=234175&view=rev
Log:
DebugInfo: Use MDFile instead of accessing operands directly, NFC

Modified:
    llvm/trunk/lib/IR/DebugInfo.cpp

Modified: llvm/trunk/lib/IR/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=234175&r1=234174&r2=234175&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Mon Apr  6 11:43:40 2015
@@ -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 "";
 }
 





More information about the llvm-commits mailing list