Skip to content

Commit 573f9f6

Browse files
committed
fixup! move hasInit check
1 parent 0827923 commit 573f9f6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

clang/lib/CodeGen/CGDebugInfo.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -5588,11 +5588,13 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) {
55885588
}
55895589

55905590
void CGDebugInfo::EmitGlobalVariable(const VarDecl *VD) {
5591-
assert(VD->hasInit());
55925591
assert(CGM.getCodeGenOpts().hasReducedDebugInfo());
55935592
if (VD->hasAttr<NoDebugAttr>())
55945593
return;
55955594

5595+
if (!VD->hasInit())
5596+
return;
5597+
55965598
const auto CacheIt = DeclCache.find(VD);
55975599
if (CacheIt != DeclCache.end())
55985600
return;
@@ -5830,9 +5832,6 @@ void CGDebugInfo::finalize() {
58305832
if (DeclCache.contains(VD))
58315833
continue;
58325834

5833-
if (!VD->hasInit())
5834-
continue;
5835-
58365835
EmitGlobalVariable(VD);
58375836
}
58385837

0 commit comments

Comments
 (0)