aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-05-07 23:05:55 +0000
committerDevang Patel <dpatel@apple.com>2010-05-07 23:05:55 +0000
commitf4e54a2ddf50d81cb761be12ec1381a9f77a9ea9 (patch)
tree9ea02fd95d66bb079972aaed5a7c791c8f358116 /lib/CodeGen/CGDebugInfo.cpp
parentd30bf2eb6d6bbebd41236bf205d3a6dfc51a3659 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 3a8d3dc017..fff4d60cc1 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/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());