Skip to content

Commit

Permalink
fixup! move hasInit check
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael137 committed Nov 10, 2023
1 parent 0827923 commit 573f9f6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clang/lib/CodeGen/CGDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5588,11 +5588,13 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) {
}

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

if (!VD->hasInit())
return;

const auto CacheIt = DeclCache.find(VD);
if (CacheIt != DeclCache.end())
return;
Expand Down Expand Up @@ -5830,9 +5832,6 @@ void CGDebugInfo::finalize() {
if (DeclCache.contains(VD))
continue;

if (!VD->hasInit())
continue;

EmitGlobalVariable(VD);
}

Expand Down

0 comments on commit 573f9f6

Please sign in to comment.