From 5bc514b74eed31e797a187ce9e343e19772af29a Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 26 Jul 2023 14:17:35 -0700 Subject: [PATCH] [bazel] Remove the dependency on CodeGen from MCTargetDesc & Utils This means llvm-mc should now build without depending on the target CodeGen libraries. Fix up a few includes in RISCV, AMDGPU, and X86 MCA to avoid transitive deps on CodeGen. Fixes #64166 --- llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.cpp | 2 +- llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.cpp | 1 - llvm/lib/Target/X86/MCA/X86CustomBehaviour.cpp | 2 +- utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | 3 --- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.cpp b/llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.cpp index cbe1206e6498..bf65be3fe903 100644 --- a/llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.cpp +++ b/llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.cpp @@ -13,7 +13,7 @@ #include "AMDGPUCustomBehaviour.h" #include "MCTargetDesc/AMDGPUMCTargetDesc.h" -#include "SIInstrInfo.h" +#include "Utils/AMDGPUBaseInfo.h" #include "TargetInfo/AMDGPUTargetInfo.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/WithColor.h" diff --git a/llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.cpp b/llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.cpp index 8f8684e30b3a..70111a24c55c 100644 --- a/llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.cpp +++ b/llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.cpp @@ -14,7 +14,6 @@ #include "RISCVCustomBehaviour.h" #include "MCTargetDesc/RISCVMCTargetDesc.h" #include "RISCV.h" -#include "RISCVInstrInfo.h" #include "TargetInfo/RISCVTargetInfo.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/Debug.h" diff --git a/llvm/lib/Target/X86/MCA/X86CustomBehaviour.cpp b/llvm/lib/Target/X86/MCA/X86CustomBehaviour.cpp index 78379290aae9..84a3ee3ef27e 100644 --- a/llvm/lib/Target/X86/MCA/X86CustomBehaviour.cpp +++ b/llvm/lib/Target/X86/MCA/X86CustomBehaviour.cpp @@ -13,7 +13,7 @@ #include "X86CustomBehaviour.h" #include "TargetInfo/X86TargetInfo.h" -#include "X86InstrInfo.h" +#include "MCTargetDesc/X86BaseInfo.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/WithColor.h" diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel index 6e71e0b2617c..88a0ddcf6ec7 100644 --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -2271,9 +2271,6 @@ gentbl( strip_include_prefix = "lib/Target/" + target["name"], deps = [ ":BinaryFormat", - # Depending on `:CodeGen` headers in this library is almost - # certainly a layering problem in numerous targets. - ":CodeGen", ":CodeGenTypes", ":DebugInfoCodeView", ":MC",