[llvm] r234693 - DebugInfo: Assume a valid pointer for DISubprogram::getFunction()

Duncan P. N. Exon Smith dexonsmith at apple.com
Sat Apr 11 11:15:49 PDT 2015


Author: dexonsmith
Date: Sat Apr 11 13:15:48 2015
New Revision: 234693

URL: http://llvm.org/viewvc/llvm-project?rev=234693&view=rev
Log:
DebugInfo: Assume a valid pointer for DISubprogram::getFunction()

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=234693&r1=234692&r2=234693&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Sat Apr 11 13:15:48 2015
@@ -90,9 +90,8 @@ bool DIVariable::isInlinedFnArgument(con
 }
 
 Function *DISubprogram::getFunction() const {
-  if (auto *N = get())
-    if (auto *C = dyn_cast_or_null<ConstantAsMetadata>(N->getFunction()))
-      return dyn_cast<Function>(C->getValue());
+  if (auto *C = dyn_cast_or_null<ConstantAsMetadata>(get()->getFunction()))
+    return dyn_cast<Function>(C->getValue());
   return nullptr;
 }
 





More information about the llvm-commits mailing list