[llvm] Make BytecodeOpInterface self-contained (PR #98676)

Peter Foley via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 11:27:05 PDT 2024


https://github.com/pefoley2 created https://github.com/llvm/llvm-project/pull/98676

BytecodeOpInterface.h includes BytecodeReader.h and BytecodeWriter.h

However, the BytecodeReader and BytecodeWriter targets depend on the
BytecodeOpInterface target, so they can't be added to deps without
creating a circular dependency.

Work around this by adding the headers to srcs.


>From e0b13824343f74b608780f61fee7e53222bb892b Mon Sep 17 00:00:00 2001
From: Peter Foley <pefoley at google.com>
Date: Fri, 12 Jul 2024 14:22:59 -0400
Subject: [PATCH] Make BytecodeOpInterface self-contained

BytecodeOpInterface.h includes BytecodeReader.h and BytecodeWriter.h

However, the BytecodeReader and BytecodeWriter targets depend on the
BytecodeOpInterface target, so they can't be added to deps without
creating a circular dependency.

Work around this by adding the headers to srcs.
---
 utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index ab3757342c76f..c6bfd8f204e2a 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -8643,7 +8643,11 @@ gentbl_cc_library(
 
 cc_library(
     name = "BytecodeOpInterface",
-    srcs = ["lib/Bytecode/BytecodeOpInterface.cpp"],
+    srcs = [
+        "include/mlir/Bytecode/BytecodeReader.h",
+        "include/mlir/Bytecode/BytecodeWriter.h",
+        "lib/Bytecode/BytecodeOpInterface.cpp",
+    ],
     hdrs = [
         "include/mlir/Bytecode/BytecodeImplementation.h",
         "include/mlir/Bytecode/BytecodeOpInterface.h",



More information about the llvm-commits mailing list