Skip to content

Conversation

@andykaylor
Copy link
Collaborator

This backports a problem I noticed while upstreaming constant initialization of automatic aggregate variables. Even though the aggregate is being initialized, we weren't setting the init attribute.

There is one odd case where the constant being used to initialize a class is an undef. OGCG does the same thing. In this patch I'm not attempting to detect that case, and I'm not sure if we should.

This backports a problem I noticed while upstreaming constant initialization
of automatic aggregate variables. Even though the aggregate is being
initialized, we weren't setting the `init` attribute.

There is one odd case where the constant being used to initialize a
class is an undef. OGCG does the same thing. In this patch I'm not
attempting to detect that case, and I'm not sure if we should.
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bcardosolopes bcardosolopes merged commit 610ec53 into llvm:main Nov 10, 2025
10 checks passed
@andykaylor andykaylor deleted the autovar-const-init branch November 10, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants