[PATCH] D118666: [ModuleUtils] Move EmbedBufferInModule to LLVMTransformsUtils

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 16:20:25 PST 2022


MaskRay created this revision.
MaskRay added reviewers: jhuber6, JonChesterfield.
Herald added subscribers: ormris, hiraditya, mgorny.
MaskRay requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

D116542 <https://reviews.llvm.org/D116542> adds EmbedBufferInModule which introduces a layer violation
(https://llvm.org/docs/CodingStandards.html#library-layering).
See 2d5f857a1eaf5f7a806d12953c79b96ed8952da8 <https://reviews.llvm.org/rG2d5f857a1eaf5f7a806d12953c79b96ed8952da8> 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118666

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  llvm/include/llvm/Bitcode/BitcodeWriter.h
  llvm/include/llvm/Transforms/Utils/ModuleUtils.h
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/Bitcode/Writer/CMakeLists.txt
  llvm/lib/Transforms/Utils/ModuleUtils.cpp
  utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118666.404764.patch
Type: text/x-patch
Size: 5260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220201/96cc3cd1/attachment.bin>


More information about the llvm-commits mailing list