This is an archive of the discontinued LLVM Phabricator instance.

[ModuleUtils] Move EmbedBufferInModule to LLVMTransformsUtils
ClosedPublic

Authored by MaskRay on Jan 31 2022, 4:20 PM.

Details

Summary

D116542 adds EmbedBufferInModule which introduces a layer violation
(https://llvm.org/docs/CodingStandards.html#library-layering).
See 2d5f857a1eaf5f7a806d12953c79b96ed8952da8 for detail.

EmbedBufferInModule does not use BitcodeWriter functionality and should be moved
LLVMTransformsUtils. While here, change the function case to the prevailing
convention.

It seems that EmbedBufferInModule just follows the steps of
EmbedBitcodeInModule. EmbedBitcodeInModule calls WriteBitcodeToFile but has IR
update operations which ideally should be refactored to another library.

Diff Detail

Event Timeline

MaskRay created this revision.Jan 31 2022, 4:20 PM
MaskRay requested review of this revision.Jan 31 2022, 4:20 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 31 2022, 4:20 PM
jhuber6 accepted this revision.Jan 31 2022, 4:25 PM

LGTM, thanks for fixing this.

This revision is now accepted and ready to land.Jan 31 2022, 4:25 PM
MaskRay added inline comments.Jan 31 2022, 4:26 PM
llvm/include/llvm/Bitcode/BitcodeWriter.h
168

Note that the convention is to use imperative sentences. Embed

This revision was landed with ongoing or failed builds.Jan 31 2022, 4:34 PM
This revision was automatically updated to reflect the committed changes.