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
This commit is contained in:
Devang Patel 2010-05-07 23:05:55 +00:00
parent 54c59312b1
commit 67eba80672
1 changed files with 5 additions and 0 deletions

View File

@ -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());