[llvm] [CodeGen][NewPM] Improve start/stop pass error message CodeGenPassBuilder (PR #102591)

Akshat Oke via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 02:52:44 PDT 2024


https://github.com/Akshat-Oke created https://github.com/llvm/llvm-project/pull/102591

Remove the pass-name-to-class-name lookup because it does not exist (that's why this error is thrown). Print the name given as the option instead.

>From e3408f192f4b51d3674ad1bbda2fe26db36c9e56 Mon Sep 17 00:00:00 2001
From: Akshat Oke <Akshat.Oke at amd.com>
Date: Fri, 9 Aug 2024 09:39:19 +0000
Subject: [PATCH] [CodeGen][NewPM] Improve start/stop error message

Remove the pass-name-to-class-name lookup because it does not exist (that's why this error is thrown). Print the given name in the option instead.
---
 llvm/include/llvm/Passes/CodeGenPassBuilder.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/llvm/include/llvm/Passes/CodeGenPassBuilder.h b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
index 81c00a3a95c113..e7bcd358c561aa 100644
--- a/llvm/include/llvm/Passes/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
@@ -609,14 +609,12 @@ Error CodeGenPassBuilder<Derived, TargetMachineT>::verifyStartStop(
     return Error::success();
 
   if (!Started)
-    return make_error<StringError>(
-        "Can't find start pass \"" +
-            PIC->getPassNameForClassName(Info.StartPass) + "\".",
-        std::make_error_code(std::errc::invalid_argument));
+    return make_error < StringError >
+               "Can't find start pass \"" + Info.StartPass + "\".",
+           std::make_error_code(std::errc::invalid_argument);
   if (!Stopped)
     return make_error<StringError>(
-        "Can't find stop pass \"" +
-            PIC->getPassNameForClassName(Info.StopPass) + "\".",
+        "Can't find stop pass \"" + Info.StopPass + "\".",
         std::make_error_code(std::errc::invalid_argument));
   return Error::success();
 }



More information about the llvm-commits mailing list