]> granicus.if.org Git - clang/commitdiff
Drive by cleanup
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 13 Aug 2013 04:21:38 +0000 (04:21 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 13 Aug 2013 04:21:38 +0000 (04:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188251 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index f45a20057940f38efd2ef947a8530bc3c72b513e..1d3bad9f6dd128d2d092c808313121e848fabdce 100644 (file)
@@ -1926,10 +1926,7 @@ llvm::DIType CGDebugInfo::getCompletedTypeOrNull(QualType Ty) {
   }
 
   // Verify that any cached debug info still exists.
-  if (V != 0)
-    return llvm::DIType(cast<llvm::MDNode>(V));
-
-  return llvm::DIType();
+  return llvm::DIType(cast_or_null<llvm::MDNode>(V));
 }
 
 void CGDebugInfo::completeFwdDecl(const RecordDecl &RD) {
@@ -1972,9 +1969,7 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, llvm::DIFile Unit,
   // Unwrap the type as needed for debug information.
   Ty = UnwrapTypeForDebugInfo(Ty, CGM.getContext());
 
-  llvm::DIType T = getCompletedTypeOrNull(Ty);
-
-  if (T) {
+  if (llvm::DIType T = getCompletedTypeOrNull(Ty)) {
     // If we're looking for a definition, make sure we have definitions of any
     // underlying types.
     if (const TypedefType* TTy = dyn_cast<TypedefType>(Ty))