This is an archive of the discontinued LLVM Phabricator instance.

[openmp] Introduce optional plugin init/deinit functions
ClosedPublic

Authored by JonChesterfield on Jul 28 2022, 7:51 AM.

Details

Summary

Will allow plugins to migrate away from using global variables to
manage lifetime, which will fix a segfault discovered in relation to D127432

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 7:51 AM
JonChesterfield requested review of this revision.Jul 28 2022, 7:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2022, 7:51 AM
  • update comment

Manually tested by permuting the stubs added to the amdgpu plugin (return success, fail, delete the function). Decided init failing should be treated equivalently to failing to open the plugin at all, and deinit failing should be warning message and otherwise ignored.

jhuber6 accepted this revision.Jul 28 2022, 7:58 AM

LG,

Right now initialization and destruction happens from a static class in the plugins. This isn't really a good solution as per the LLVM coding standards https://llvm.org/docs/CodingStandards.html#do-not-use-static-constructors so it's good to replace these with explicit calls via these new functions.

This revision is now accepted and ready to land.Jul 28 2022, 7:58 AM