From 67eba806728c45c5ff34e9ddedc9b612db5a3868 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 7 May 2010 23:05:55 +0000 Subject: [PATCH] If there is not any debug info for type then do not emit debug info for this variable. A recent change to tightly verify debug info prepared by FE caught this. This fixes unittest build. llvm-svn: 103320 --- clang/lib/CodeGen/CGDebugInfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 3a8d3dc017e6..fff4d60cc1fd 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1478,6 +1478,11 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, else Ty = getOrCreateType(VD->getType(), Unit); + // If there is not any debug info for type then do not emit debug info + // for this variable. + if (!Ty) + return; + // Get location information. SourceManager &SM = CGM.getContext().getSourceManager(); PresumedLoc PLoc = SM.getPresumedLoc(VD->getLocation());