This is an archive of the discontinued LLVM Phabricator instance.

[LangRef] Global variable declarations imply minimum size
ClosedPublic

Authored by nikic on Feb 1 2023, 2:22 AM.

Details

Summary

Adjust the wording added in D78952 to say that global variable declarations (and interposable definitions) do imply a minimum size (and alignment) on the global. They just don't imply a maximum size.

We rely on these semantics in at least two places:

Diff Detail

Event Timeline

nikic created this revision.Feb 1 2023, 2:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2023, 2:22 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
nikic requested review of this revision.Feb 1 2023, 2:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2023, 2:22 AM
efriedma accepted this revision.Feb 7 2023, 6:05 PM

This seems straightforward enough, and should be compatible with existing practice as far as I know. (If you have a global of unknown size, you can always set the type to a zero-length array.) LGTM.

This revision is now accepted and ready to land.Feb 7 2023, 6:05 PM
arsenm accepted this revision.Feb 7 2023, 6:06 PM
This revision was automatically updated to reflect the committed changes.