[llvm] [NFC] Fix deprecated use of lookupTarget in Kaleidoscope (PR #162220)

Connector Switch via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 6 21:19:15 PDT 2025


https://github.com/c8ef created https://github.com/llvm/llvm-project/pull/162220

Related: https://github.com/llvm/llvm-project/commit/009da92e19aa7536daee1553cc65e40e1bb60372

>From f96889b4306986709cf0c279924ab09165e360b2 Mon Sep 17 00:00:00 2001
From: c8ef <c8ef at outlook.com>
Date: Tue, 7 Oct 2025 12:18:08 +0800
Subject: [PATCH] [NFC] Fix deprecated use of lookupTarget in Kaleidoscope

---
 llvm/examples/Kaleidoscope/Chapter8/toy.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp
index 739b8954aa8b2..1575211978b96 100644
--- a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp
@@ -1228,7 +1228,8 @@ int main() {
   TheModule->setTargetTriple(Triple(TargetTriple));
 
   std::string Error;
-  auto Target = TargetRegistry::lookupTarget(TargetTriple, Error);
+  auto Target =
+      TargetRegistry::lookupTarget(TheModule->getTargetTriple(), Error);
 
   // Print an error and exit if we couldn't find the requested target.
   // This generally occurs if we've forgotten to initialise the



More information about the llvm-commits mailing list