[polly] d33864d - [polly] Fix cppcheck SA comment reported in #91235 (#93505)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 28 11:42:01 PDT 2024
Author: Karthika Devi C
Date: 2024-05-28T11:41:58-07:00
New Revision: d33864d5d8ae55ff1c86510dc475fd9dd72d61c7
URL: https://github.com/llvm/llvm-project/commit/d33864d5d8ae55ff1c86510dc475fd9dd72d61c7
DIFF: https://github.com/llvm/llvm-project/commit/d33864d5d8ae55ff1c86510dc475fd9dd72d61c7.diff
LOG: [polly] Fix cppcheck SA comment reported in #91235 (#93505)
This patch moves the unreachable assert before return statement.
Fixes #91235.
Added:
Modified:
polly/include/polly/ScheduleTreeTransform.h
Removed:
################################################################################
diff --git a/polly/include/polly/ScheduleTreeTransform.h b/polly/include/polly/ScheduleTreeTransform.h
index ee504c4e5f524..6bd5a3abf9ea2 100644
--- a/polly/include/polly/ScheduleTreeTransform.h
+++ b/polly/include/polly/ScheduleTreeTransform.h
@@ -47,9 +47,9 @@ struct ScheduleTreeVisitor {
return getDerived().visitSequence(Node.as<isl::schedule_node_sequence>(),
std::forward<Args>(args)...);
case isl_schedule_node_set:
+ assert(isl_schedule_node_n_children(Node.get()) >= 2);
return getDerived().visitSet(Node.as<isl::schedule_node_set>(),
std::forward<Args>(args)...);
- assert(isl_schedule_node_n_children(Node.get()) >= 2);
case isl_schedule_node_leaf:
assert(isl_schedule_node_n_children(Node.get()) == 0);
return getDerived().visitLeaf(Node.as<isl::schedule_node_leaf>(),
More information about the llvm-commits
mailing list