[llvm] [NewPM] Handle error in TargetPassRegistry.inc (PR #86112)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 21 04:30:53 PDT 2024
https://github.com/paperchalice created https://github.com/llvm/llvm-project/pull/86112
Mistakenly believing that checking Expected is sufficient.
>From d839e4465ba0705d162f863414f5e1e9d7efee72 Mon Sep 17 00:00:00 2001
From: PaperChalice <liujunchang97 at outlook.com>
Date: Thu, 21 Mar 2024 19:17:59 +0800
Subject: [PATCH] [NewPM] Handle error in TargetPassRegistry.inc
---
llvm/include/llvm/Passes/TargetPassRegistry.inc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Passes/TargetPassRegistry.inc b/llvm/include/llvm/Passes/TargetPassRegistry.inc
index 50766a99f6a72f..b618331c69988e 100644
--- a/llvm/include/llvm/Passes/TargetPassRegistry.inc
+++ b/llvm/include/llvm/Passes/TargetPassRegistry.inc
@@ -80,8 +80,10 @@ if (PopulateClassToPassNames) {
#define ADD_PASS_WITH_PARAMS(NAME, CREATE_PASS, PARSER) \
if (PassBuilder::checkParametrizedPassName(Name, NAME)) { \
auto Params = PassBuilder::parsePassParameters(PARSER, Name, NAME); \
- if (!Params) \
+ if (!Params) { \
+ errs() << NAME ": " << toString(Params.takeError()) << '\n'; \
return false; \
+ } \
PM.addPass(CREATE_PASS(Params.get())); \
return true; \
}
More information about the llvm-commits
mailing list