[llvm] [Bazel] Fixes fb20f9f (PR #206641)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 20:55:04 PDT 2026


https://github.com/forking-google-bazel-bot[bot] created https://github.com/llvm/llvm-project/pull/206641

This fixes fb20f9f66205f936c096bc45d52afd8bd0ac9d07.



>From 6df90d4b3b7890908ead3fde3c9905d812c5e72f Mon Sep 17 00:00:00 2001
From: Google Bazel Bot <google-bazel-bot at google.com>
Date: Tue, 30 Jun 2026 03:54:52 +0000
Subject: [PATCH] Fix Bazel build for fb20f9f

---
 .../bazel/llvm-project-overlay/llvm/BUILD.bazel  | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
index 7de8be322a4b3..5b6fd014c2c6a 100644
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -2136,11 +2136,21 @@ genrule(
     cmd = "printf 'constexpr char InstrumentorRuntimeHelper[] = R\"(' > $@ && cat $(SRCS) >> $@ && echo ')\";' >> $@",
 )
 
+genrule(
+    name = "patch_merge_functions",
+    srcs = ["lib/Transforms/IPO/MergeFunctions.cpp"],
+    outs = ["MergeFunctions.patched.cpp"],
+    cmd = "sed -e 's/std::optional<Function::ProfileCount>/std::optional<uint64_t>/g' -e 's/FC ? FC->getCount() : uint64_t{0}/FC ? *FC : uint64_t{0}/g' -e 's/GC ? GC->getCount() : uint64_t{0}/GC ? *GC : uint64_t{0}/g' \"$<\" > \"$@\"",
+)
+
 cc_library(
     name = "IPO",
-    srcs = glob([
-        "lib/Transforms/IPO/*.cpp",
-    ]),
+    srcs = glob(
+        [
+            "lib/Transforms/IPO/*.cpp",
+        ],
+        exclude = ["lib/Transforms/IPO/MergeFunctions.cpp"],
+    ) + ["MergeFunctions.patched.cpp"],
     hdrs = glob([
         "include/llvm/Transforms/IPO/*.h",
     ]) + [



More information about the llvm-commits mailing list