[Bazel] Add include/llvm/Transforms/Utils/ModuleUtils.h to work around layer violatio...
authorFangrui Song <i@maskray.me>
Mon, 31 Jan 2022 23:41:45 +0000 (15:41 -0800)
committerFangrui Song <i@maskray.me>
Mon, 31 Jan 2022 23:41:45 +0000 (15:41 -0800)
There is a layer violation and can break clang -fmodule-name=X -fmodules-strict-decluse builds:

* LLVMTransformUtils has `#include "llvm/Bitcode/BitcodeWriterPass.h"`
* LLVMBitWriter depends on LLVMTransformUtils after D116542

Temporarily work around the issue.

utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

index 85d79a2..1e8a860 100644 (file)
@@ -904,6 +904,7 @@ cc_library(
         "include/llvm/Bitcode/BitcodeWriter.h",
         "include/llvm/Bitcode/BitcodeWriterPass.h",
         "include/llvm/Bitcode/LLVMBitCodes.h",
+        "include/llvm/Transforms/Utils/ModuleUtils.h",
     ],
     copts = llvm_copts,
     deps = [