[llvm] [TargetRegistry] Remove deprecated createTargetMachine (PR #161053)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 1 09:46:44 PDT 2025
https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/161053
>From 13f984f052ddf4c602a28559131fc12439317653 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sun, 28 Sep 2025 06:34:13 +0000
Subject: [PATCH] [TargetRegistry] Remove deprecated createTargetMachine
This was included in the v21 release, so we can reasonably remove it
now. Add a TODO for the other functions that have not yet made it into a
release. It does not cost much to keep them around until the next
release given the small amount of code and should give a little bit of
extra time for some downstreams to migrate.
---
llvm/include/llvm/MC/TargetRegistry.h | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/llvm/include/llvm/MC/TargetRegistry.h b/llvm/include/llvm/MC/TargetRegistry.h
index 019ee602975f7..570d4c0e8d272 100644
--- a/llvm/include/llvm/MC/TargetRegistry.h
+++ b/llvm/include/llvm/MC/TargetRegistry.h
@@ -389,6 +389,7 @@ class Target {
/// @name Feature Constructors
/// @{
+ // TODO(boomanaiden154): Remove this function after LLVM 22 branches.
[[deprecated("Use overload accepting Triple instead")]]
MCAsmInfo *createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple,
const MCTargetOptions &Options) const {
@@ -440,6 +441,7 @@ class Target {
return MCInstrAnalysisCtorFn(Info);
}
+ // TODO(boomanaiden154): Remove this function after LLVM 22 branches.
[[deprecated("Use overload accepting Triple instead")]]
MCRegisterInfo *createMCRegInfo(StringRef TT) const {
if (!MCRegInfoCtorFn)
@@ -454,6 +456,7 @@ class Target {
return MCRegInfoCtorFn(TT);
}
+ // TODO(boomanaiden154): Remove this function after LLVM 22 branches.
[[deprecated("Use overload accepting Triple instead")]]
MCSubtargetInfo *createMCSubtargetInfo(StringRef TheTriple, StringRef CPU,
StringRef Features) const {
@@ -496,16 +499,6 @@ class Target {
JIT);
}
- [[deprecated("Use overload accepting Triple instead")]]
- TargetMachine *createTargetMachine(
- StringRef TT, StringRef CPU, StringRef Features,
- const TargetOptions &Options, std::optional<Reloc::Model> RM,
- std::optional<CodeModel::Model> CM = std::nullopt,
- CodeGenOptLevel OL = CodeGenOptLevel::Default, bool JIT = false) const {
- return createTargetMachine(Triple(TT), CPU, Features, Options, RM, CM, OL,
- JIT);
- }
-
/// createMCAsmBackend - Create a target specific assembly parser.
MCAsmBackend *createMCAsmBackend(const MCSubtargetInfo &STI,
const MCRegisterInfo &MRI,
@@ -599,6 +592,7 @@ class Target {
return nullptr;
}
+ // TODO(boomanaiden154): Remove this function after LLVM 22 branches.
[[deprecated("Use overload accepting Triple instead")]]
MCRelocationInfo *createMCRelocationInfo(StringRef TT, MCContext &Ctx) const {
return createMCRelocationInfo(Triple(TT), Ctx);
@@ -616,6 +610,7 @@ class Target {
return Fn(TT, Ctx);
}
+ // TODO(boomanaiden154): Remove this function after LLVM 22 branches.
[[deprecated("Use overload accepting Triple instead")]]
MCSymbolizer *
createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
More information about the llvm-commits
mailing list