From 0804e6e0ad2862826497677a4c26c6a9d7c3d66c Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 8 Mar 2010 20:53:17 +0000 Subject: [PATCH] Avoid using DIDescriptor.isNull(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97976 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 0f3502e9be..9b469452a3 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -98,7 +98,7 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) { // See if this compile unit has been used before for this valid location. llvm::DICompileUnit &Unit = CompileUnitCache[FID]; - if (!Unit.isNull()) return Unit; + if (Unit.Verify()) return Unit; } // Get absolute path name. @@ -698,7 +698,7 @@ CollectCXXBases(const CXXRecordDecl *RD, llvm::DICompileUnit Unit, /// getOrCreateVTablePtrType - Return debug info descriptor for vtable. llvm::DIType CGDebugInfo::getOrCreateVTablePtrType(llvm::DICompileUnit Unit) { - if (!VTablePtrType.isNull()) + if (VTablePtrType.isValid()) return VTablePtrType; ASTContext &Context = CGM.getContext(); @@ -1306,8 +1306,8 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, llvm::DenseMap::iterator FI = SPCache.find(FD); if (FI != SPCache.end()) { - llvm::DISubprogram SP(dyn_cast_or_null(FI->second)); - if (!SP.isNull() && SP.isSubprogram() && SP.isDefinition()) { + llvm::DIDescriptor SP(dyn_cast_or_null(FI->second)); + if (SP.isSubprogram() && llvm::DISubprogram(SP.getNode()).isDefinition()) { RegionStack.push_back(SP.getNode()); RegionMap[D] = llvm::WeakVH(SP.getNode()); return; -- 2.40.0