[all-commits] [llvm/llvm-project] 85dfe1: [ModuleUtils] Move EmbedBufferInModule to LLVMTran...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Jan 31 16:34:09 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85dfe19b36ba6e9657612e072c9183ce168fdbbc
      https://github.com/llvm/llvm-project/commit/85dfe19b36ba6e9657612e072c9183ce168fdbbc
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-01-31 (Mon, 31 Jan 2022)

  Changed paths:
    M clang/lib/CodeGen/BackendUtil.cpp
    M llvm/include/llvm/Bitcode/BitcodeWriter.h
    M llvm/include/llvm/Transforms/Utils/ModuleUtils.h
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    M llvm/lib/Transforms/Utils/ModuleUtils.cpp
    M utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

  Log Message:
  -----------
  [ModuleUtils] Move EmbedBufferInModule to LLVMTransformsUtils

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.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D118666




More information about the All-commits mailing list