This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Clean up access to EmittedDeferredDecls, NFCI.
ClosedPublic

Authored by Hahnfeld on Aug 2 2023, 7:15 AM.

Details

Summary

GlobalDecls should only be added to EmittedDeferredDecl if they
need reemission. This is checked in addEmittedDeferredDecl, which
is called via addDeferredDeclToEmit. Extend these checks to also
handle VarDecls (for lambdas, as tested in Interpreter/lambda.cpp)
and remove the direct access of EmittedDeferredDecls in EmitGlobal
that may actually end up duplicating FunctionDecls.

Diff Detail

Event Timeline

Hahnfeld created this revision.Aug 2 2023, 7:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 7:15 AM
Hahnfeld requested review of this revision.Aug 2 2023, 7:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 7:15 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

gentle ping :-)

Looks reasonable to me. Let's give @rjmccall couple of more days to respond.

rjmccall accepted this revision.Aug 15 2023, 12:17 PM

This looks reasonable to me.

This revision is now accepted and ready to land.Aug 15 2023, 12:17 PM
This revision was automatically updated to reflect the committed changes.