This is an archive of the discontinued LLVM Phabricator instance.

[libc] Fix global constructor being emitted for the RPC client
ClosedPublic

Authored by jhuber6 on Jul 19 2023, 8:59 AM.

Details

Summary

The indirection here is for some reason causing an unnecessary
constructor. If we leave this uninitialized we will get the default
constructor which simply zero initliaizes the global. I've checked the
output and confirmed that it uses the zeroinitializer so this should
be safe.

Diff Detail

Event Timeline

jhuber6 created this revision.Jul 19 2023, 8:59 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 19 2023, 8:59 AM
jhuber6 requested review of this revision.Jul 19 2023, 8:59 AM
JonChesterfield accepted this revision.Jul 19 2023, 9:05 AM
This revision is now accepted and ready to land.Jul 19 2023, 9:05 AM
jhuber6 updated this revision to Diff 542061.Jul 19 2023, 9:12 AM

Better solution, default initializing everything else also prevents it from being emitted.

JonChesterfield accepted this revision.Jul 19 2023, 9:19 AM
This revision was landed with ongoing or failed builds.Jul 19 2023, 9:38 AM
This revision was automatically updated to reflect the committed changes.