Skip to content

Commit 5bc514b

Browse files
committed
[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
1 parent 4bb6bbb commit 5bc514b

File tree

4 files changed

+2
-6
lines changed

4 files changed

+2
-6
lines changed

llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include "AMDGPUCustomBehaviour.h"
1515
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
16-
#include "SIInstrInfo.h"
16+
#include "Utils/AMDGPUBaseInfo.h"
1717
#include "TargetInfo/AMDGPUTargetInfo.h"
1818
#include "llvm/MC/TargetRegistry.h"
1919
#include "llvm/Support/WithColor.h"

llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "RISCVCustomBehaviour.h"
1515
#include "MCTargetDesc/RISCVMCTargetDesc.h"
1616
#include "RISCV.h"
17-
#include "RISCVInstrInfo.h"
1817
#include "TargetInfo/RISCVTargetInfo.h"
1918
#include "llvm/MC/TargetRegistry.h"
2019
#include "llvm/Support/Debug.h"

llvm/lib/Target/X86/MCA/X86CustomBehaviour.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include "X86CustomBehaviour.h"
1515
#include "TargetInfo/X86TargetInfo.h"
16-
#include "X86InstrInfo.h"
16+
#include "MCTargetDesc/X86BaseInfo.h"
1717
#include "llvm/MC/TargetRegistry.h"
1818
#include "llvm/Support/WithColor.h"
1919

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,9 +2271,6 @@ gentbl(
22712271
strip_include_prefix = "lib/Target/" + target["name"],
22722272
deps = [
22732273
":BinaryFormat",
2274-
# Depending on `:CodeGen` headers in this library is almost
2275-
# certainly a layering problem in numerous targets.
2276-
":CodeGen",
22772274
":CodeGenTypes",
22782275
":DebugInfoCodeView",
22792276
":MC",

0 commit comments

Comments
 (0)